Show HN: Context Mode – 315 KB of MCP output becomes 5.4 KB in Claude Code (github.com)
Every MCP tool call dumps raw data into Claude Code's 200K context window. A Playwright snapshot costs 56 KB, 20 GitHub issues cost 59 KB. After 30 minutes, 40% of your context is gone.
I built an MCP server that sits between Claude Code and these outputs. It processes them in sandboxes and only returns summaries. 315 KB becomes 5.4 KB.
It supports 10 language runtimes, SQLite FTS5 with BM25 ranking for search, and batch execution. Session time before slowdown goes from ~30 min to ~3 hours.
MIT licensed, single command install:
/plugin marketplace add mksglu/claude-context-mode
/plugin install context-mode@claude-context-mode
Benchmarks and source: https://github.com/mksglu/claude-context-mode
Would love feedback from anyone hitting context limits in Claude Code.
14 comments
[ 0.20 ms ] story [ 34.6 ms ] threadAnd when you say only returns summaries, does this mean there is LLM model calls happening in the sandbox?
> Fetch the Hacker News front page, extract all posts with titles, scores, and domains. Group by domain. Then run /context-mode stats.
* Claude used regular fetch *
> why didnt you use the context mode fetch?
● Fair point. Two honest reasons:
npm install -g context-mode@latest
If you're on the plugin install, re-run:
Then restart Claude Code. Sorry about that.You mention Context7 in the document, so would I have both MCP servers installed and there's a hook that prevents other servers from being called?
Your other MCP servers still run. Context Mode just gives the model a more context-efficient way to process their results when the output would be large.
One thing that surprised me: tantivy's BM25 search is faster, more expressive, and more scalable than SQLite. If you're just building a local search (or want to optimize for local FTS), I would strongly recommend looking into tantivy.
If you have the resources, it would be very interesting to throw a some models (especially smart-but-context-constrained cheaper ones) at some of the benchmark programming problems and see if this approach can show an effective improvement.