Best for
- Developers using one of the supported AI coding CLIs, IDEs, or agents
- Teams working with large codebases, logs, web pages, or batch queries
- Users who need work-state recovery after context compaction
Context Mode is designed for context governance in AI coding agents. Isolation, output filtering, indexed retrieval, caching, and session tracking can reduce context consumption. It supports many clients, but installation complexity, automatic routing, and hook coverage vary; users should evaluate local code execution, credential inheritance, and persistent indexing before deployment.
Context Mode is an MCP server for optimizing AI coding-agent context usage through MCP and hooks. It runs tool work in isolated subprocesses and returns only stdout to the context, while providing session memory, SQLite FTS5/BM25 indexing, targeted retrieval, batch execution, and routing support across many coding clients. The README claims roughly 98% reduction for typical tool output.
Choose the configuration for the target client. The general MCP-only approach is to run npm install -g context-mode and configure the server command as context-mode; the README also provides the Claude Code command claude mcp add context-mode -- npx -y context-mode. For automatic routing and session tracking, configure the target client's hooks, plugin, or rules file as documented in the README.
{"mcpServers":{"context-mode":{"command":"npx","args":["-y","context-mode"]}}}