linkgo
Context Mode

Context Mode

AI

An MCP server that sandboxes tool output, persists session memory in SQLite, and enforces context routing across 17 AI coding platforms.

-(0 Reviews)
Free Available
Starting from Free

About Context Mode

Context Mode is an open-source MCP server that attacks context-window waste in AI coding agents from four directions. Tool output is executed in a sandbox and only the result is returned, so a 315 KB payload reaches the model as roughly 5.4 KB — about a 98% reduction. Every file edit, git operation, task, error, and user decision is recorded in SQLite and indexed into FTS5, so when a conversation compacts the agent retrieves only the relevant history via BM25 search instead of dumping it all back into context. It also pushes a 'think in code' paradigm where the model writes a script that computes an answer rather than reading fifty files into context to do it by hand. Routing is enforced automatically through hooks on hook-capable clients and via a one-time routing file elsewhere, covering 17 platforms including Claude Code, Cursor, and the OpenClaw gateway.

Key Features

Sandboxed Tool Output: Tool results are executed and filtered outside the context window so only the answer returns to the model, cutting a 315 KB payload to about 5.4 KB.
SQLite Session Continuity: File edits, git operations, tasks, errors, and user decisions are tracked in SQLite so the agent can resume exactly where it left off after a compaction.
FTS5 + BM25 Retrieval: Session events are indexed into SQLite FTS5 and retrieved by BM25 relevance rather than being replayed wholesale into context.
Think-in-Code Routing: A mandatory paradigm across supported clients that has the model write a script to compute results instead of reading files into context, replacing many tool calls with one.
Hook-Based Enforcement: On Claude Code the plugin registers PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart, and Stop hooks so routing is injected at runtime with no file written to your project.
Eleven MCP Tools: Six sandbox tools (ctx_batch_execute, ctx_execute, ctx_execute_file, ctx_index, ctx_search, ctx_fetch_and_index) plus five meta tools for stats, diagnostics, upgrade, purge, and insight.
Persistent Knowledge Base: Local files and directories can be indexed into an FTS5 store and searched later, with a purge command to delete everything permanently.
Savings Diagnostics: ctx_stats reports per-tool context savings and token consumption while ctx_doctor validates runtimes, hooks, FTS5, and plugin registration.

Use Cases

Long Coding Sessions: Keep a multi-hour agent session usable by preventing large Playwright snapshots, issue lists, and logs from consuming the context window.
Surviving Compaction: Resume work after the conversation compacts without the agent forgetting which files it was editing or what task was in progress.
Large Log and Data Analysis: Have the agent script the analysis over a 45 KB access log rather than reading it into context to reason over it manually.
Multi-Platform Agent Setups: Standardize context routing across Claude Code, Cursor, and the other supported clients so behavior is consistent regardless of tool.
Cost Reduction: Cut token spend on agent-heavy workflows by removing raw tool payloads from prompts.
Team Context Analytics: Use the hosted Insight dashboard to see how much context engineering teams are saving across projects.

Frequently asked questions about Context Mode

What is Context Mode?

An MCP server that sandboxes tool output, persists session memory in SQLite, and enforces context routing across 17 AI coding platforms.

How does Context Mode work?

Context Mode works by combining Sandboxed Tool Output: Tool results are executed and filtered outside the context window so only the answer returns to the model, cutting a 315 KB payload to about 5.4 KB., SQLite Session Continuity: File edits, git operations, tasks, errors, and user decisions are tracked in SQLite so the agent can resume exactly where it left off after a compaction., FTS5 + BM25 Retrieval: Session events are indexed into SQLite FTS5 and retrieved by BM25 relevance rather than being replayed wholesale into context., Think-in-Code Routing: A mandatory paradigm across supported clients that has the model write a script to compute results instead of reading files into context, replacing many tool calls with one., Hook-Based Enforcement: On Claude Code the plugin registers PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart, and Stop hooks so routing is injected at runtime with no file written to your project. to help users with Long Coding Sessions: Keep a multi-hour agent session usable by preventing large Playwright snapshots, issue lists, and logs from consuming the context window., Surviving Compaction: Resume work after the conversation compacts without the agent forgetting which files it was editing or what task was in progress., Large Log and Data Analysis: Have the agent script the analysis over a 45 KB access log rather than reading it into context to reason over it manually., Multi-Platform Agent Setups: Standardize context routing across Claude Code, Cursor, and the other supported clients so behavior is consistent regardless of tool., Cost Reduction: Cut token spend on agent-heavy workflows by removing raw tool payloads from prompts..

What are the main features of Context Mode?

Key features include Sandboxed Tool Output: Tool results are executed and filtered outside the context window so only the answer returns to the model, cutting a 315 KB payload to about 5.4 KB., SQLite Session Continuity: File edits, git operations, tasks, errors, and user decisions are tracked in SQLite so the agent can resume exactly where it left off after a compaction., FTS5 + BM25 Retrieval: Session events are indexed into SQLite FTS5 and retrieved by BM25 relevance rather than being replayed wholesale into context., Think-in-Code Routing: A mandatory paradigm across supported clients that has the model write a script to compute results instead of reading files into context, replacing many tool calls with one., Hook-Based Enforcement: On Claude Code the plugin registers PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart, and Stop hooks so routing is injected at runtime with no file written to your project..

Who is Context Mode for?

Context Mode is useful for anyone interested in Long Coding Sessions: Keep a multi-hour agent session usable by preventing large Playwright snapshots, issue lists, and logs from consuming the context window., Surviving Compaction: Resume work after the conversation compacts without the agent forgetting which files it was editing or what task was in progress., Large Log and Data Analysis: Have the agent script the analysis over a 45 KB access log rather than reading it into context to reason over it manually., Multi-Platform Agent Setups: Standardize context routing across Claude Code, Cursor, and the other supported clients so behavior is consistent regardless of tool., Cost Reduction: Cut token spend on agent-heavy workflows by removing raw tool payloads from prompts..

How much does Context Mode cost?

Context Mode is free to use.

How do I get started with Context Mode?

Visit https://github.com/mksglu/context-mode to sign up and explore Context Mode.

Explore more AI Mcps tools

Browse all Mcps tools →

Compare Context Mode: vs MCPJam · vs OzBrain · vs QApilot MCP for Android · vs Noodle Seed

Context Mode - AI Tool Review | LinkGo