// the find
mksglu/context-mode
Context window optimization for AI coding agents. Sandboxes tool output (98% reduction), persists session memory, and enforces routing across 17 platforms via MCP + hooks.
Context Mode is an MCP server that intercepts tool calls from AI coding agents and keeps raw output out of the context window — a Playwright DOM snapshot that would cost 56 KB gets replaced with a 5 KB summary stored in SQLite. The core idea is that the LLM should write a script to count functions across 50 files, not read all 50 files. Targets developers who are hitting context limits during long coding sessions with Claude Code, Cursor, Gemini CLI, and 14 other clients.
The ctx_execute 'think in code' paradigm is the genuinely good idea here — one generated script replacing ten Read() calls is a real architectural insight, not just prompt engineering. Session continuity via SQLite FTS5 and BM25 search is practical: on conversation compaction, it retrieves only relevant prior events rather than naively re-injecting everything. The adapter pattern in src/adapters/ is clean — each platform gets its own directory with config, hooks, and index files rather than one sprawling platform-switch. The deliberate decision to not enforce output brevity (citing actual benchmark degradation research from Moonshot AI) shows they thought harder than most about the tradeoffs.
The ELv2 license is a quiet trap — you cannot use this in any competing SaaS product, which matters if you're building tooling on top of it. The 'used at Microsoft, Google, Meta' badges all have href='#' links; there's no verification whatsoever, just visual credibility theater. The --continue flag footgun is real: if you forget it, the session database is deleted immediately and you lose continuity — the opposite of what the tool promises. Running arbitrary code via ctx_execute on the user's machine means the security surface is whatever the LLM decides to execute; security.bundle.mjs exists, but the README doesn't explain what it actually blocks.