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:

  1. 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).
  2. The MCP server registration in Claude Code stayed pointed at 1.0.140/start.mjsclaude mcp list showed /home/richardd/.bun/bin/bun /home/richardd/.claude/plugins/cache/context-mode/context-mode/1.0.140/start.mjs - ✓ Connected. Three bun ...1.0.140/start.mjs processes were running.
  3. The SessionStart ceremony at ~/testatetech/docs-strategy/scripts/session-start-status.sh greps installed_plugins.json for “context-mode” — returned ✓ ENABLED because the plugin IS installed.
  4. ctx-doctor showed v1.0.146 plugin cache + all checks PASS — because it reads the LATEST cached version, not the registered MCP server’s pinned version.
  5. The PreToolUse hook at v1.0.140 was still active — it BLOCKED WebFetch with the “use ctx_fetch_and_index” error.
  6. But ToolSearch for mcp__plugin_context-mode_context-mode__ctx_fetch_and_index / ctx_batch_execute / ctx_execute returned EMPTY — the v1.0.140 tools weren’t exposed in the session’s tool registry.
  7. 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:

  1. Update ~/testatetech/docs-strategy/scripts/session-start-status.sh to add a third check per plugin (after the installed_plugins.json grep): parse claude 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 against ls ~/.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.

  2. 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 tests ToolSearch select:mcp__plugin_context-mode_context-mode__ctx_fetch_and_index BEFORE attempting the fetch step. If empty, stop and surface to Rich rather than silently substituting an alternative. See batch-imp-15-r7-pgvector-statute-ingest-launch-prompt.md §0 for the canonical precondition-gate template.

  3. Plugin-upgrade hygiene: after /update or plugin-cache changes, exit + re-enter Claude Code to refresh MCP server registration. The plugin’s .mcp.json will then re-register against the newest cache version. Do not assume in-session that an upgrade is automatically picked up.

  4. For diagnostic completeness, when reporting [critical-plugin state] ENABLED in 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.md v1.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