Context Mode Claude skills

MCP server plus hooks that keep bulky tool output out of the context window, index it in local SQLite, and restore session state after compaction.

Our verdict Recommended with caveats

Substantial and actively maintained, but it installs hooks that reroute your agent's tools and is licensed under the source-available Elastic License 2.0.

What Context Mode does

Context Mode is mainly a runtime, not a prompt pack. It ships an MCP server whose tools (ctx_execute, ctx_execute_file, ctx_batch_execute, ctx_fetch_and_index, ctx_index, ctx_search) run code or commands in a sandboxed subprocess and return only what the script prints, so a large log, web page or file never enters the conversation. Output is indexed in a local SQLite FTS5 store and retrieved with BM25 search. Hooks track edits, git operations, tasks and errors, and after the agent compacts its context they feed back only the relevant events. The skills are slash-command wrappers around that: ctx-stats, ctx-doctor, ctx-index, ctx-search, ctx-upgrade, ctx-purge and ctx-insight, plus a 17 KB main routing skill with four reference files. The routing rules tell the agent to write analysis code rather than read raw data, and to avoid curl and wget in favor of ctx_fetch_and_index. The repo also contains a 24 KB maintainer skill, context-mode-ops, used for running the project's own issue and release work. The README claims support for 17 platforms and a 98 percent reduction in context use on its examples; those figures are the authors' own.

Good for

  • Long agent sessions that keep hitting context limits
  • Workflows with large MCP outputs such as browser snapshots or logs
  • Teams on several agents who want one routing setup

Not for

  • Short sessions where context is not a constraint
  • Anyone who needs an OSI-approved open source license

What's inside depth 3/5

Eleven skills, but only the main one (17 KB, four references) and the maintainer skill are long; the rest are 1-3 KB wrappers, and the real work is in the MCP server and hooks.

Skills
11
Reference docs
12
Scripts
0
Tests / evals
0
Templates
0
Avg SKILL.md
4.9 KB

Counted from the repository file tree. How we score depth.

Dependencies and costs

  • Node.js
  • better-sqlite3 native module (prebuilt binaries; compiles from source on older glibc systems)
  • Telemetry: The README states there is no telemetry, cloud sync or account requirement. The /ctx-insight command opens a hosted dashboard at context-mode.com in your browser when you invoke it.

How the sandbox and knowledge base work

When the agent calls ctx_execute, the code runs in a subprocess, and only what it prints to stdout comes back into the conversation. The skill files list JavaScript, TypeScript, Python and shell among the supported languages. ctx_execute_file loads one file into a FILE_CONTENT variable inside the sandbox. The agent can then count, filter or summarize that file without the raw text entering the context window. There is no separate ctx_read tool.

Output worth keeping goes into the local SQLite FTS5 store. The README describes two tokenizers. Porter stemming means a search for "caching" also matches "cached" and "caches". A trigram tokenizer handles partial strings, so "useEff" finds "useEffect". ctx_search does not cut results off at the first N characters. It finds where the query terms appear and returns those passages.

If you resume with --continue, indexed documents survive a restart and the agent does not have to fetch the same page again. If you start a session without --continue, the previous session's data is deleted.

A typical workflow with the routing rules

The routing skill gives the agent a fixed order of operations:

  1. Gather with ctx_batch_execute(commands, queries). It runs several repository commands, indexes the output and answers queries against it in one call.
  2. Process with ctx_execute or ctx_execute_file, and print only the answer.
  3. For web content, call ctx_fetch_and_index(url, source) and then ctx_search(queries), so raw HTML never enters context.
  4. Search with ctx_search, and put related questions into a single queries array.

The same rules block curl, wget and inline HTTP one-liners such as node -e "fetch(...)". They also tell the agent to write artifacts to files and return a path with a one-line description instead of dumping the content inline. A native file read is still correct when an edit needs the exact bytes in the conversation.

You keep prompting the way you normally do. A request like "run the test suite and tell me which tests fail" should become a sandboxed script. The main skill's shell reference shows this pattern for builds, tsc and tests: write the output to a temp file, grep for errors, report counts and file paths, then delete the file. To see whether routing is saving context, run /context-mode:ctx-stats. It reports tokens consumed per tool and the savings ratio. Slash commands only exist in Claude Code. On other platforms, type ctx stats or ctx doctor in the chat and the model calls the MCP tool.

Platform differences and setup gotchas

Support varies across the platforms the README lists. Session continuity needs five hooks working together. Full capture, snapshot and restore works on Claude Code, Gemini CLI, VS Code Copilot, JetBrains Copilot, OpenCode and KiloCode. GitHub Copilot CLI gets separate treatment, documented in docs/platform-support.md.

Kiro has partial coverage. Its native preToolUse and postToolUse hooks enforce sandbox routing and capture tool events. agentSpawn, Kiro's equivalent of SessionStart, is not implemented yet, so session restore is limited, and you have to copy KIRO.md into your project by hand. Antigravity and Zed have no hooks and no session support. On those, you copy GEMINI.md or AGENTS.md into the project root yourself.

Other setup details from the README:

  • For Codex CLI, install with npm install -g context-mode and then add the config block to ~/.codex/config.toml.
  • The Cursor Marketplace plugin is still awaiting review by the Cursor team. Until it is listed, install from a local folder. On Windows, Cursor does not follow symlinks or junctions, so the README copies the files with robocopy.
  • On older glibc systems (CentOS 7/8, RHEL 8, Debian 10), the prebuilt better-sqlite3 binaries do not load. The module falls back to building from source with prebuild-install || node-gyp rebuild --release.
  • If you want the ctx_* tools in Antigravity CLI without the plugin or hooks, add context-mode to ~/.gemini/config/mcp_config.json.

Setting permission rules

The README describes allow and deny rules written as Tool(what to match), where * matches anything. Its example deny list contains Bash(sudo *), Bash(rm -rf /*), Read(.env) and Read(**/.env*). Commands chained with &&, ; or | are split, and each part is checked on its own. That means echo hello && sudo rm -rf /tmp is blocked because the sudo part matches a deny rule. When rules conflict, deny always wins over allow.

Security review

Broad access

This skill asks for more access than most, or sends data to another service. That is usually a design choice rather than bad intent, but you should know before you install it.

  • Pushes or merges without askingOnly in the maintainer's own context-mode-ops skill (.claude/skills, not the plugin's skills/ folder): it tells the agent to 'gh pr merge --squash' contributor PRs into next and to push follow-up fixes straight to next (line 173), and its directive says to stop asking permission for micro-steps; release.md marks only the npm publish and branch deletion as needing user approval..claude/skills/context-mode-ops/review-pr.md:141

Context Mode is a plugin and MCP server that sits in front of your agent's tool calls through hooks, routes large outputs into a local SQLite index and records session events locally. The README states no telemetry or cloud sync, but the hook and server code is not in the files we could read, and the optional Insight dashboard is a hosted service. It installs unpinned npm code, can upgrade itself from GitHub, and the repo also ships a maintainer skill that merges PRs and pushes to branches.

Worth knowing

  • installs_hooksInstalling the Claude Code plugin registers documented PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart and Stop hooks (README) that route and block tool calls (for example curl, wget and inline fetch) and record file edits, git operations, errors and prompts into a local SQLite session database; the equivalent hooks are written into other clients' config files. The hook code is not in the files we have.README.md:86
  • Runs remote code at an unpinned versionMCP-only install is 'claude mcp add context-mode -- npx -y context-mode' with no version pin; other clients use unpinned 'npm install -g context-mode', and /ctx-upgrade pulls the latest code from GitHub, rebuilds it and reconfigures hooks.README.md:117
  • Installs packages or toolsInstalls the context-mode npm package globally; it uses the native better-sqlite3 module and needs Node.js 22.5 or Bun.README.md:136
  • Changes files outside your projectSetup edits settings outside the project: ~/.claude/settings.json for the optional status line, and per-client hook and MCP files such as ~/.gemini/settings.json, ~/.codex/hooks.json and .cursor/hooks.json; session data is stored under ~/.context-mode or ~/.claude/context-mode.README.md:100
  • Relies on a CLI or package we could not reviewThe skills drive MCP tools of the context-mode package (ctx_execute, ctx_fetch_and_index, ctx_upgrade and others); ctx_upgrade returns a shell command that the agent is told to run.skills/ctx-upgrade/SKILL.md:16
  • Makes network requests/ctx-insight opens the hosted dashboard https://context-mode.com/insight in your browser; ctx_fetch_and_index fetches URLs you ask for, with scheme and metadata-IP blocking.skills/ctx-insight/SKILL.md:13

What we checked

The repository (599 files) on Oct 29, 2026. Not a full review: 562 of 599 files were not downloaded (large repository; we reviewed the skill folders); it relies on code outside the repository: npm package context-mode (MCP server, CLI, hooks such as hooks/posttooluse.mjs, adapters), none of which are in the files we have; 562 of 599 repository files were not downloaded; plugin manifests and hook configs (.claude-plugin, .codex-plugin/hooks.json, .claude/settings.json); hosted Insight service at context-mode.com/insight (what data, if any, it receives is not described in the files).

NVIDIA SkillSpector static scan: 89 pattern hits (MCP Rug Pull 55, Tool Misuse 11, Agent Snooping 8, Data Exfiltration 4, Rogue Agent 3, Excessive Agency 3). The 89 SkillSpector hits are documentation: sudo and rm -rf appear in README deny-rule examples and routing text that tells the agent to avoid curl and wget; ~/.claude and ~/.gemini paths are setup instructions; npx mentions are unpinned installs. The hooks and the maintainer ops skill are recorded as flags. No code files were available to scan.

A review, not a certification. Skills change after we check them — read the files before installing.

License

Elastic License 2.0 (source-available; GitHub reports NOASSERTION). You may use and modify it, but not offer it as a hosted service.

Can it run unattended?

Not really. It supports long sessions by preserving state across compaction, but it has no loop, stop condition or task runner of its own.

Alternatives to Context Mode

Continuous Claude

parcadei/Continuous-Claude-v3

A personal Claude Code infrastructure: ~160 skills, 32 agents and 30 hooks that inject skill hints, isolate subagent context to files, and fight compaction.

With caveats Broad access Depth 3/5

memsearch

zilliztech/memsearch

Cross-agent persistent memory for Claude Code, Codex, OpenClaw, OpenCode and DeepSeek Harness: Markdown files as the source of truth, with a Milvus search index.

With caveats Broad access Depth 3/5

Caveman

JuliusBrussee/caveman

A token-saving pack that makes agents answer in terse "caveman" prose, plus an optional CLI with output trimming, model routing and usage telemetry.

With caveats Broad access Depth 3/5

Pro Workflow

rohitg00/pro-workflow

A Claude Code plugin with 41 skills and many hooks that stores your corrections in SQLite and adds searchable research wikis, quality gates and cost tracking.

With caveats Check first Depth 2/5

FAQ

What is Context Mode?

Context Mode is an MCP server with hooks for coding agents. It runs commands and file analysis in a sandbox so only the printed answer reaches the model, and it stores session events in local SQLite to recover state after compaction.

How do I install Context Mode?

The README lists install paths per platform, including a Claude Code plugin marketplace route and an npm package. It needs Node.js, and Windows users may hit a native-module step for better-sqlite3 that the postinstall script tries to repair automatically.

Is Context Mode safe and private?

The README says nothing leaves your machine and there is no telemetry; data lives in SQLite files in your home directory. It does install hooks and routing rules that change which tools your agent uses, so read the setup for your platform before enabling it.

What license is Context Mode under?

Elastic License 2.0. You can use, fork and modify it, but the license forbids offering it as a hosted or managed service.

Does Context Mode keep indexed data between sessions?

Only when you resume with --continue. In that case, indexed docs and session events persist across restarts. If you start a fresh session without --continue, the README says the previous session's data is deleted immediately.

Which agents get full session continuity?

Claude Code, Gemini CLI, VS Code Copilot, JetBrains Copilot, OpenCode and KiloCode. Kiro has partial coverage. Antigravity and Zed get the MCP tools but no hooks or session restore.

Can I use Context Mode without installing hooks?

Yes, on some platforms. For Antigravity CLI, the README describes an MCP-only setup that skips the plugin and hooks and adds context-mode to the global MCP profile. Without hooks, routing depends on the agent following the instruction file, and session tracking does not run.

Sources: GitHub repository (stars, license, file tree, last push Oct 29, 2026). Review based on the README and SKILL.md files as published.