Context Mode

Resolved 💬 2 comments Opened Mar 14, 2026 by Geomean12807 Closed Apr 12, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Here's a summary of the feature:

Per a Gemini summary, this video https://youtu.be/QUHrntlfPo4?si=zSn7PKGOTbhSU2Mj "... introduces Context Mode, an MCP server designed to solve "context bloat" in Claude Code (0:00). In standard sessions, every tool call sends massive amounts of data directly into the AI's limited context window, causing it to quickly lose track of files and decisions (0:07-0:28).
Key Features & Benefits of Context Mode:

Context Virtualization (1:17): Acts as a sandbox, indexing raw data into a local SQLite database using full-text search. This reduces data size drastically—for instance, a 56KB web snapshot is reduced to just 299 bytes, a 99% reduction (1:36-1:44).
Session Continuity (1:53): Functions as a "save checkpoint" for your coding session. When the conversation history compacts, it takes a small snapshot of active tasks and re-injects it, allowing sessions to last for up to 3 hours instead of 30 minutes (2:06-2:28).
Decision Tracking (2:31): Prevents the AI from repeating mistakes by tracking previous failed attempts or errors even after context resets.
Easy Installation (2:40): Simply run the plug-in install command within Claude Code.
Live Demo: In a demo analyzing a 5,000-line log file, Context Mode indexed the file locally rather than sending the raw data to Claude (3:36). The tool kept 15KB of data in the sandbox while sparing roughly 1,200 tokens, achieving a 25% reduction in cost and maintaining model intelligence by clearing noise (4:26-4:54)." The screenshots are of the installation process.

I asked Claude Code: "What would you think about introducing this functionality to my AiS", (which is a beast of a personal AI with a 5090 and 9 terabytes of memory storage and huge RAM).

Claude Code responded

"Pros/cons, compatability,cautions? How effective might it be and might it increase the difficulty of working with Claude Code

Show more

Good question. Let me break this down honestly.

What Context Mode Does
It's an MCP server that intercepts tool calls via hooks, indexes raw data into a local SQLite database, and returns compact references instead of dumping full content into your context window. It also snapshots session state to survive context compaction.

Pros for AiS
Your sessions are likely expensive. With CLAUDE.md alone being substantial, plus reading trading cards, XML/RTF journals, CSV files, and spreadsheets — you're burning context fast. Reducing tool output bloat could meaningfully extend session life.
Session continuity matters for you. Multi-step pipeline work (journal parsing → enrichment → output generation) benefits from not losing track mid-conversation.
Decision tracking could help with your iterative development — e.g., remembering that the vision pipeline produces nonsense output, without re-discovering it.
Cons / Cautions
It's a third-party project from a single developer (mksglu). No guarantee of maintenance, compatibility with future Claude Code versions, or security review. It intercepts every tool call via hooks — that's a significant trust surface.
Hooks intercepting all tool calls adds a failure point. If the MCP server crashes or hangs, your entire session is blocked. Your daily pipeline work can't afford random disruptions.
Compatibility risk. You're on Windows, Claude Code v2.x. The screenshots show macOS + VS Code Copilot setup paths (.github/hooks/, .vscode/mcp.json). The Claude Code CLI integration path may differ, and Windows path handling in hooks is historically fragile.
You already have a memory system. The ~/.claude/projects/ memory I maintain for you covers some of the "decision tracking" use case. Adding another layer creates potential conflicts — two systems trying to manage what Claude remembers.
SQLite full-text search is not magic. If it indexes a 5,000-line log and returns a 299-byte summary, that summary might miss the exact detail you need. For your trading data, precision matters — a truncated or poorly-indexed SSG enrichment table could cause you to miss a signal.
Increased complexity. You'd be debugging Claude Code + MCP server + hooks + SQLite database interactions. When something goes wrong, the failure mode is opaque. This runs counter to your design principle of reducing exhaustion.
My Assessment
Moderate benefit, moderate risk. The context savings are real — I've seen your sessions involve reading large files that do bloat context. But:

The project is young and lightly tested on Windows
The hook interception model is brittle
Your workflow values reliability over optimization
The actual token savings depend heavily on whether the indexed summaries preserve the detail you need for trading analysis
Recommendation: Wait. Watch the project mature for a few months. If it gains traction, gets Windows testing, and Claude Code's hook system stabilizes further, revisit. In the meantime, the more impactful move is being disciplined about what gets read into context — reading specific line ranges instead of whole files, using targeted searches, etc. That's free and risk-free.

If you do want to experiment, do it in an isolated test directory first — not in your live AiS workspace."

Not wanting to try out something so untested I asked:

"Ok, does Claude code have it's own Context Mode similar to this developer's project that could be incorporated into a local AI? If not, do you have the ability to suggest to the powers that be that such a capability be developed in the future? If so, it would seem like this would be a great enhancement for Claude Code itself to have."

Claude Code responded:
"
Does Claude Code Have Built-in Context Mode?
No. Claude Code has no equivalent built-in feature. What it does have:

Automatic context compaction — when the window fills up, it summarizes older messages to free space. But this is lossy and you can't control what survives.
The memory system — persistent files in ~/.claude/projects/ (what we use now). Manual, not automatic.
CLAUDE.md — always loaded, but static instructions, not dynamic session state.
None of these do what Context Mode does: intercepting tool output, indexing it locally, and returning compact references while keeping the raw data retrievable.

Can I Suggest It to Anthropic?
I can't submit feature requests internally — I'm the model, not an employee. But you can, and it would carry weight as real user feedback:

File a feature request at: https://github.com/anthropics/claude-code/issues

A strong request would highlight:

Context bloat from tool calls (especially file reads and web fetches) is the #1 session killer for power users
Automatic compaction is too blunt — it discards context indiscriminately
A built-in "context virtualization" layer that indexes tool output locally and returns compact references would dramatically extend session utility
Session checkpoint/restore on compaction would enable multi-hour complex workflows
This is especially impactful for users working with large codebases, data files, or multi-step pipelines
Why Anthropic Should Build This Natively
You're right that this belongs in the product itself rather than as a third-party hook:

Security — Anthropic can ensure the interception layer is safe, rather than trusting third-party hooks with all tool I/O
Reliability — native integration avoids the brittleness of hook-based interception
Cross-platform — would work on Windows, macOS, Linux without community workarounds
Intelligence — Anthropic knows what the model needs to retain vs. what can be indexed; a third party is guessing
The core insight of Context Mode — don't send raw data into the context window when a compact reference plus local retrieval would suffice — is genuinely good architecture. It's the kind of thing that should be a first-class feature, not a bolted-on MCP server.

I'd encourage you to file that issue. Power-user feedback from someone running daily pipelines with large data files is exactly the use case that makes the argument concrete."

Ok, that's as concrete as we can make it. Hope you find this helpful and Good Luck! Great platform, BTW.

Proposed Solution

Per a Gemini summary, this video https://youtu.be/QUHrntlfPo4?si=zSn7PKGOTbhSU2Mj "... introduces Context Mode, an MCP server designed to solve "context bloat" in Claude Code (0:00). In standard sessions, every tool call sends massive amounts of data directly into the AI's limited context window, causing it to quickly lose track of files and decisions (0:07-0:28).
Key Features & Benefits of Context Mode:

Context Virtualization (1:17): Acts as a sandbox, indexing raw data into a local SQLite database using full-text search. This reduces data size drastically—for instance, a 56KB web snapshot is reduced to just 299 bytes, a 99% reduction (1:36-1:44).
Session Continuity (1:53): Functions as a "save checkpoint" for your coding session. When the conversation history compacts, it takes a small snapshot of active tasks and re-injects it, allowing sessions to last for up to 3 hours instead of 30 minutes (2:06-2:28).
Decision Tracking (2:31): Prevents the AI from repeating mistakes by tracking previous failed attempts or errors even after context resets.
Easy Installation (2:40): Simply run the plug-in install command within Claude Code.
Live Demo: In a demo analyzing a 5,000-line log file, Context Mode indexed the file locally rather than sending the raw data to Claude (3:36). The tool kept 15KB of data in the sandbox while sparing roughly 1,200 tokens, achieving a 25% reduction in cost and maintaining model intelligence by clearing noise (4:26-4:54)."

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

MCP server integration

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗