J
新手入门
tamaratran/fast-jev-compaction
tamaratran/fast-jev-compaction 最后提交 2026-09-18

fast-jev-compaction:让长对话的上下文清理更可控

Claude Code plugin that replaces the compaction summary with Jev decisions: every tool call and result is scored in one fast request, stale ones are dropped or truncated, everything kept stays verbatim.

编辑注解 2026-09-21

这个项目是一个面向 Claude Code 的上下文压缩插件,也可以作为独立的 npm 库使用。它用 Jev 分析编程 Agent 在执行过程中产生的工具调用和结果,判断哪些内容仍然与当前任务有关,再对过时记录进行删除或截短,从而减少上下文占用。

传统的压缩方式通常会把旧对话重新总结成一段摘要,但在编程场景里,文件路径、命令参数、错误信息和用户约束都可能影响后续操作。这个项目选择保留重要内容的原文,只处理工具调用及其结果,用户和助手的文字会继续按原顺序保留。对于每条工具记录,Jev 会分别评估调用本身和执行结果的保留价值,系统再决定完整保留、保留结果开头,或移除整组内容。

我觉得它的价值在于,它把上下文管理变成了一个可观察、可调试的筛选流程。项目提供压缩统计、决策记录和失败回退机制,用户能了解哪些信息被保留,以及最终节省了多少内容。对于经常使用 Claude Code 处理大型项目的人来说,这种方法有助于延长连续工作时间,也能降低摘要遗漏关键细节带来的风险。

⭐
5441 stars
🍴
297 forks
📄
TypeScript
⚖️
MIT
🔧
59 open issues
📅
创建于 2026-09-17

README 摘要

fast-jev-compaction Claude Code plugin that replaces the compaction summary with Jev decisions: every tool call and result is scored in one fast request, stale ones are dropped or truncated, everything kept stays verbatim. Also usable as an npm library. What and why Most context compaction asks an LLM to summarize old turns. A summary is lossy: a file path, exact error, constraint, or command can disappear even when it matters later. This library never rewrites anything. It only deletes tool calls and tool results Jev says are no longer needed, and it asks Jev while showing it the whole conversation. User and assistant text stays verbatim and in order. The repository is both an npm package (src/) and a Claude Code plugin (hooks/, .claude-plugin/) that uses the package to replace Claude Code's built-in compaction summary with the original messages. How it works 1. Every tool_use is paired with its tool_result by tool_use_id. Calls in the first message or in the newest preserveRecentMessages messages are pinned and never touched. 2. The **state** sent to Jev is the whole conversation so far, oldest first,…

在 GitHub 上读完整 README →