Context Mode MCP Server Cuts Claude Code Context Usage by 98%

Context Mode is an MCP server that sits between Claude Code and tool outputs, reducing context window consumption by 98%. Instead of dumping raw data into the 200K context window, it processes outputs in isolated sandboxes.
How It Works
The sandbox system spawns isolated subprocesses for each execute call. Scripts run in these subprocesses with their own process boundaries, and only stdout enters the conversation context. Raw data like log files, API responses, and snapshots never leaves the sandbox.
Ten language runtimes are available: JavaScript, TypeScript, Python, Shell, Ruby, Go, Rust, PHP, Perl, and R. Bun is auto-detected for 3-5x faster JS/TS execution. Authenticated CLIs (gh, aws, gcloud, kubectl, docker) work through credential passthrough where subprocesses inherit environment variables and config paths without exposing them to the conversation.
Knowledge Base Features
The index tool chunks markdown content by headings while keeping code blocks intact, then stores them in a SQLite FTS5 virtual table. Search uses BM25 ranking with Porter stemming applied at index time. When you call search, it returns exact code blocks with their heading hierarchy.
The fetch_and_index tool extends this to URLs: fetch, convert HTML to markdown, chunk, and index. The raw page never enters context.
Performance Benchmarks
- Playwright snapshot: 56 KB → 299 B
- GitHub issues (20): 59 KB → 1.1 KB
- Access log (500 requests): 45 KB → 155 B
- Analytics CSV (500 rows): 85 KB → 222 B
- Git log (153 commits): 11.6 KB → 107 B
- Repo research (subagent): 986 KB → 62 KB (5 calls vs 37)
Over a full session: 315 KB of raw output becomes 5.4 KB. Session time before slowdown goes from ~30 minutes to ~3 hours. Context remaining after 45 minutes: 99% instead of 60%.
Installation
Two installation methods:
- Plugin Marketplace:
/plugin marketplace add mksglu/claude-context-modethen/plugin install context-mode@claude-context-mode - MCP-only:
claude mcp add context-mode -- npx -y context-mode
After installation, restart Claude Code. Context Mode includes a PreToolUse hook that automatically routes tool outputs through the sandbox. Subagents learn to use batch_execute as their primary tool, and bash subagents get upgraded to general-purpose so they can access MCP tools.
The tool is open source under MIT license at github.com/mksglu/claude-context-mode.
📖 Read the full source: HN LLM Tools
👀 See Also

CodeVibe: Push Notifications for AI Coding Agents When Blocked on Input
CodeVibe sends push notifications to your phone when AI coding agents like Claude Code get stuck waiting for approval on edit operations. You can review file diffs and respond with numbered options to keep the agent moving.

TeamHero v2.6.1: Open-Source Platform for Managing Claude AI Agents
TeamHero v2.6.1 is a local-first, open-source platform that creates a managed team of Claude agents with features like autopilot mode, subtask nesting, flow views, and persistent memory. The tool runs on Node.js with a vanilla HTML/CSS/JS dashboard and requires no database.

HolyCode: Docker Container for Persistent Claude AI Coding Environments
HolyCode is a Docker container that maintains AI coding environment state across machine switches and rebuilds. It includes 30+ preinstalled tools, browser automation with Chromium + xvfb + Playwright, and preserves context in ./data/opencode.

Open-sourced library of 59 Claude skills covers full website lifecycle
A developer released 59 reusable Claude skills covering brand discovery, design, content, SEO, development, ops, and growth — stack-agnostic, with uniform structure and CI lint validation.