Agent Run Forensics skill for Claude

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.

Agent Run Forensics SKILL.md

The full skill file from alirezarezvani/claude-skills (MIT).

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:

LabelMeansExample
recordedThe harness wrote it down when it happenedthe command, its exit code, the agent's words in the same message
inferredDerived now by a named ruleprior-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 log passing says nothing about pytest.
  • Quote no secrets. Outputs are redacted; do not paste raw transcript lines around the redaction.

Scripts

ScriptRoleExit codes
scripts/trace_finder.pyLists recorded sessions by repo, window, touched file, text0 found · 2 none · 3 bad input
scripts/trace_timeline.pyNumbered steps, --files table, --why STEP chain0 · 2 filter matched nothing · 3
scripts/claim_checker.pyTyped claims vs the recording0 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

How to install Agent Run Forensics

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit alirezarezvani/claude-skills/engineering/skills/agent-run-forensics#main ~/.claude/skills/agent-run-forensics

Codex

npx degit alirezarezvani/claude-skills/engineering/skills/agent-run-forensics#main ~/.codex/skills/agent-run-forensics

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Agent Run Forensics skill do?

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.

+How do I install Agent Run Forensics in Claude Code?

Copy the skill folder into ~/.claude/skills/agent-run-forensics, for example with "npx degit alirezarezvani/claude-skills/engineering/skills/agent-run-forensics#main ~/.claude/skills/agent-run-forensics". Claude Code loads it automatically and uses it when a task matches.

+Does Agent Run Forensics work with ChatGPT or Codex?

Yes. Agent Run Forensics uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/agent-run-forensics. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Agent Run Forensics free?

Agent Run Forensics is published on GitHub by alirezarezvani under the MIT license, which allows free use.

Related testing & code review skills

  1. Agent Browser

    Official

    Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms,…

    vercel-labs/agent-browser★ 53k
  2. Playwright

    Official

    Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction,…

    openai/skills★ 29k
  3. Playwright Skill

    Complete browser automation with Playwright. Auto-detects dev servers, writes reusable test scripts, and supports screenshots, responsive…

    lackeyjb/playwright-skill★ 3.3k
  4. Browserstack

    Use when running Playwright tests on BrowserStack or across a browser matrix ('browserstack', 'cross-browser', 'test on safari or firefox',…

    alirezarezvani/claude-skills★ 30k
  5. Caio Review

    Use for /c-level-agents:caio-review, or to challenge a plan involving AI (no eval set, API vs fine-tune vs self-host, EU AI Act class).

    alirezarezvani/claude-skills★ 30k
  6. Cco Review

    Challenge a churn, retention, segment or CS hiring plan. Use whenever asked or /c-level-agents:cco-review.

    alirezarezvani/claude-skills★ 30k
  7. Cdo Review

    Use for /c-level-agents:cdo-review, or to challenge a plan touching training-data rights, data architecture or data monetization.

    alirezarezvani/claude-skills★ 30k
  8. Channel Economics

    Use for a direct vs partner channel review: fully loaded cost to serve, channel ROI and the best channel mix under constraints.

    alirezarezvani/claude-skills★ 30k
  9. Ciso Review

    Challenge a plan touching customer data, compliance or prod access. Use when asked or /c-level-agents:ciso-review.

    alirezarezvani/claude-skills★ 30k

See all testing & code review skills →

More skills from alirezarezvani

  1. Agent Workflow Designer

    Use when architecting a multi-step LLM or agent pipeline, choosing single vs multi-agent, or fixing context bloat and broken handoffs.

    alirezarezvani/claude-skills★ 30k
  2. Agenthub

    Run several agents on one task in parallel and keep the best result: faster code, copy variants, research angles.

    alirezarezvani/claude-skills★ 30k
  3. Agile Product Owner

    Use for backlog work: writing user stories and acceptance criteria, splitting epics, estimating or prioritizing for a sprint.

    alirezarezvani/claude-skills★ 30k

All skills by alirezarezvani →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.