Context Mode: An MCP Server That Compresses Tool Outputs for Claude Code

What Context Mode Does
Context Mode addresses the problem where every MCP tool call in Claude Code dumps raw data into the 200K context window. Examples from the source show a Playwright snapshot costs 56 KB, twenty GitHub issues cost 59 KB, and one access log costs 45 KB. After 30 minutes, 40% of your context can be gone.
The MCP server sits between Claude Code and these outputs, processing them in sandboxes so only summaries reach the model. It achieves a 98% reduction in context usage (315 KB becomes 5.4 KB).
Installation and Setup
Single command install:
/plugin marketplace add mksglu/claude-context-mode
/plugin install context-mode@claude-context-modeOr via CLI:
claude mcp add context-mode -- npx -y context-modeThe installation includes an auto-routing skill that automatically routes large outputs through Context Mode, plus a PreToolUse hook that injects context-mode routing into subagent prompts. No prompting is needed.
Available Tools
batch_execute: Run multiple commands + search multiple queries in ONE call (986 KB → 62 KB)execute: Run code in 10 languages. Only stdout enters context (56 KB → 299 B)execute_file: Process files in sandbox. Raw content never leaves (45 KB → 155 B)index: Chunk markdown into FTS5 with BM25 ranking (60 KB → 40 B)search: Query indexed content with multiple queries in one call (on-demand retrieval)fetch_and_index: Fetch URL, convert to markdown, index (60 KB → 40 B)stats: Session token tracking with per-tool breakdown
Technical Implementation
Each execute call spawns an isolated subprocess with its own process boundary. Scripts can't access each other's memory or state. The subprocess runs your code, captures stdout, and only that stdout enters the conversation context. The raw data — log files, API responses, snapshots — never leaves the sandbox.
Ten language runtimes are available: JavaScript, TypeScript, Python, Shell, Ruby, Go, Rust, PHP, Perl, R. Bun is auto-detected for 3-5x faster JS/TS execution.
Authenticated CLIs work through credential passthrough — gh, aws, gcloud, kubectl, docker inherit environment variables and config paths without exposing them to the conversation.
When output exceeds 5 KB and an intent is provided, Context Mode switches to intent-driven filtering: it indexes the full output into the knowledge base, searches for sections matching your intent, and returns only the relevant matches with a vocabulary of searchable terms for follow-up queries.
The knowledge base uses SQLite FTS5 (Full-Text Search 5) virtual tables. The index tool chunks markdown content by headings while keeping code blocks intact, then stores them. Search uses BM25 ranking — a probabilistic relevance algorithm that scores documents based on term frequency, inverse document frequency, and document length.
📖 Read the full source: HN AI Agents
👀 See Also

Open Source Skill for Parallel AI Coding Agents with Human Gate
A markdown skill definition for running parallel Claude Code agents in separate git worktrees, with integration branch validation, smoke tests, and a hard human gate before production merge.

Comparison of 14 Claw AI Agent Variants Across 10 Categories
A detailed comparison of 14 popular Claw AI agent variants including OpenClaw, NanoClaw, NemoClaw, ZeroClaw, PicoClaw, Moltis, IronClaw, and NullClaw, scored across 53 sub-parameters with composite rankings and ideal use cases for each.

Rukuzu: Porting a 200,000 Line C++ Graph Database to Rust with Systematic Testing
The Rukuzu project describes a workflow for porting the 200,000-line C++ kuzu embedded graph database to Rust, using a Claude Code custom command to maintain both versions simultaneously and verify correctness through 2,700+ tests.

Caddie: Slack-Based OpenClaw Alternative Launches Next Week
Caddie is a Slack-based version of OpenClaw that requires no local installation or MCP configuration. Users authorize it through the Slack App Directory in 60 seconds, then type commands to automate tasks across Gmail, LinkedIn, CRM, calendar, and 100+ other tools.