31.2K ·GitHub
What is this?
Context Mode is an MCP server plus hooks that keeps bulky tool output out of your AI coding agent's context window (98% reduction), persists session memory, and enforces tool routing across 17 platforms.
Is this a separate app, or something that plugs into the coding agent I already use?
It plugs into the agent you already use: an MCP server plus hooks. Your agent gets 11 MCP tools, and the hooks intercept large tool outputs before they flood the context window.
How do I set it up in Claude Code?
Install the plugin from the Claude Code plugin marketplace (requires v1.0.33+), restart, and run the doctor to verify. Routing is then automatic via the SessionStart hook — nothing is written to your project.
Which agents does it support, and what do I need installed first?
17 platforms including Claude Code, Gemini CLI, VS Code and JetBrains Copilot, Copilot CLI, Cursor, Codex, OpenCode, Kiro and Zed. You need Node.js 22.5+ (or Bun); some hosts want a minimum version, like Copilot Chat v0.32+.
Does it behave the same on every agent?
No. Hook-capable platforms get automatic routing enforcement; non-hook ones need a one-time routing file copy. Cursor's marketplace plugin is still awaiting review, so there you install from a local folder.
Where does my session data go?
It stays local: file edits, git operations, tasks, errors and decisions are tracked in a SQLite database on your machine, and are deleted immediately unless you resume with --continue. The one hosted piece is the opt-in Insight dashboard for team analytics.
How does it actually save 98% of context?
Sandbox tools keep raw output out of the window: a 315 KB tool result becomes 5.4 KB, and the agent queries the indexed data on demand instead of holding it all in context.
What is 'Think in Code'?
A core principle: instead of reading 50 files into context to count functions, the agent writes a script that does the counting and prints only the result — one script replaces ten tool calls and saves 100x context.
What happens to my session when the conversation gets compacted?
Context Mode doesn't dump everything back into context: it indexes session events into FTS5 and retrieves only what's relevant via BM25 search, so the model picks up exactly where it left off.
Will it make my model's answers terser?
No — it keeps raw data out of context but never dictates how the model writes its final answer. Brevity and formatting stay under your control via your own CLAUDE.md or AGENTS.md; the routing block only decides where data goes.
What are similar projects?
headroom, superpowers-zh, billion-context, agentmemory, operator-memory, jevmem, squeez, memex
Which topics is it in?
claude-code-plugins, context-window, kiro, pi-agent, mcp-tools, bm25, jetbrains, full-text-search, codex-cli, copilot, antigravity, hooks