agent-run-forensics
What it does
This skill makes the agent answer questions about its own past work from the saved session record instead of guessing. It is for people who need to know why a file changed or whether tests really passed.
When to use it
- ✓When you want to know why an agent changed a file in an earlier session.
- ✓When you need to check whether a test run really passed before trusting a summary.
- ✓When you want to verify an agent's summary of what it did against the record.
Skill link
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agent-run-forensics/skills/agent-run-forensics/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Check the recorded session and tell me why config.yaml was changed and whether the tests really passed.”
5 new skills a week. 1 minute to read.
How it works
The agent finds the run you mean in the saved sessions, then builds a timeline of steps and file changes from the transcript. It checks each claim against the record before repeating it as fact.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Agent Run Forensics
Portability: 3 stdlib Python CLIs and one hook. Read-only, no network, no model calls. Secrets in transcripts are redacted in every output, with no switch to turn that off.
Agents are confidently wrong about their own history. Asked "why did you change
config.yaml?", an agent answers from what it remembers, and memory drops the
parts that matter: the test run that failed, the file a sed -i one-liner
rewrote, the edit made after the last green run. The harness recorded all of it.
This skill makes the answer come from that recording.
The rule: when a question is about something that already happened, read the trace before answering.
Workflow
# 1 - Find the run (skip if the question is about this session: the hook gives you its path)
python scripts/trace_finder.py --since 7d --touched config.yaml
# 2 - Read it: what happened, in order, and which files changed
python scripts/trace_timeline.py --trace <path> --files # SILENT = changed, never named by the agent
python scripts/trace_timeline.py --trace <path> --grep timeout # or --errors, --file PATH, --around N
# 3 - Walk back from the step in question
python scripts/trace_timeline.py --trace <path> --why 9
# 4 - Before repeating any summary as fact, check it
python scripts/claim_checker.py --trace <path> --claim "passed:pytest" --claim "not-edited:config.yaml"
Step 3 prints two lists and you keep them apart in the answer:
| Label | Means | Example |
|---|---|---|
recorded |
The harness wrote it down when it happened | the command, its exit code, the agent's words in the same message |
inferred |
Derived now by a named rule | prior-write, read-before-write, retry-after-failure, target-seen-in-output |
Say "the trace shows" only for recorded edges. Name an inferred edge as inferred, with its rule. The agent's own stated reason is recorded as a claim, not as the cause.
Step 4 turns each sentence of a summary into a typed claim (ran:, not-run:,
passed:, failed:, edited:, not-edited:, read:). STALE means the tests
passed but files changed afterwards; PARTIAL means exit 0 came from the last
command of a pipe or ; chain. Exit 4 is a contradiction: correct the account first.
Hard rules
- No trace, no answer. If the finder returns nothing (exit 2), say the run is not recorded here. Do not reconstruct it.
- Cite steps. Every factual sentence about the run points at a step number.
- Recorded and inferred stay separate. Never merge them into one confident sentence.
- Shell effects are inferred unless the harness diff (
bashEditDiff) confirms them. A command's text says what it was meant to do, not what it did. - Exit 0 of a compound line is the last command's.
pytest | tee logpassing says nothing about pytest. - Quote no secrets. Outputs are redacted; do not paste raw transcript lines around the redaction.
Scripts
| Script | Role | Exit codes |
|---|---|---|
scripts/trace_finder.py |
Lists recorded sessions by repo, window, touched file, text | 0 found · 2 none · 3 bad input |
scripts/trace_timeline.py |
Numbered steps, --files table, --why STEP chain |
0 · 2 filter matched nothing · 3 |
scripts/claim_checker.py |
Typed claims vs the recording | 0 all supported · 2 weak · 3 · 4 contradicted |
All support --help, --sample and --output json. trace_core.py is the shared parser.
The plugin's UserPromptSubmit hook (hooks/forensics_hint.py) adds one line naming this
session's transcript when a prompt asks about past work; disable it with AGENT_RUN_FORENSICS_HOOK=0.
References and assets
references/trace_sources.md: where each harness records, what is in a record, retention and limits (7)references/recorded_vs_inferred.md: why self-reports are not evidence, and the inference rules (7)references/claim_verification.md: turning a summary into claims, verdicts, and how to correct an account (7)assets/forensic_answer_template.md: the shape of an answerassets/claims_example.txt: a claims file for--claims-file
FAQ
Does it change any files or send data?
No. The skill is read-only, uses no network and makes no model calls.
Can it show secrets from old sessions?
No. Secrets are always redacted in its output, and this cannot be switched off.
How does it find an earlier run?
It can search recent sessions by time period or by a file that was changed.
Details
Original description by the author
Use 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.
Popularity
- GitHub stars
- 29k
- Ranking position
- #9527
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
agent-launcher-orchestrator
29kHelps your agent plan, build, test and schedule a Claude managed agent in your own account, step by step, starting from one clear goal.
grade-iterate
29kLets your agent grade a managed AI agent's work against a rubric and improve it in a fixed number of rounds, so it never loops forever.
interview
29kLets your agent interview you about an AI agent idea and turn your answers into a simple build plan before anything is launched.
run-without-you
29kHelps your agent set up a managed AI agent to run on a schedule or when an event happens, with the cron timing checked before launch.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.