Context Mode is an MCP server that keeps large tool output out of a coding agent's context window. Shell commands, file reads, searches, and web fetches are intercepted before their results reach the conversation; the raw data goes into a local SQLite FTS5 store and the agent searches it when it needs a detail. A result of 315 KB becomes about 5.4 KB in context, a reduction of roughly 98%.
Session state is tracked the same way. Every file edit, git operation, task, error, and user decision is recorded as a structural event in SQLite. When the conversation compacts, those events are not dumped back into context; they are indexed into FTS5 and retrieved by BM25 search so the model resumes from where it stopped. Starting a session without --continue deletes the previous session's data.
A third strand is running analysis as code rather than as reading. Instead of loading 47 files to count something, the agent calls ctx_execute with a short script and only its printed result enters context. Eleven MCP tools ship: six sandbox tools (ctx_batch_execute, ctx_execute, ctx_execute_file, ctx_index, ctx_search, ctx_fetch_and_index) and five meta tools (ctx_stats, ctx_doctor, ctx_upgrade, ctx_purge, ctx_insight). Routing deliberately governs where data goes and not how the model writes its final answer.
Seventeen adapters cover Claude Code, Codex CLI, Gemini CLI, VS Code Copilot, JetBrains Copilot, GitHub Copilot CLI, Cursor, Qwen Code, Kimi Code, the Antigravity IDE and CLI, Kiro, Zed, and others, alongside an OpenClaw gateway integration. Platforms with hook support get automatic routing through PreToolUse, PostToolUse, SessionStart, PreCompact, UserPromptSubmit, and Stop hooks; platforms without hooks copy a routing instructions file into the project instead. Installation is a plugin marketplace entry on Claude Code and Codex, and a config-file edit elsewhere, with ctx doctor checking runtimes, hooks, FTS5, and registration.
The plugin runs entirely on the developer's machine. A separate commercial platform layer, Context Mode Insight, aggregates the same structural events — tool names, file paths, error counts, decisions, never source code — into self, team, and org views, and is opened from the ctx insight command.
Features
- Tool-output sandboxing: large results are stored locally and searched instead of being pasted into context
- FTS5 knowledge base: indexed content retrieved by BM25 search through ctx_search and ctx_index
- Session continuity: file edits, git operations, tasks, errors, and decisions survive a compaction
- Pre-compaction snapshots: PreCompact hooks build the resume state and SessionStart restores it
- Analysis as code: ctx_execute runs a script and returns only what it prints
- Eleven MCP tools: six sandbox tools plus stats, doctor, upgrade, purge, and insight meta-tools
- Seventeen platform adapters: Claude Code, Codex CLI, Gemini CLI, Copilot in VS Code, JetBrains, and the CLI, Cursor, Qwen Code, Kimi Code, Antigravity, Kiro, Zed, and more
- Hook-enforced routing: automatic interception where hooks exist, a copied routing file where they do not
- Diagnostics: ctx doctor validates runtimes, hooks, FTS5, and plugin registration; ctx stats reports savings
- Status line: a Claude Code status bar showing per-session and cumulative savings
- Local-only storage: the store and the event log stay in SQLite on the developer's machine
- Org analytics layer: a commercial platform aggregating structural events into self, team, and org scopes

