Skip to content

context-mode

Keeps bulky tool output out of a coding agent's context and rebuilds the working state when a long session compacts.

Reviewed by Sheela · Updated

View on GitHub Free plan

Our rating

3.6/5

Worth trying for long sessions that lose the thread after compaction; nobody has yet shown the free plugin lowers your bill.

What it is

context-mode is a plugin and MCP server for coding agents. Heavy tool calls run in a sandboxed subprocess; the full output goes into a local SQLite full-text index and only a short result reaches the model, which can search the archive later. Its README says 315 KB of raw output over a session becomes 5.4 KB. In Claude Code its hooks cover Bash, Read, WebFetch, Grep, subagents and MCP calls, and it supports Gemini CLI, VS Code Copilot, OpenCode and other agents, 17 platforms in all.

It also logs file edits, git operations, tasks, errors and decisions in a per-project SQLite database and rebuilds a snapshot of that working state after compaction or when you resume with --continue or /resume. The free plugin is source-available under the Elastic License 2.0 and, per the README, sends nothing off your machine. A separate paid gateway at context-mode.com sits between your agent and the model; it has a free 1,000-request trial, then $20 or $49 a month.

Our review

If you have run Claude Code all afternoon, you know the moment: the conversation compacts, and the agent comes back unsure which file it was editing or what you asked three steps ago. That is the problem context-mode solves best.

Its first job is keeping noise out. A Playwright snapshot, a 500-line log or 20 GitHub issues go into a local search index, and the model gets a few hundred bytes plus the option to look things up. Unlike RTK, which only sees shell commands, its hooks also catch Read, Grep, WebFetch, subagents and MCP calls, which is where most bulk enters a Claude Code session. Its second job is memory within the session: every edit, commit, error and decision is logged, and a snapshot of that state is rebuilt after compaction.

The catch: a smaller context is not a smaller invoice. The vendor's cost benchmarks are unusually well documented, with 155 of 168 paired runs cheaper and one long session falling from $7.20 to $2.49, but they test the paid gateway, which also trims tool schemas and keeps the prompt cache stable. No one, the vendor included, has published a cost test of the free plugin. The gateway reads and rewrites every request your agent sends, a different privacy model from the plugin's "nothing leaves your machine". And because the model writes the script that summarises each output before it sees the data, a detail it did not think to ask for never reaches it unless it later knows to search the archive.

Our take: judge it by whether your agent stays on track in long sessions, not by its savings counter. It sits alongside Claude Code's own auto memory, which carries lessons between sessions, rather than replacing it.

Where it earns its place

  • A developer running all-day Claude Code sessions on a Rails monolith

    Keep the agent on track after the conversation compacts

    Install the plugin from the Claude Code marketplace; edits, commits and errors are logged locally and rebuilt into a snapshot after compaction. Free.

  • An engineering manager paying per-token API bills for a 10-person team

    Find out whether a token saver actually lowers spend

    Run three real tasks twice with and twice without it, compare provider-reported totals, not the plugin's counter. The gateway would add $20 to $49 per developer a month.

Before you commit

Setup
In Claude Code: /plugin marketplace add mksglu/context-mode, then /plugin install context-mode@context-mode; /context-mode:ctx-doctor checks it. Other agents need Node.js 22.5+ and npm install -g context-mode.
Integrations
Claude Code, Gemini CLI, VS Code Copilot, OpenCode, OpenClaw and others, 17 platforms via hooks or an MCP server.
Data and privacy
The plugin keeps everything in local SQLite with no telemetry or account, per its README. The hosted gateway sits between your agent and the model and stores tool output and memory; its retention terms are not published on the pages we checked.
Cost at scale
Plugin free. Gateway Starter $20/month for 10,000 requests and Pro $49/month for 50,000, with overage at $2 or $1 per 1,000; model usage is billed by your provider.
Limits
Summaries depend on the model asking the right question of the data; Glob is not intercepted; release cadence is rapid (v1.0.169).

What's good

  • Hooks cover Read, Grep, WebFetch, subagents and MCP, not just Bash
  • Rebuilds working state after compaction
  • Free plugin runs fully locally with no telemetry
  • Vendor publishes paired benchmark data, including losing runs

What's not

  • No independent or vendor cost test of the free plugin
  • Cost savings shown are for the paid gateway
  • Gateway routes every request through a third party
  • Elastic License 2.0 bars offering it as a hosted service

Best for

Claude Code users whose long sessions lose track of their work after compaction.

Alternatives

context-mode: common questions

Is context-mode worth it?
Worth trying for long sessions that lose the thread after compaction; nobody has yet shown the free plugin lowers your bill. We rate it 3.6 out of 5.
How much does context-mode cost?
Plugin free (Elastic License 2.0). Hosted gateway: 1,000 free requests once; Starter $20/month (10,000 requests); Pro $49/month (50,000 requests); you pay your model provider directly.
What are the downsides of context-mode?
No independent or vendor cost test of the free plugin; cost savings shown are for the paid gateway; gateway routes every request through a third party; elastic License 2.0 bars offering it as a hosted service.
Who is context-mode best for?
Claude Code users whose long sessions lose track of their work after compaction.
How much does context-mode cost for a team or in production?
Plugin free. Gateway Starter $20/month for 10,000 requests and Pro $49/month for 50,000, with overage at $2 or $1 per 1,000; model usage is billed by your provider.
Is context-mode safe for company data?
The plugin keeps everything in local SQLite with no telemetry or account, per its README. The hosted gateway sits between your agent and the model and stores tool output and memory; its retention terms are not published on the pages we checked.
What are the best context-mode alternatives?
The closest alternatives we have reviewed are rtk (Rust Token Killer) and Graphify.

Answers checked Oct 24, 2026.