A CLI and skill layer that installs, configures and health-checks channels so AI agents can read and search Twitter, Reddit, YouTube, Bilibili, XiaoHongShu and more.
mksglu/context-mode
MCP server for AI coding agents that keeps raw tool output out of the context window and persists session state across compaction.
- Stars
- 30,905
- Forks
- 2,302
- Open issues
- 356
- Last commit
- 8 hours ago
What is it?
Context Mode addresses the context-window problem that AI coding agents hit when MCP tools return large raw outputs such as browser snapshots, issue lists or log files. It runs tool work inside a sandbox so only the final result enters the conversation, and the project reports a 98% reduction on a 315 KB example.
It also tracks session events such as file edits, git operations, tasks, errors and user decisions in SQLite. Events are indexed with FTS5 and retrieved with BM25 search, so after the conversation compacts the agent can resume with the relevant state. Sessions that are not continued are cleared at the next start.
The project is delivered as an MCP server and is wired into many clients through plugins, hooks and config files, including Claude Code, Gemini CLI, VS Code Copilot, Cursor, OpenCode, Codex CLI and OpenClaw.
Key features
- 01Runs tool output in a sandbox so raw data stays out of the context window.
- 02Stores session events in SQLite and restores relevant ones after compaction.
- 03Searches indexed content with FTS5 and BM25 ranking.
- 04Provides ctx_execute and related tools for running scripts that return only results.
- 05Uses platform hooks to route tool calls across supported AI coding clients.
Use cases
- Long coding sessions where MCP tools such as browser or issue fetchers flood the context.
- Analyzing many source files by having the agent write a script that outputs only the summary.
- Resuming work after the agent compacts its conversation without re-reading prior state.
Quick start
- 1
Install the Claude Code plugin from the marketplace
/plugin marketplace add mksglu/context-mode - 2
Install the context-mode plugin
/plugin install context-mode@context-mode - 3
Restart Claude Code, then verify the install with the doctor command
/context-mode:ctx-doctor
Things to know
- The README's automatic setup is documented mainly for Claude Code; other platforms need manual config files.
- The license is ELv2, which restricts providing the software as a hosted or managed service.
- Some features, like the Insight dashboard, rely on a hosted service at context-mode.com.
Topics
FAQ
- What is context-mode?
- MCP server for AI coding agents that keeps raw tool output out of the context window and persists session state across compaction. Context Mode addresses the context-window problem that AI coding agents hit when MCP tools return large raw outputs such as browser snapshots, issue lists or log files. It runs tool work inside a sandbox so only the final result enters the conversation, and the project reports a 98% reduction on a 315 KB example.
- Is context-mode free to use? What license does it have?
- context-mode is open source under the Other license. Check the license terms before using it in commercial products.
- Is context-mode still maintained?
- Actively maintained. The last commit to context-mode was on Oct 19, 2026.
- What can I use context-mode for?
- Long coding sessions where MCP tools such as browser or issue fetchers flood the context. Analyzing many source files by having the agent write a script that outputs only the summary. Resuming work after the agent compacts its conversation without re-reading prior state.
- How do I install context-mode?
- Install the Claude Code plugin from the marketplace: /plugin marketplace add mksglu/context-mode Install the context-mode plugin: /plugin install context-mode@context-mode Restart Claude Code, then verify the install with the doctor command: /context-mode:ctx-doctor
- Where can I get context-mode?
- The source code and installation instructions are on GitHub: https://github.com/mksglu/context-mode
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Claude Code, OpenCode and Codex skill that runs goal-driven modify-verify-keep/discard loops, inspired by Karpathy's autoresearch.
Persistent memory for coding agents that captures session activity, compresses it with AI, and injects relevant context into future sessions.
A coding-assistant skill that makes AI agents lead with the next action, using numbered steps and no filler or preamble.
A local model gateway that lets Claude Code, Codex, OpenCode and other coding agents share one endpoint and route requests across multiple model providers.
GitHub's official MCP server that lets AI assistants read repositories, manage issues and pull requests, and work with GitHub Actions.