AgentIndex icon
AgentIndex
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Submit Tool
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Home/
Memory & Context/
context-mode
context-mode logo

context-mode

Active·★ 32.5k·Elastic License 2.0·Updated 2026-10-27
★ Most Popular★ Trending

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.

This write-up is based on the project's README and public repository data. We have not hand-tested the tool. Data as of 2026-10-24.

License
Not detected by GitHub
Latest release
v1.0.169 · 2026-06-29
Last commit
2026-10-24
Contributors
112
Forks
2,219
Open issues and PRs
356
First published
2026-02-23
npm package
context-mode 1.0.169 · 13,833 downloads last week

Source: GitHub, npm and PyPI public APIs.

#antigravity#claude#claude-code#claude-code-hooks#claude-code-plugins#claude-code-skill#codex#codex-cli
$ Install
$ npm install -g context-mode
↗ Visit site★ GitHub
01

Features

01Context Saving: Sandbox tools keep raw data out of the context window, achieving up to 98% reduction.
02Session Continuity: Tracks every file edit, git operation, task, and user decision in SQLite for seamless session resume.
03Think in Code: Promotes LLMs to program analysis, not compute it, saving 100x context by logging only results.
04Batch Execution & Search: Run multiple commands/queries in one call with tools like `ctx_batch_execute`.
05Advanced Knowledge Base: Uses SQLite FTS5 with BM25 ranking, smart snippets, and TTL cache for efficient information retrieval.
02

Why choose it

+Large context savings on tool-heavy sessions by keeping raw output in a sandbox.
+Session state persists through context compaction without re-flooding the window.
+Works across many coding agents, with automatic routing on hook-capable platforms.
+Diagnostics and statistics commands make savings visible.
03

Trade-offs

!Licensed under the Elastic License 2.0, which is source-available rather than open source and restricts some uses, such as offering it as a managed service.
!Hooks change how your agent's tools behave; when something looks off, check the routing rules first.
!Reported savings are the project's own examples; measure on your own sessions.
05

Maintenance check

ActiveChecked: 2026-10-24
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
—
Commits per week, last 12 weeks
Commits per week, last 12 weeks: 10, 13, 11, 11, 10, 10, 10, 9, 12, 13, 11, 11

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.

04

Who it fits

Pick it if
  • 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.
Look elsewhere if
  • 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.
06

How it differs

headroom logovs headroom★ 78.0k

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.

Full comparison →
07

Compatibility

Claude Code
Native Plugin
Verified via docs
Gemini CLI
Full Hooks
Verified via docs
VS Code Copilot
Full Hooks
Verified via docs
Cursor
Partial Hooks
Verified via docs
OpenCode
Plugin Hooks (No SessionStart)
Verified via docs
KiloCode
Plugin Hooks (SessionStart TBD)
Verified via docs
08

Quick start

1
$ npm install -g context-mode
09

Use cases

↳Deep repository research and analysis (e.g., architecture, contributors, issues)
↳Analyze Git history to identify top contributors, commit frequency, and most changed files
↳Efficiently process large JSON APIs, web pages, or logs without flooding the context window
10

Alternatives

⚡Top VS:
VSheadroom★78.0k→VSaltk-evolve★134→VSorigin★87→VSpiia-engram★163→
headroom logo
headroom★ 78.0k
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. Around 20% fewer tokens for coding agents and 60-95% fewer for JSON, with the same answers. Library, proxy, and MCP server.
VSCompare→
altk-evolve logo
altk-evolve★ 134
Self improving agents through iterations
VSCompare→
origin logo
origin★ 87
Local-first Rust daemon for AI work. Git-versioned memories, distilled wiki pages, sessions for Claude Code, Cursor, Codex, and any MCP client.
VSCompare→
piia-engram logo
piia-engram★ 163
AI identity layer for Claude Code, Codex and Cursor — stores who you are, not just what you did. Local-first, MCP-compatible.
VSCompare→
engram logo
engram★ 163
AI identity layer for Claude Code, Codex and Cursor — stores who you are, not just what you did. Local-first, MCP-compatible.
VSCompare→
ogham-mcp logo
ogham-mcp★ 116
Shared memory MCP server — persistent, searchable, cross-client Claude, Opencode
VSCompare→
claude-soul logo
claude-soul★ 92
Self-correcting learning engine for Claude Code — persistent identity, behavioral pattern tracking, and cross-session memory
VSCompare→
ChatCrystal logo
ChatCrystal★ 61
Crystallize knowledge from AI conversations. Import from Claude Code / Cursor / Codex CLI, summarize with LLM, search by semantics.
VSCompare→
See all alternatives →

Featured in these lists

  • Best Memory Tools for AI Agents and Coding Assistants
  • Best Claude Code Workflow Tools, Skills and Harnesses

Comments

Log in to leave a comment

No comments yet. Be the first!

On this page
01Features02Why choose it03Trade-offs05Maintenance check04Who it fits06How it differs07Compatibility08Quick start09Use cases10Alternatives
mksglu /
context-mode
↗

Keep raw tool output out of your agent's context window

32.5k2.2kElastic License 2.0
Last commit1d ago
StatusActive
CategoryMemory & Context
Contributors112
Latest releasev1.0.169
Links
Documentation↗Discussion↗Issues↗Releases↗
Cloud Infrastructure
Ad

Deploy on DigitalOcean

Host your MCP servers, Docker containers, and AI agents with $200 free credit over 60 days.

Claim $200 Free Credit
© 2026 AgentIndex.app|Built by a 10-year iOS Developer.
Best by use caseAboutContactAdvertisePrivacy PolicyTerms of UseQYSGitHubBuy me a coffee ☕

Browse by Category

MCP ServersCode AssistantWorkflow AutomationRAG / Knowledge BaseMulti-AgentBrowser AutomationLLM InfraDev ToolingObservability

Not affiliated with Anthropic, OpenAI or Microsoft.