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.
npx skills add dimetron/pi-go --skill pi-loop-forensicsgit clone --depth 1 https://github.com/dimetron/pi-goWrote 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.
[](https://agentmods.dev/skills/dimetron/pi-go/pi-loop-forensics)<a href="https://agentmods.dev/skills/dimetron/pi-go/pi-loop-forensics"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/pi-loop-forensics/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/dimetron/pi-go/pi-loop-forensics"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/pi-loop-forensics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00065 | $0.02154 |
| Opus 5.5 | $0.00026 | $0.00862 |
| Sonnet 5.5 | $0.00013 | $0.00431 |
| Haiku 4.5 | $0.00006 | $0.00215 |
Grade A, and why
pi-loop-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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Loop Forensics
Use when a run dies with agent loop aborted: ..., or a model burns a long turn
thinking without ever calling a tool. This skill decides why before anything
is changed: the abort message names a symptom, not a cause.
Sibling skill pi-check-session-logs covers tool call errors. This one covers
repetition and runaway turns. They do not overlap.
Where the evidence lives
| What | Path |
|---|---|
| Session logs (JSONL, one per run) | ~/.pi-go/log/<yyyy-mm-dd>/session-HH-MM-SS.log |
| Session state (resumable) | ~/.pi-go/sessions/<id>/ — events.jsonl, meta.json, trajectory.atif.json |
| Detector source | internal/tui/agent_loop.go |
Log rows are {"time","type","content",...} with type in session_start,
thinking, llm_text, tool_call, tool_result, user, error. The model
name is on the session_start row — always record it, findings are per-model.
How the guard actually works
stuckDetector (internal/tui/agent_loop.go:119) has three independent arms:
observe— identical consecutive tool calls, trips atmaxRepeatToolCalls=10. Pagination args are stripped first (volatileToolArgs), so paging one file collapses to one fingerprint.observeError— same tool failingmaxToolErrorStreak=10 times running.observeOutput(:246) — the model's own text/thinking. Needs a period ≥minOutputPeriod=16 bytes, ≥minPeriodVariety=8 distinct bytes, andmaxOutputRepeats=12 byte-exact back-to-back copies inside an 8 KB tail.
The third arm is the only one that sees a turn making no tool calls at all.
outBuf is never reset across a run, and the thinking branch (:690) skips
dedup.SkipText, unlike the text branch (:697).
Timeline caveat — check this before judging any old log. Sessions predating these commits cannot be compared against current behavior:
| Commit | Landed | Effect |
|---|---|---|
e069b34 |
2026-08-08 06:56:44 +0200 | added observeOutput (the phrase-repetition arm) |
5a4cb8b |
2026-08-08 18:52:42 +0200 | stopped aborting productive polling (bash_output) |
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 3mo ago First seen · 169 lines · 65 tokens per session scan A c1f16ec5158e
pi-loop-forensics is a skill published in the GitHub repository dimetron/pi-go (235 stars, last pushed 4d ago), licensed MIT. It adds 65 tokens to every session and 2,154 once invoked, about $0.0003 per session on Opus 5.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.
pi-loop-forensics compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pi-loop-forensicsdimetron/pi-go | Skill | 235 | 4d ago | MIT | A | 65 | Claude Code, Codex |
| golang-lintalexastrum/skl | Skill | 11 | 3d ago | MIT | A | 100 | Claude Code |
| golang-samber-oopsalexastrum/skl | Skill | 11 | 3d ago | MIT | A | 74 | Claude Code |
| golang-troubleshootingalexastrum/skl | Skill | 11 | 3d ago | MIT | A | 130 | Claude Code |
| golang-safetyalexastrum/skl | Skill | 11 | 3d ago | MIT | A | 80 | Claude Code |
| golang-error-handlingalexastrum/skl | Skill | 11 | 3d ago | MIT | A | 144 | Claude Code |
| rust-checkHmbown/CodeWhale | Skill | 41k | 5d ago | MIT | A | 15 | Claude Code, Codex |