VAUXLAND PROJECT PROFILE · GitHub 项目

context-mode

mksglu/context-mode

为 AI 编码代理压缩上下文窗口并持久化会话状态

GitHub Stars
26K
价格
公开代码 · 许可证待确认
许可证
许可证待确认
分类
AI Agent 与自动化

先看懂,再决定是否打开。

先用一句话看懂用途,再判断它为什么值得你继续了解。

EDITOR'S NOTE · WHY IT MATTERS

为什么值得关注

解决 MCP 工具调用大量原始数据挤占上下文窗口的问题,通过沙盒机制将工具输出压缩 98%,并以 SQLite + BM25 搜索保留会话记忆,支持 17 个平台的路由集成。

GET STARTED

如何开始使用

从官方 README 的安装与使用章节开始。先确认运行环境、API 密钥和许可证;代码开放不代表模型调用、云服务或硬件运行没有成本。

打开官方使用说明 ↗

做决定前,
再看这些事实。

只保留能帮助判断成熟度、使用门槛和来源可信度的信息。

项目类型
GitHub 项目
所属分类
AI Agent 与自动化
GitHub 仓库
mksglu/context-mode
英文原始描述
Context window optimization for AI coding agents. Sandboxes tool output (98% reduction), persists session memory, and enforces routing across 17 platforms via MCP + hooks.
GitHub Stars
26K
价格
公开代码 · 许可证待确认
许可证
许可证待确认
Vauxland 资料更新
2026 年 10 月 10 日
查看生成文案参考的 README 摘录

# Context Mode **The other half of the context problem.** Used across teams at ## The Problem Every MCP tool call dumps raw data into your context window. A Playwright snapshot costs 56 KB. Twenty GitHub issues cost 59 KB. One access log — 45 KB. After 30 minutes, 40% of your context is gone. And when the agent compacts the conversation to free space, it forgets which files it was editing, what tasks are in progress, and what you last asked for. On top of that, the agent wastes output tokens on filler, pleasantries, and verbose explanations — burning context from both sides. ### How Context Mode Solves It Context Mode is an MCP server that solves all four sides of this problem: 1. **Context Saving** — Sandbox tools keep raw data out of the context window. 315 KB becomes 5.4 KB. 98% reduction. 2. **Session Continuity** — Every file edit, git operation, task, error, and user decision is tracked in SQLite. When the conversation compacts, context-mode doesn't dump this data back into context — it indexes events into FTS5 and retrieves only what's relevant via BM25 search. The model picks up exactly where you left off. If you don't `--continue`, previous session data is deleted immediately — a fresh session means a clean slate. 3. **Think in Code** — The LLM should program the analysis, not compute it. Instead of reading 50 files into context to count functions, the agent writes a script that does the counting and `console.log()`s only the result. One script replaces ten tool calls and saves 100x context. This is a mandatory paradigm across all 17 supported clients, plus the OpenClaw gateway integration: stop treating the LLM as a data processor, treat it as a code generator. 4. **No prose-style enforcement** — context-mode keeps raw data out of context but never dictates how the model writes its final answer. Brevity, completeness, formatting — your model's call (or yours via your own `CLAUDE.md` / `AGENTS.md`). Aggressive brevity prompts have been shown to degrade coding/reasoning benchmarks (Moonshot AI on `kimi-k2.5`) — the routing block stays focused on *where data goes*, not on *how the model talks*. ## Install Platforms are grouped by install complexity. Hook-

资料检查:2026 年 10 月 11 日;这是最近抓取的来源资料,不是历史 README 存档。核对完整 README ↗