Show HN:Context Mode – 315 KB 的 MCP 输出在 Claude Code 中压缩至 5.4 KB
发布: (2026年2月25日 GMT+8 14:23)
2 分钟阅读
原文: Hacker News
Source: Hacker News
概述
每次 MCP 工具调用都会将原始数据倾倒到 Claude Code 的 200 KB 上下文窗口中。一次 Playwright 快照占用 56 KB,20 条 GitHub issue 占用 59 KB。30 分钟后,你的上下文已损失 40%。
我构建了一个位于 Claude Code 与这些输出之间的 MCP 服务器。它在沙箱中处理数据,仅返回摘要。315 KB 变为 5.4 KB。
功能
- 支持 10 种语言运行时。
- 使用 SQLite FTS5 与 BM25 排序进行搜索。
- 批量执行。
- 将可用会话时间从约 30 分钟延长至约 3 小时,减缓速度下降。
安装
/plugin marketplace add mksglu/claude-context-mode
/plugin install context-mode@claude-context-mode
基准测试与源码
- 基准测试和源码可在以下位置获取:
反馈
欢迎对在 Claude Code 中遇到上下文限制的任何人提供反馈。
评论链接: (积分: 11)