# How an 8MB MCP Tool Response Crashes Claude Code — And How to Debug Prompt Cache Misses Across Agents

> Source: <https://dev.to/framy2/how-an-8mb-mcp-tool-response-crashes-claude-code-and-how-to-debug-prompt-cache-misses-across-3kob>
> Published: 2026-11-13 18:12:05+00:00

If you use **Claude Code**, **OpenAI Codex CLI**, **Cursor**, or **VS Code Copilot** with Model Context Protocol (MCP) servers, your context window and prompt cache are exposed to three silent failure modes:

`tools/list`):` github`, `postgres`, `playwright`) injects `tools/call`):`<error>Connection closed</error>` (`anthropics/claude-code#105703`` openai/codex#60383``cache_control`, or mid-session `"disableAllHooks": true` edits (`anthropics/claude-code#106225`
We built three zero-telemetry open-source tools to inspect and prevent all three:

`@framy2/ctxwise`` v1.2.0`) — Context Firewall, Multi-Editor MCP Auditor & CI Budget Guard (`Apache-2.0`)`@framy2/mcp-diet`` v0.1.1`) — Stdio MCP Proxy with `MIT`)`@framy2/agent-wire-tap`` v0.2.0`) — Local Wire Contract Tester & Live `--passthrough` Prompt-Prefix Cache-Miss Debugger (

```
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@framy2/mcp-diet@0.1.1",
        "--read-only",
        "--max-desc", "160",
        "--max-result-kb", "512",
        "--redact-secrets",
        "--",
        "npx", "-y", "@modelcontextprotocol/server-github"
      ]
    }
  }
}
```

`mcp-diet` sits on stdio between the host CLI and the upstream MCP server:

`>= 512 KiB` tool outputs to a local temp file and returns a compact `< 2 KB` preview so Claude Code (`8 MiB`) and Codex (` 16 MiB`) never tear down the pipe.` sk-ant-*`, `sk-proj-*`, `ghp_*`, `AKIA*`, DB passwords) before they reach the model transcript.

```
# Probe stdio MCP tools safely (works on Windows without shell: true) & profile token weight
npx @framy2/ctxwise mcp-xray --probe-stdio

# Check CLAUDE.md, .claude/rules/*.md, AGENTS.md, .cursor/mcp.json, and .vscode/mcp.json parity
npx @framy2/ctxwise agents --fail-on-divergence

# Scan for leaked secrets, Trojan Unicode, disableAllHooks, and unpinned `npx -y` MCP runners
npx @framy2/ctxwise shield --strict --sarif ctxwise.sarif

# Enforce ctxwise.budget.yaml across Claude, Codex, and Cursor without double-counting synced rules
npx @framy2/ctxwise budget
# CI contract test at $0.00 API cost (mock mode)
npx @framy2/agent-wire-tap \
  --assert-contains "AGENTS.md" \
  --assert-not-contains "sk-ant-" \
  --assert-max-bytes 32768 \
  --assert-max-tools 12 \
  -- codex exec "ping"

# Live transparent pass-through proxy (streams SSE & detects prefix divergence block-by-block)
npx @framy2/agent-wire-tap --passthrough https://api.anthropic.com --port 8787
```

`--passthrough` keeps credentials strictly in memory (`[REDACTED]` in traces/logs) while hashing each prefix segment (`model`, `tools[]`, `system[]`, `messages[]`) and flagging the exact `firstDivergentLayer` / `firstDivergentIndex` whenever a mutation breaks a `cache_control` breakpoint.

Paste your `.mcp.json`, `.vscode/mcp.json`, `CLAUDE.md`, or `AGENTS.md` right in the browser (100% local, zero uploads):
