by mksglu
Stop losing context to large outputs.
# Add to your Claude Code skills
git clone https://github.com/mksglu/claude-context-modeThe other half of the context problem.
Every MCP tool call in Claude Code dumps raw data into your 200K context window. A Playwright snapshot costs 56 KB. Twenty GitHub issues cost 59 KB. One access log — 45 KB. After 30 minutes, 40% of your context is gone.
Inspired by Cloudflare's Code Mode — which compresses tool definitions from millions of tokens into ~1,000 — we asked: what about the other direction?
Context Mode is an MCP server that sits between Claude Code and these outputs. 315 KB becomes 5.4 KB. 98% reduction.
https://github.com/user-attachments/assets/07013dbf-07c0-4ef1-974a-33ea1207637b
/plugin marketplace add mksglu/claude-context-mode
/plugin install context-mode@claude-context-mode
Restart Claude Code. Done. This installs the MCP server + a PreToolUse hook that automatically routes tool outputs through the sandbox + slash commands for diagnostics and upgrades.
<details> <summary><strong>MCP-only install</strong> (no hooks or slash commands)</summary> </details> <details> <summary><strong>Local development</strong></summary> </details>No comments yet. Be the first to share your thoughts!
| Command | What it does |
|---|---|
| /context-mode:stats | Show context savings for the current session — per-tool breakdown, tokens consumed, savings ratio. |
| /context-mode:doctor | Run diagnostics — checks runtimes, hooks, FTS5, plugin registration, npm and marketplace versions. |
| /context-mode:upgrade | Pull latest from GitHub, rebuild, migrate cache, fix hooks. |
claude mcp add context-mode -- npx -y context-mode
claude --plugin-dir ./path/to/context-mode
MCP has become the standard way for AI agents to use external tools. But there is a tension at its core: every tool interaction fills the context window from both sides — definitions on the way in, raw output on the way out.
With 81+ tools active, 143K tokens (72%) get consumed before your first message. And then the tools start returning data. A single Playwright snapshot burns 56 KB. A gh issue list dumps 59 KB. Run a test suite,...