Rule: When verifying critical-plugin state at SessionStart or before tool-routing decisions, also parse claude mcp list for the running process path’s plugin-cache version, AND cross-reference against the installed plugin version. If they disagree, declare the disabled-state per global CLAUDE.md §7 “If any of the 3 critical plugins is disabled” — the hooks may still be active (so WebFetch / curl / wget remain blocked) but the MCP tools may not be exposed in the session’s tool registry.
Why: On Friday 22 May 2026 at ~09:50 BST in a docs-strategy session, R7 batched pgvector statute ingest (per batch-imp-14 §1.3) was blocked by exactly this skew. Sequence of events:
- Sometime before 2026-05-22, context-mode plugin upgraded 1.0.140 → 1.0.146 in
~/.claude/plugins/cache/context-mode/context-mode/(per memory observation S715 + 3458). - The MCP server registration in Claude Code stayed pointed at
1.0.140/start.mjs—claude mcp listshowed/home/richardd/.bun/bin/bun /home/richardd/.claude/plugins/cache/context-mode/context-mode/1.0.140/start.mjs - ✓ Connected. Threebun ...1.0.140/start.mjsprocesses were running. - The SessionStart ceremony at
~/testatetech/docs-strategy/scripts/session-start-status.shgrepsinstalled_plugins.jsonfor “context-mode” — returned✓ ENABLEDbecause the plugin IS installed. ctx-doctorshowed v1.0.146 plugin cache + all checks PASS — because it reads the LATEST cached version, not the registered MCP server’s pinned version.- The PreToolUse hook at v1.0.140 was still active — it BLOCKED WebFetch with the “use ctx_fetch_and_index” error.
- But
ToolSearchformcp__plugin_context-mode_context-mode__ctx_fetch_and_index/ctx_batch_execute/ctx_executereturned EMPTY — the v1.0.140 tools weren’t exposed in the session’s tool registry. - Result: R7 canonical workflow (ctx_fetch_and_index → FTS5 cache → ingest_external_primary_sources.py per A-244 BATCH SCF-11 precedent) was blocked. WebFetch blocked. Bash curl/wget blocked. No fallback path was discoverable without Rich-decision.
The session-start ceremony’s three-plugin check (per BATCH improvement 5 A-262 extended to all 3 critical plugins) catches plugin disabled / uninstalled / not-enabled. It does NOT catch the in-between state of “plugin installed but running MCP server is from an older cache version.” That gap should be closed.
How to apply:
-
Update
~/testatetech/docs-strategy/scripts/session-start-status.shto add a third check per plugin (after theinstalled_plugins.jsongrep): parseclaude mcp list 2>&1 | grep <plugin-name>and extract the cache-version path component (e.g.,.../context-mode/context-mode/1.0.140/...). Cross-reference againstls ~/.claude/plugins/cache/context-mode/context-mode/ | sort -V | tail -1. If different, flag as⚠ STALE MCP SERVER — running v$RUNNING vs installed v$INSTALLED — restart Claude Code or kill MCP processes to reconcile. -
For pre-fetch / ingest workflows that depend on
ctx_fetch_and_index(the R7 / SCF-11 / SCF-9 workflow shape): include a precondition gate at §0 of the launch prompt that testsToolSearch select:mcp__plugin_context-mode_context-mode__ctx_fetch_and_indexBEFORE attempting the fetch step. If empty, stop and surface to Rich rather than silently substituting an alternative. Seebatch-imp-15-r7-pgvector-statute-ingest-launch-prompt.md§0 for the canonical precondition-gate template. -
Plugin-upgrade hygiene: after
/updateor plugin-cache changes, exit + re-enter Claude Code to refresh MCP server registration. The plugin’s.mcp.jsonwill then re-register against the newest cache version. Do not assume in-session that an upgrade is automatically picked up. -
For diagnostic completeness, when reporting
[critical-plugin state] ENABLEDin session-start output, append the running MCP server version explicitly (e.g.,ENABLED · MCP v1.0.146) so future-Claude reads BOTH the plugin-enabled flag AND the running version at session start without an additional discovery step.
Companion files:
~/testatetech/docs-strategy/docs/superpowers/specs/2026-04-29-multi-phase-audit/batch-imp-15-r7-pgvector-statute-ingest-launch-prompt.mdv1.0 §0 — canonical precondition-gate template that operationalises this rule for any future ctx_fetch_and_index-dependent batch~/testatetech/docs-strategy/scripts/session-start-status.sh— target for the third-check enhancement (per “How to apply” #1 above)~/.claude/CLAUDE.md§7 sub-subsection “context-mode” — current passive-layer fallback table; this rule extends the table by adding a NEW failure mode (version-skew distinct from “plugin off”)~/.claude/CLAUDE.md§0 — context-mode tool routing table; the routing is correct, but the tool registry may not match[[gsd-installer-preserves-user-baseline-since-1-41]]— sister memory on plugin-upgrade hygiene patterns