Claude Context Mode Compresses Tool Outputs to Salvage AI Context Windows
MCP server slashes large data dumps from Playwright snapshots and GitHub issues, freeing up to 98% of bloated context in Claude Code sessions.
In the high-stakes world of AI-assisted coding, context windows are a precious resource. Claude Code's MCP protocol—now the de facto standard for tool integration—excels at injecting external capabilities, but it chokes on the return trip. Raw outputs from tools flood the 200K token window: a Playwright snapshot at 56 KB, 20 GitHub issues at 59 KB, or an access log at 45 KB. After 30 minutes, 40% of context evaporates.
Enter mksglu/claude-context-mode, a JavaScript-based MCP server with 915 stars. Created February 23, 2026, and last pushed March 1, it intercepts tool outputs before they hit Claude's context. Inspired by Cloudflare's Code Mode—which crushes tool definitions from millions to ~1,000 tokens—this project tackles the outbound problem. A 315 KB payload shrinks to 5.4 KB: 98% reduction.
Installation is straightforward for Claude Code users:
/plugin marketplace add mksglu/claude-context-mode
/plugin install context-mode@claude-context-mode
Restart Claude Code. This bundles the MCP server, a PreToolUse hook for automatic routing, and slash commands:
/context-mode:stats: Per-tool breakdown of tokens saved, consumption, and ratios for the session./context-mode:doctor: Diagnostics on runtimes, hooks, FTS5, plugin registration, npm, and marketplace versions (now counts 11 languages, up from 10)./context-mode:upgrade: Fetches GitHub updates, rebuilds, migrates cache, and repairs hooks.
For MCP-only setups sans hooks:
claude mcp add context-mode -- npx -y context-mode
Local dev runs via claude --plugin-dir ./path/to/context-mode.
The v0.8.1 release addresses key rough edges: skips console.clear() in non-TTY environments to prevent wiping Bash tool outputs during /upgrade and /doctor; fixes language count in diagnostics.
With 81+ tools often consuming 143K tokens (72%) upfront, this plugin matters for sustained sessions. Builders chaining gh issue list, test logs, or docs fetches gain breathing room without manual truncation. Its recency—active into March 2026—and focused fixes signal maturity amid Claude's ecosystem boom. For teams scaling AI agents, it's a pragmatic fix to the "other half of the context problem."
(Word count: 378)