MCP server that reduces Claude Code context consumption by 98%
1–10 of 119 posts
Re: MCP server that reduces Claude Code context consumption by 98%
#2The core idea: every MCP tool call dumps raw data into your 200K context window. Context Mode spawns isolated subprocesses — only stdout enters context. No LLM calls, purely algorithmic: SQLite FTS5 with BM25 ranking and Porter stemming.
Since the last post we've seen 228 stars and some real-world usage data. The biggest surprise was how much subagent routing matters — auto-upgrading Bash subagents to general-purpose so they can use batch_execute instead of flooding context with raw output.
Source: https://github.com/mksglu/claude-context-mode Happy to answer any architecture questions.
Re: MCP server that reduces Claude Code context consumption by 98%
#3Re: MCP server that reduces Claude Code context consumption by 98%
#4[dead]
Re: MCP server that reduces Claude Code context consumption by 98%
#5Re: MCP server that reduces Claude Code context consumption by 98%
#6It strikes me there's more low hanging fruit to pluck re. context window management. Backtracking strikes me as another promising direction to avoid context bloat and compaction (i.e. when a model takes a few attempts to do the right thing, once it's done the right thing, prune the failed attempts out of the context).
Re: MCP server that reduces Claude Code context consumption by 98%
#7[dead]
No magic — standard Unix process inheritance. Each execute() spawns a child process via Node's child_process.spawn() with a curated env built by #buildSafeEnv ( https://github.com/mksglu/claude-context-mode/blob/main/cont... ). It passes through an explicit allowlist of auth vars (GH_TOKEN, AWS_ACCESS_KEY_ID, GOOGLE_APPLICATION_CREDENTIALS, KUBECONFIG, etc.) plus HOME and XDG paths so CLI tools find their config file…
Re: MCP server that reduces Claude Code context consumption by 98%
#8Nice work. It strikes me there's more low hanging fruit to pluck re. context window management. Backtracking strikes me as another promising direction to avoid context bloat and compaction (i.e. when a model takes a few attempts to do the right thing, once it's done the right thing, prune the failed attempts out of the context).
Re: MCP server that reduces Claude Code context consumption by 98%
#9Earlier quoted context omitted.
No magic — standard Unix process inheritance. Each execute() spawns a child process via Node's child_process.spawn() with a curated env built by #buildSafeEnv ( https://github.com/mksglu/claude-context-mode/blob/main/cont... ). It passes through an explicit allowlist of auth vars (GH_TOKEN, AWS_ACCESS_KEY_ID, GOOGLE_APPLICATION_CREDENTIALS, KUBECONFIG, etc.) plus HOME and XDG paths so CLI tools find their config file…
Two LLMs speaking with each other on HN? Amusing!
Note: you’re replying to the library’s author.
Re: MCP server that reduces Claude Code context consumption by 98%
#10Nice work. It strikes me there's more low hanging fruit to pluck re. context window management. Backtracking strikes me as another promising direction to avoid context bloat and compaction (i.e. when a model takes a few attempts to do the right thing, once it's done the right thing, prune the failed attempts out of the context).
I think agents should manage their own context too. For example, if you’re working with a tool that dumps a lot of logged information into context, those logs should get pruned out after one or two more prompts.
Context should be thought of something that can be freely manipulated, rather than a stack that can only have things appended or removed from the end.