Skip to content
Claudekit.ai

Context Mode: Keep Tool Output Out of Claude's Context

Context Mode is a Claude Code plugin that runs tool output through sandboxed tools and a local search index so raw data stays out of your context window.

By Claudekit Team Published 1 min read

Type
Plugin
Pricing
Free
Repository
github.com
GitHub stars
32,092
Website
github.com

Context Mode is a Claude Code plugin that tackles context bloat from tool calls. Instead of letting large outputs like browser snapshots or logs land in the conversation, it routes work through sandboxed tools and a local full-text index, so Claude sees only the result it needs.

Checked 24 Oct 2026 against the repo README, LICENSE and marketplace.json (version 1.0.169).

Who it is for

Heavy Claude Code users whose sessions fill up quickly with MCP and shell output, and anyone who loses track of work after compaction.

Install

From the README (requires Claude Code v1.0.33 or later):

/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode

Restart Claude Code or run /reload-plugins, then verify with /context-mode:ctx-doctor.

What it does

  • Sandbox tools: ctx_execute, ctx_batch_execute, ctx_execute_file, ctx_index, ctx_search and ctx_fetch_and_index keep raw data out of context. The README reports 315 KB of output shrinking to 5.4 KB in its example.
  • Session continuity: file edits, git operations, tasks and decisions are tracked in SQLite and retrieved by BM25 search after compaction.
  • Think in code: nudges Claude to write a script that prints a summary instead of reading dozens of files.
  • Hooks: registers SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, PreCompact and Stop hooks to route calls automatically.
  • Slash commands: ctx-stats, ctx-doctor, ctx-index, ctx-search, ctx-upgrade, ctx-purge and ctx-insight.

Pros

  • Directly attacks the biggest source of wasted context.
  • Diagnostics and savings stats built in.
  • Works across many clients beyond Claude Code.

Cons and caveats

  • ELv2 license, not OSI open source.
  • Hooks change how Claude uses Bash, Read and fetch tools, which can surprise you when debugging.
  • ctx-insight opens a hosted dashboard; the rest runs locally.

Frequently asked questions

Is it open source?

The source is public, but it is licensed under the Elastic License 2.0 (ELv2), which is a source-available license rather than an OSI-approved one.

Can I try it without hooks?

Yes. The README documents an MCP-only install with claude mcp add context-mode -- npx -y context-mode. You get the tools without automatic routing.

How do I check it is working?

Run /context-mode:ctx-doctor. It validates runtimes, hooks, the FTS5 index and plugin registration; all checks should show [x].

What happens to session data if I start fresh?

Session events are tracked in SQLite. The README says that if you do not use --continue, previous session data is deleted immediately.

Get the weekly Claude digest

New skills, MCP servers, prompts and Claude updates — one short email a week. No spam, unsubscribe anytime.

The newsletter is launching soon. Follow the RSS feed in the meantime.