A new open-source Model Context Protocol (MCP) server called Context Mode slashes tool output tokens in Claude Code by up to 98%. By processing logs, API responses, and browser snapshots inside isolated sandboxes, the proxy shrinks 315 KB of raw output data down to just 5.4 KB. This reduction allows developer coding sessions to run for three hours before encountering context degradation, up from thirty minutes.
How Isolated Sandboxing and Indexing Shrink Outputs
The fundamental problem with MCP tool calls is context pollution: tool definitions consume tokens on input, while raw outputs like a 56 KB Playwright snapshot consume tokens on return. With 81 active tools, up to 143K tokens (72%) can be consumed before a developer sends their first message. Context Mode resolves output overload by placing an execution barrier between Claude Code and external tools.
Context Mode executes data processing tasks inside isolated subprocesses across ten supported language runtimes, including Python, TypeScript, Go, Rust, Shell, and Bun. By running code locally and returning only standard output, Context Mode reduces 315 KB of raw output to 5.4 KB across typical developer sessions. Authenticated command-line interfaces such as aws, gh, kubectl, and docker operate via credential passthrough without exposing config paths to the chat context.
For document processing, the system relies on an integrated SQLite FTS5 table with BM25 ranking and Porter stemming. Calling fetch_and_index processes web pages into Markdown chunks locally so raw HTML content never enters the LLM prompt.
Real-World Token Compression Benchmarks
Developer Mert Köseoğlu validated Context Mode across 11 real-world engineering scenarios. The benchmarks demonstrated significant data reductions across common developer workflows:
- Playwright snapshots: Reduced from 56 KB to 299 B
- GitHub issue lists (20 issues): Reduced from 59 KB to 1.1 KB
- Server access logs (500 requests): Reduced from 45 KB to 155 B
- Analytics CSV files (500 rows): Reduced from 85 KB to 222 B
- Git commit logs (153 commits): Reduced from 11.6 KB to 107 B
- Subagent repository research: Reduced from 986 KB across 37 calls to 62 KB across 5 calls
Under uncompressed conditions, 40% of Claude's 200K context window disappears within 30 minutes of tool usage. With Context Mode active, 99% of the context window remains available after 45 minutes of continuous execution.
Installation and Limitations
Developers can install Context Mode into Claude Code through the plugin marketplace or as a standalone MCP server using the following commands: