forensics

forensics is a skill for Claude Code, Codex from open-gsd/gsd-pi. It costs 112 tokens per session (2,047 once invoked), scanned A, original, MIT.

A post-mortem guide for finding why a GSD automatic run failed or became stuck by examining its saved activity and runtime files.

In plain words
What is it for?
It helps inspect event logs, journals, metrics, locks, paused sessions, and debug files, then produce a bug report with file and line references.
Why use it?
It helps trace visible failures back to a root cause instead of guessing from the final symptom.

Skill for Claude CodeCodex

About the project

GSD Pi is a command-line coding agent and project workflow system that plans, implements, verifies, and tracks software work through milestones, tasks, Git worktrees, and stored project notes. It is for developers who want structured, longer-running agent sessions using different model providers. The catalogue entries extend GSD Pi with skills and agents.

open-gsd/gsd-pi · 1,198 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/open-gsd/gsd-pi/forensics
Any agent
npx skills add open-gsd/gsd-pi --skill forensics
Clone the repo
git clone --depth 1 https://github.com/open-gsd/gsd-pi

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for forensics

README.md
[![agentmods](https://agentmods.dev/badge/skills/open-gsd/gsd-pi/forensics.svg)](https://agentmods.dev/skills/open-gsd/gsd-pi/forensics)
Your own site
<a href="https://agentmods.dev/skills/open-gsd/gsd-pi/forensics"><img src="https://agentmods.dev/badge/skills/open-gsd/gsd-pi/forensics.svg" alt="Measured on agentmods" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,047 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00112 $0.02047
Opus 5 $0.00056 $0.01024
Sonnet 5 $0.00022 $0.00409
Haiku 4.5 $0.00011 $0.00205

Measured 5d ago against content hash db5b11b0a11b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

forensics scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/resources/skills/forensics/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

  • activity/{seq}-{unitType}-{unitId}.jsonl — full tool-call and message stream per unit
  • journal/YYYY-MM-DD.jsonl — iteration-level events. Orchestrator path emits orchestrator-* events (orchestrator-dispatch-match, orchestrator-guard-block, orchestrator-terminal, etc.); legacy loop events (dispatch-match, stuck-detected, guard-block, unit-start/end, terminal) can still appear on non-orchestrator paths.
  • metrics.json — token/cost ledger; duplicate type/id entries indicate a stuck loop
  • auto.lock — JSON snapshot of the currently-owning PID; stale lock = crash mid-unit
  • forensics/ — saved prior reports
  • debug/ — debug logs if enabled
  • runtime/paused-session.json — serialized session when auto-mode paused
  • doctor-history.jsonl — doctor check history

The /gsd forensics command pre-computes a forensic report with anomalies flagged. This skill is the manual investigation that goes deeper, or runs when the automated report isn't enough.

Invocation points:

  • /gsd forensics has been run and user wants deeper analysis
  • Auto-mode exited unexpectedly, no obvious cause
  • Same unit dispatched multiple times (stuck loop suspected)
  • A session crashed and auto.lock is stale
  • User reports "it just stopped" or "it did the wrong thing"

<core_principle> READ-ONLY. Forensics touches no live state. Non-mutating inspection commands (e.g., ps, top -b, cat /proc/*) are allowed for checking process status or reading system files. Strictly prohibited: gsd_* writes, commands that modify state, executing binaries that produce side effects, writing to files (outside the final report), or re-running the failed unit. The evidence must stay pristine for future investigations.

SYMPTOM → ROOT CAUSE, WITH CITATIONS. Every claim in the report is backed by an artifact path and either a line number or a JSONL field. "The loop got stuck because of a race" is not useful; ".gsd/journal/2026-04-19.jsonl:142 shows stuck-detected with flowId X, caused by dispatch-guard.ts:87 returning the same unit after unit-end" is.

PRE-PARSED LEADS, NOT CONCLUSIONS. If /gsd forensics has surfaced anomalies, treat them as hypotheses to verify, not answers. </core_principle>

Step 1: Locate the evidence

Read what's in .gsd/:

  1. auto.lock — is it stale? Check PID against ps (read-only inspection, allowed). Stale = crash.
  2. Most recent .gsd/activity/*.jsonl — sort by mtime, newest first. That's the last unit that ran.
  3. Today's .gsd/journal/YYYY-MM-DD.jsonl — the iteration-level view.
  4. .gsd/metrics.json — does any type/id appear more than once? (stuck loop signal)
  5. .gsd/runtime/paused-session.json — if present, what was the pause reason?

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 154 lines · 112 tokens per session scan A db5b11b0a11b

Subscribe to this mod's changes

forensics is a skill published in the GitHub repository open-gsd/gsd-pi (1,198 stars, last pushed today), licensed MIT. It adds 112 tokens to every session and 2,047 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.