Context Mode
Plugin : A set of capabilities installed into an AI application or a host · requires claude-code
A plugin that keeps tool output out of the context window: it is run in a sandbox, indexed, and only the useful part comes back.
A page snapshot, a log or an API response can take tens of thousands of tokens for a few useful lines. Context Mode intercepts these calls with hooks, runs them in an isolated subprocess, stores the result in a SQLite database with full-text search, and returns to the agent only the requested passage. It also saves session state around compactions. The announced saving, 98% in one example, is the project's own figure. Two points to know: the license is the Elastic License 2.0, which is not a free-software license, and on agents without hooks routing is respected only about 60% of the time.
Security reflects where data goes, requested permissions and incidents on record at the verification date. It is not a guarantee of zero risk: check the deployment mode and the connections you enable.
What it does, concretely
A coding agent reads files, runs commands and fetches web pages, and every result goes into its context window. A page snapshot, a log or an API response can take tens of thousands of tokens for a few useful lines. Context Mode targets that waste.
In practice, the plugin intercepts these calls with hooks and runs them in a local sandbox. It stores the full output in a SQLite index with full-text search (FTS5) on your machine, and returns only the requested passage to the agent. It also offers a "Code Mode": the agent writes a short script instead of reading the data, and only what the script prints reaches the context. The tools exposed to the agent include ctx_execute, ctx_index and ctx_search.
The plugin installs on 11 coding agents, including Claude Code, Codex, Gemini CLI, OpenCode, Copilot CLI and VS Code (Copilot). It works offline after installation and, according to the project, without telemetry. The savings figures (for example a median 99.4% reduction in volume over 36 bench rows) are the project's own.
It is made for people who use a coding agent daily and see their context fill up because of long tool outputs. It suits you less if you require a free-software license: the Elastic License 2.0 is not one. It is also less suited if you work with an agent without hooks, where routing is respected only about 60% of the time.
What it offers
- ·Runs commands and page fetches in a local sandbox instead of pouring their raw output into the context.
- ·Indexes the full output in a SQLite database with full-text search, stored in ~/.context-mode (one context.db file per project).
- ·Returns to the agent only the requested passage, through the ctx_execute, ctx_index and ctx_search tools.
- ·Code Mode: the agent writes a short script to process the data, and only the script's printed result reaches the context.
- ·Saves session state around compactions so work can resume without rereading everything.
- ·Shows a savings report (ctx_stats, /ctx-stats in Claude Code) comparing raw size to what entered the context.
- ·Provides an install diagnostic (/ctx-doctor) that prints PASS or a fix command for each check.
- ·Context Mode Gateway extends the idea to the whole conversation: Gateway Recall keeps long sessions searchable and Gateway Memory shares what your agents learn (separate hosted service with its own account and subscription) (paid).
In practice
- Price
- Free
- Available on
- claude-code, codex, cursor, any-agent, gemini-cli, opencode
- Host
- claude-code
- FR interface
- No
Security and data
- Rating
- Security: one caveat, see the card
- Your data
- Local or cloud depending on use
- Maintenance
- Active
- Last release
- 25 November 2026
Links and repository checked on 30 November 2026 · added on 30 November 2026
How to install Context Mode
claude plugin marketplace add mksglu/context-mode && claude plugin install context-mode@context-mode