Blog

skill · curated · mcp · claude-code · context-window · Aug 6, 2026 · 2 min read

context-mode: stop your coding agent from re-reading everything it already saw

context-mode is an MCP server that intercepts your coding agent's tool calls — Bash, file reads, git operations — and sandboxes the raw output. Instead of dumping 315 KB of grep results or compiler errors directly into the context window, it executes everything in isolation, captures only stdout, and hands back a 5.4 KB reference. The repo claims a 98% context reduction on real sessions, and the architecture is straightforward enough that the number is credible.

When it actually helps

The clearest win is long sessions with repetitive read operations. If you're mid-refactor and Claude keeps re-reading the same files across turns, context-mode stops that bleed. The session continuity feature compounds this: it tracks file edits, git commits, task state, and errors in a local SQLite database with FTS5 indexing. When your conversation compacts — which happens in long Claude Code sessions — instead of a raw context dump, it retrieves what's relevant via BM25 search. That's the difference between a fresh-ish session and one that actually knows you already tried the thing that didn't work.

There's also a "think in code" mode where the model generates short analysis scripts instead of chaining ten tool calls. One script replacing ten reads is a real multiplier on both context and latency.

The real caveats

The 98% number is for Claude Code with hooks enabled. Drop the hooks and compliance falls to around 60% — MCP alone can't intercept everything the agent does. Cursor users hit an immediate wall: Cursor's validator currently rejects the sessionStart hook, so session restoration after compaction doesn't work there at all. Linux users need Node ≥ 22.5; older versions crash on the native SQLite bindings.

There's also an ELv2 license. It's source-available, not open-source — fine for personal and commercial internal use, but worth knowing before you package it in something you distribute.

Getting it on Claude Code

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

That handles MCP wiring and hook registration in one shot. The README walks through manual setup for the other 16 supported platforms (VS Code Copilot, Gemini CLI, Cursor, Codex CLI, and more) if you're not on Claude Code.

Source and docs: github.com/mksglu/context-mode and the author's own write-up with a live demo video.