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 agentmods add skills/dimetron/pi-go/pi-loop-forensicsnpx 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.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00065 | $0.02154 |
| Opus 5 | $0.00032 | $0.01077 |
| Sonnet 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 4d 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.
- 4d 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 (151 stars, last pushed today), licensed MIT. It adds 65 tokens to every session and 2,154 once invoked, about $0.0003 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.
Other skills, from other repositories
use-modern-go
Use the Modern Go Guidelines CLI whenever writing, modifying, fixing, or refactoring Go code. Apply its version-specific guidance to generated changes.
jwx-companion-bulk
Apply bulk operations across all jwx companion modules. Args.
readme-generate
從原始碼分析自動生成雙語 README。當使用者請求為專案建立 README、需要從程式碼庫生成 README.md(英文)和 README.zh.md(中文)、或希望為其函式庫/套件建立一致的多語言文件時使用。.
search-suitable-public-api
Search the curated Agenvoy public API list for an API that fits the current user need or skill context, then chain into the api-tool-add skill to register it under /.config/agenvoy/tools/api/. Triggers when the agent lacks a tool for a data lookup (weather, currency, geocoding, dictionary, etc.), when the user says…
write-zot-themes
Help the user create, install, or package zot themes, including theme-only extensions.
go
Use for Go changes in Neva: authoring, refactoring, debugging, or review.