AI coding agents consume context windows at a ferocious rate. Every MCP tool call — file reads, search results, terminal output — dumps raw data directly into the 200K-token window. After 30 minutes of active coding, roughly 40% of the context is already gone.
Context Mode, created by developer Mert Koseoglu (mksglu), addresses this with a sandboxed knowledge base architecture. Instead of letting raw tool output flood the context window, it spawns isolated subprocesses that capture stdout and store it in a local SQLite database with FTS5 full-text search indexing.
When the agent needs that information again, it queries the indexed store rather than re-reading the original output. According to benchmarks shared on Hacker News and multiple blog reviews, this approach has achieved up to 98% reduction in context consumption — shrinking 315 KB of raw MCP output to just 5.4 KB.
The plugin works across 17 platforms including Claude Code, Codex CLI, Gemini CLI, VS Code Copilot, OpenCode, and Cursor. It persists session memory across conversations and enforces routing so that tool outputs never directly touch the context window.
Context Mode has accumulated over 20,000 GitHub stars and was featured on Hacker News, where the technical community debated its approach. The project uses an ELv2 license and is available for installation via standard MCP configuration.
The core insight is simple but powerful: by treating the context window as a cache rather than a dump, AI coding agents can work on larger codebases and longer sessions without running out of runway. For developers pushing the limits of what their AI tools can handle, Context Mode represents a practical optimization that extends the useful life of each session.




