context-mode
Context Mode is an MCP server and set of hooks that keeps raw tool output out of an AI coding agent's context window. Its starting observation is that every tool call dumps data into context: a Playwright snapshot, a batch of GitHub issues or an access log can each cost tens of kilobytes, and after half an hour a large share of the window is gone. Context Mode runs such tools in a sandbox and returns only what the agent needs.
It tackles four parts of the problem. Sandboxed tools cut raw output dramatically (the project reports around 98% on its examples). Session continuity tracks file edits, git operations, tasks, errors and decisions in SQLite and indexes them, so work survives context compaction without being dumped back into the window. "Think in code" encourages the agent to write a small script that computes an answer instead of reading dozens of files into context. And it deliberately does not dictate how the model writes its final answer. It works across many coding platforms through MCP and hooks, with the deepest integration as a Claude Code plugin.
Getting started: in Claude Code, add the `mksglu/context-mode` plugin marketplace, install the plugin and run `/context-mode:ctx-doctor` to verify. For other platforms, install the global binary with `npm install -g context-mode` and follow the platform-specific setup.
Features
Why choose it
Trade-offs
Maintenance check
- Last commit
- 2026-10-24
- Commits, last 90 days
- 100+
- Releases, last 90 days
- 0
- Latest release
- v1.0.169 (2026-06-29)
- Open issues
- 356
- Recent issues with at least one comment
- —
Oldest week on the left; the latest four weeks are orange. Source: GitHub commit activity.
Status rule: archived on GitHub = Archived; last commit within 90 days = Active; 91 to 365 days = Slowing; older = Stale. All figures come from the GitHub API on the date shown.
Who it fits
- Your sessions fill up with tool output such as Playwright snapshots, GitHub issue lists or logs.
- You want work state (edits, git operations, tasks, decisions) to survive context compaction without being dumped back into the window.
- You use a hook-capable agent, where tool routing happens automatically.
- You need an OSI open-source licence: it uses the Elastic License 2.0, which restricts uses such as offering it as a managed service.
- Your sessions are short and rarely hit the context limit.
- You do not want hooks changing how your agent's tools behave.
How it differs
Headroom compresses content before it reaches the model, as a library, proxy or MCP server. Context Mode runs tools in a sandbox and also tracks session state across compaction.
Compatibility
Quick start
Use cases
Alternatives
Featured in these lists
Comments
No comments yet. Be the first!