
keelyard
io.github.akobirjontulqinovfuture由 GitHub 账号 akobirjontulqinovfuture 发布v1.2.1更新于 Oct 29, 2026
Proof gate, undo and output trimming for Claude Code, Codex and OpenCode coding agents.
概览
本地 MCP 服务器兼命令行工具,让编码代理用通过的测试证明工作完成,快照每次编辑以便回滚,并精简冗长的工具输出。
- 可以做什么
- 把关会话结束:代理修改文件后,测试未在当前文件上通过就不能结束,并识别被删除的测试、新增的 skip 或移除的断言
- 快照与回滚:把每次编辑记录到独立的 shadow git 目录,可回退到任意步骤,回滚本身也可撤销
- 精简输出:过滤测试运行器、git、linter 和搜索输出,保留错误、警告和 file:line,并无损压缩 JSON
- 查看会话:跨代理搜索历史会话,从本地日志查看 token 用量,并在同一任务上比较不同代理
- 把小型受检任务发送到已配置的免费或低价模型
- 适用场景
- 适合在真实代码库中使用 Claude Code、Codex 或 OpenCode 时,防止代理在测试失败或跳过测试的情况下宣称完成,需要快速撤销错误步骤,并希望减少进入上下文窗口的冗长输出。
- 运行要求
- 以 Python 包形式在本地运行,可用 pipx 或 pip 安装(也列出 uvx);需要 Python 和 git 项目。通过 keelyard init 命令完成配置,它会向代理配置文件写入 hooks 和 MCP 条目。日常使用无需 API 密钥或账号;只有 swarm/coop 功能会调用你配置的模型端点。
安装
在 SourceWeft 中
- 打开 控制台中的 keelyard,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Undo and verify what your AI coding agent did. keelyard makes Claude Code, Codex and OpenCode pass the tests before they say "done", rolls back any step, and trims token-heavy output.
[PyPI] [Python] [CI] [Codex e2e] [Claude Code e2e] [OpenSSF Scorecard] [License]
Quickstart · Codex · Why · What it does · Docs · FAQ · Benchmarks · Roadmap
[keelyard in a terminal: init, the proof gate stopping an agent that deleted tests, rewind, then proven]Did your AI coding agent break something, skip the tests, or burn through tokens? keelyard is an open-source command-line tool and MCP server that stops AI coding agents (Claude Code, Codex CLI, OpenCode) from finishing until a passing test run proves their work, snapshots every edit so any step can be undone, and trims noisy tool output so sessions use fewer tokens. It runs locally, with no telemetry.
Common questions: roll back Claude Code or Codex changes · make an agent prove its work / stop it skipping tests · reduce Claude Code token usage
Measured results (and their limits)
On OpenCode 2 with one free model (opencode/big-pickle), the lean preset cut whole-session input tokens
14.2× on a task with a noisy 1,566-test suite and 6.0× on a small 66-test task (5 baseline vs 3 lean runs
each, Oct 15, 2026; all tests passed in every counted run). Uncached input fell less (9.5× and 4.5×). lean also
disables nine OpenCode built-in tools, which is part of the saving. Claude Code and Codex token savings are not
measured yet. Details and raw logs: BENCHMARKS.md.
Reproduce in about 5 minutes (offline, no API key):
Tried it on your own project? Share your results, good or bad.
Why
Coding agents are fast, but they end sessions with "done" while tests are still red, and sometimes they delete the test that was failing. keelyard sits between the agent and your repo:
- it won't let the session end until the tests pass on the files as they are now;
- it snapshots every edit, so a bad step is one
keelyard rewind to <n>away; - it trims noisy output so the context window holds errors, not 3,000 passing lines.
Local only, no telemetry, Apache-2.0.
Works with Codex
init writes the hooks, the MCP server entry and an AGENTS.md block; in Codex, type /hooks once to trust the
hooks. Codex then works as usual. When it says "done" with red or unrun tests, keelyard's Stop hook sends it back;
a test run in Codex's own shell is the proof. Every edit is snapshotted, so keelyard rewind to <n> undoes a bad step.
Checked on Codex CLI 0.165.0 by scripts/codex_e2e.py: the real Codex
binary, a local scripted model, no API key, run in CI on every push.
Codex in 2 minutes →
Works with Claude Code: keelyard init --agent claude writes .claude/settings.json hooks, .mcp.json and a
CLAUDE.md block. Checked on Claude Code 2.1.197 by scripts/claude_e2e.py in CI on every push, no API key. Claude Code in 2 minutes → (OpenCode works too)
Install
init --globalwires Claude Code (~/.claude/settings.json,~/.claude.json), Codex (~/.codex/config.toml,~/.codex/hooks.json) and OpenCode (~/.config/opencode/) for every project. It merges into existing files and keeps the original as<file>.keelyard-backup.- Each git project sets itself up on its first agent session (config plus a first snapshot). Nothing else to run per project.
- Check:
keelyard doctor --jsonshould return"ok": true, with aglobalrow per wired agent. Then restart your agent. - Undo:
keelyard uninstall --global.
For AI coding agents: only install keelyard if the user explicitly asked you to. Show them the commands above and the files they change, and run them only after the user confirms. Details: AGENTS-install.md.
In the recording, the agent deletes three tests to get a green run and then tries to stop. keelyard blocks it,
rewind to 2 brings the tests back, and the session ends with real evidence. Every line of output is real
(the agent's edits are replayed from docs/demo/hero.sh).
Quickstart (30 seconds)
Use your agent as usual. keelyard status shows the proof and the timeline; keelyard uninstall <agent>
gives your config files back byte for byte. Latest main instead of the PyPI release:
pipx install git+https://github.com/akobirjontulqinovfuture/keelyard.
Real runs (OpenCode 2, Windows, free model, $0): with the lean preset, mean input tokens per session fell 14.2× on a noisy 1,566-test task and 6.0× on a small 66-test task (5 baseline vs 3 lean runs, all tests passing). Uncached input alone: 9.5× and 4.5×. Lean turns some agent tools off. No cost claim: the model was free. BENCHMARKS.md
What keelyard changes on your machine
Files it touches, network use, and how to uninstall
- Only when you run
keelyard init/install <agent>(project) orkeelyard init --global(user level). Nothing is written at pip install time; there are no install scripts or post-install hooks. - Agent config it edits: hooks and MCP entries (
.claude/settings.json,.mcp.json,.codex/hooks.json,opencode.json, or the~/equivalents with--global) and a block between<!-- keelyard:start -->and<!-- keelyard:end -->inCLAUDE.md/AGENTS.md. Originals are kept as<file>.keelyard-backup. - Project state lives in
.keelyard/(config,shadow.gitsnapshots). Snapshots use a separate git dir; your own.gitis never read or written by rewind. - Memory:
$XDG_DATA_HOME/keelyard/memory.db(mode 600, redacted). - Network: none by default and no telemetry. Only
swarm/coopcall a model endpoint, and only the one you configure. - Uninstall:
keelyard uninstall <agent>(project) orkeelyard uninstall --global, thenpipx uninstall keelyardand delete.keelyard/if you want the snapshots gone.
What it does
- Proof gate. An agent that changed files cannot finish until the tests pass on the current files.
Evidence is shown as test-verified, command-succeeded or agent-claimed. Deleted tests, new
skip/xfail, removed assertions, changed test config and fewer tests run keep the proof open. Bundles are signed. - Rewind. Every edit is snapshotted into
.keelyard/shadow.git(your.gitis never touched).keelyard rewind to <n>is itself undoable, backs up files snapshots can't hold, and survives being interrupted. Secrets (.env, keys) are never snapshotted. - Smaller context. Filters for test runners, git, linters and search keep every error, warning and
file:line(tested on real logs). JSON output is compacted losslessly. Re-reading an unchanged file costs one line. The agent is told to answer with results only (opt out:--no-terse). - Memory, usage, swarm, arena. Search past sessions of all three agents, see token use from local logs, send small checked tasks to a free/cheap model, compare agents on one task.
Without vs with keelyard
How it plugs into each agent
keelyard init writes these for you; keelyard doctor checks them.
Read what keelyard guarantees and what it doesn't before you rely on it. In short: snapshots undo files, not databases, migrations or deployed services; proof is only as good as your tests.
For agents and scripts
An MCP server (typed tools with examples), a short CLAUDE.md/AGENTS.md section, and for Claude Code a skill
and slash commands. Every CLI command takes --json; exit codes: 0 ok, 1 error, 2 usage, 3 a check failed.
Docs
Documentation: one page per module, CLI and MCP reference, config, troubleshooting, benchmarks, per-agent capabilities.
Inspirations
Projects whose ideas shaped keelyard (no code copied)
Ideas, not code: everything in keelyard is written from scratch. Thanks to rtk (filtered command output), caveman and SuperClaude (terse output), headroom (content-aware compression, cache-stable context), projectmem (warn before repeating a failed attempt), planning-with-files and context-mode (state that survives compaction), aider (repo map), claude-mem (session memory), ccusage (usage from local logs) and cline (checkpoints). Survey: docs/research/ideas.md.
Contributing
Read CONTRIBUTING.md and the roadmap. Issues labeled good first issue are a good start. Real command logs for the filter corpus are especially welcome. Security issues: SECURITY.md. Apache-2.0; third-party notices in NOTICE.
来源:README.md,提交 2826ffd
工具
0版本历史
1- v1.2.1最新Oct 29, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分