插件低风险未认领
agent-run-forensics
Answer questions about past agent runs from the recording, not from memory. Three read-only stdlib scripts over the session transcripts Claude Code and Codex already write: a finder that locates the run by repo, time window, touched file or command text; a timeline that numbers every step with its exit code, lists every file changed (flagging changes the agent never mentioned) and walks back from any step with each causal edge labelled recorded or inferred by a named rule; and a claim checker that tests a summary's claims (ran, passed, edited, not-edited, read) against the run and catches tests that passed before a later edit and exit codes that belong to the last command of a pipe. Secrets are always redacted. A UserPromptSubmit hook gives the agent this session's transcript path when a prompt asks about past work. Ships cs-run-forensics agent, /cs-run-forensics and /cs-check-claims commands and 3 cited references.
alirezarezvanialirezarezvani/agent-run-forensics-plugin
说明
Answer "why did the agent do that?" from the recording of the run, not from anyone's memory of it.
Agents are confidently wrong about their own history. A summary written from
memory loses the failed test run, the file a sed -i one-liner rewrote, and the
edit made after the last green run. Claude Code and Codex already record every
tool call, argument, result and exit code on disk. This plugin reads that record.
What it does
| Script | Job | Exit codes |
|---|---|---|
trace_finder.py |
Finds the run: by repo, --since 7d, --touched config.yaml, --grep "rm -rf" |
0 found · 2 not recorded |
trace_timeline.py |
Numbered steps with exit codes; --files flags changes the agent never named (SILENT); --why STEP walks back with each edge labelled recorded or inferred by a named rule |
0 · 2 nothing matches |
claim_checker.py |
Checks a summary's claims (passed:pytest, not-edited:config.yaml, ...): SUPPORTED, STALE (edited after the green run), PARTIAL (exit 0 of a pipe's last command), CONTRADICTED |
0 · 2 weak · 4 contradicted |
A UserPromptSubmit hook adds one line when a prompt asks about past work
("why did you...", "did the tests actually pass?"), naming this session's
transcript path. It stays silent otherwise and never blocks. Disable it with
AGENT_RUN_FORENSICS_HOOK=0.
Everything is stdlib Python, read-only, with no network and no model calls. Secret-shaped strings are redacted in every output, with no off switch.
Install
/plugin marketplace add alirezarezvani/claude-skills
/plugin install agent-run-forensics@claude-code-skills
Commands: /cs-run-forensics <question> and /cs-check-claims. Agent: cs-run-forensics.
Try it without a real session: python3 skills/agent-run-forensics/scripts/claim_checker.py --sample.
Limits
- Shell effects are read from command text, so they are inferred unless Claude Code's own
bashEditDiffconfirms them. A command that writes through a script (python fix.py) shows no effect at all. - The transcript is the agent's view: changes made in your terminal, CI or by a teammate are not in it.
- Claude Code deletes old transcripts after
cleanupPeriodDays; an old run may be gone. - Codex support is parsed from the rollout format and tested on a synthetic fixture, not on real Codex sessions yet.
- No replay. This reads what happened; it does not re-run it.
Origin
The idea came from PR #1016, which proposed the same discipline around the proposer's own npm recorder and was closed under this repo's no-vendor rule. This is an independent build over the recordings the harnesses already keep; no code or text from that PR or its tool was used.
MIT © Alireza Rezvani
宿主
成员1 个技能 · 1 个助手
agent-run-forensicsUse when asked why an agent did something, what a past session or run changed, whether tests really passed, or to verify a session summary. Answers from the recorded transcript, not memory, with trace_finder.py, trace_timeline.py and claim_checker.py.
cs-run-forensics助手Use when asked why an agent did something, what a past session or overnight run changed, whether its tests really passed, or to check a summary or handoff against what happened. Reads the recorded transcript, walks back from the step in question, and keeps recorded facts apart from inferences.
权限
- 完整安装
- 2.14.7
自动运行
- 钩子Claude CodeUserPromptSubmit
python3 "${CLAUDE_PLUGIN_ROOT}/hooks/forensics_hint.py"
pythonalirezarezvani.comcode.claude.comdocs.pytest.orggithub.comjsonlines.orgmetr.orgopentelemetry.iopubs.opengroup.orgwww.anthropic.comwww.gnu.org~/.claude~/.codex检查
低风险 · 没有发现需要提醒的地方。
未经人工审核 · 已做规则检查;模型审核尚未开启。
另有 10 处低风险标记:常见命令之类,只记录、不提醒
- 规则 · command_injection
README.md:13 - 规则 · command_injection
skills/agent-run-forensics/references/recorded_vs_inferred.md:36 - 规则 · command_injection
skills/agent-run-forensics/scripts/trace_core.py:289 - 规则 · command_injection
skills/agent-run-forensics/scripts/trace_core.py:291 - 规则 · command_injection
skills/agent-run-forensics/scripts/trace_core.py:292 - 规则 · command_injection
skills/agent-run-forensics/scripts/trace_core.py:286 - 规则 · command_injection
skills/agent-run-forensics/scripts/trace_core.py:288 - 规则 · command_injection
skills/agent-run-forensics/scripts/trace_core.py:310 - 规则 · privilege_escalation
skills/agent-run-forensics/scripts/trace_core.py:269 - 规则 · command_injection
skills/agent-run-forensics/scripts/trace_finder.py:22
文件18 个文件 · 98.1 KB
- README.md2.7 KB
.claude-plugin/2
- authoring-notes.json1.1 KB
- plugin.json1.3 KB
agents/1
- cs-run-forensics.md2.9 KB
commands/2
- cs-check-claims.md914 B
- cs-run-forensics.md1003 B
hooks/2
- forensics_hint.py3.7 KB
- hooks.json691 B
skills/agent-run-forensics/1
- SKILL.md5.2 KB
skills/agent-run-forensics/assets/2
- claims_example.txt210 B
- forensic_answer_template.md754 B
skills/agent-run-forensics/references/3
- claim_verification.md3.4 KB
- recorded_vs_inferred.md3.9 KB
- trace_sources.md3.8 KB
skills/agent-run-forensics/scripts/4
- claim_checker.py10.2 KB
- trace_core.py35.0 KB
- trace_finder.py7.1 KB
- trace_timeline.py14.3 KB
版本
- #12.14.7最新2026年11月17日