LeeHigma0201/claude-code-mods/tree/main/mods/check-ledger
check-ledger
记录实际运行过的检查,以及检查后哪些文件发生了变化;提供状态行、/evidence 和 Claude 在声称已测试前读取的证据工具。
关于这个 mod
一个 Claude Code mod,用来追踪 CLAUDE.md 状态声明背后的证据。它监听 Bash 和编辑工具调用,将真实检查(测试、类型检查器、构建、linter、验证器、plugin test/validate)与不符合条件的调用区分开来,然后报告简短的状态行,例如 ✓ pnpm run typecheck · 2 files unchecked 或 ✗ pnpm test。/evidence 命令显示最近 10 次检查、上次通过检查后被编辑的文件,以及账本支持的最强状态词(tested 与 implemented locally)。mcp__check-ledger__evidence 工具向模型提供同一份报告,但需要本地监听器;如果被拒绝,它会记录一行,同时状态行和 /evidence 仍可使用。包含 3 个可通过 claude plugin test . 运行的测试。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add LeeHigma0201/claude-code-mods claude plugin install check-ledger
原文 / README
check-ledger
Keeps the evidence behind the CLAUDE.md status words: which real checks ran, whether they passed, and which files changed after the last pass.
- Real check means the repo's tests, type-checker, build, linter or validator:
pnpm test|typecheck|build|lint,vitest,jest,pytest,tsc,cargo/go/swifttest/build,eslint,claude plugin test|validate, and similar. Syntax-only checks (bash -n,node --check,json.tool),--helpand--versiondon't count. The outcome comes from the Bash call's own error flag. - Status line:
✓ pnpm run typecheck · 2 files unchecked, or✗ pnpm test. /evidence: the last 10 checks, the files edited after the last passing check, and the strongest word the ledger supports:tested(every edit has a passing check after it) orimplemented locally.evidencetool (mcp__check-ledger__evidence): the same report for Claude to read before it says "tested". The tool needs a local listener. Where that is refused (a sandboxed launch) it logs one line, and/evidenceand the status line still work.
Limits: the ledger lives in the module and restarts on a reload or a new session. It only sees calls made in this session, including its subagents. It observes; it never blocks or changes a call.
Hooks: session.start, tool.call (Bash and edit tools, passed through unchanged), command.run. Calls:
$.command.register, $.tool.register, $.ui.status, $.ui.log, $.clock.now.
Test: claude plugin test . (3 tests).