verify-agent-lifecycle

verify-agent-lifecycle is a skill for Claude Code, Codex from dimetron/pi-go. It costs 100 tokens per session (1,301 once invoked), scanned A, original, MIT.

A formal model for checking the life cycle of subagents, which are helper agents started by a main coding agent. It follows spawning, events, cancellation, process exit, and resource cleanup.

In plain words
What is it for?
Use it when changing subagent orchestration, cancellation, shutdown, process tracking, or the pool that limits concurrent agents.
Why use it?
It catches race conditions where cancellation is overwritten, an agent is removed before its result is recorded, or a shared worker slot is released twice.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it when changing subagent orchestration, cancellation, shutdown, process tracking, or the pool that limits concurrent agents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dimetron/pi-go/verify-agent-lifecycle
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.

Any agent
npx skills add dimetron/pi-go --skill verify-agent-lifecycle
Clone the repo
git clone --depth 1 https://github.com/dimetron/pi-go

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 verify-agent-lifecycle

README.md
[![agentmods](https://agentmods.dev/badge/skills/dimetron/pi-go/verify-agent-lifecycle/github.svg)](https://agentmods.dev/skills/dimetron/pi-go/verify-agent-lifecycle)
Your own site
<a href="https://agentmods.dev/skills/dimetron/pi-go/verify-agent-lifecycle"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/verify-agent-lifecycle/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.

agentmods 80×15 button for verify-agent-lifecycle

Your own site · 80×15
<a href="https://agentmods.dev/skills/dimetron/pi-go/verify-agent-lifecycle"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/verify-agent-lifecycle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,301 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00100 $0.01301
Opus 5.5 $0.00040 $0.00520
Sonnet 5.5 $0.00020 $0.00260
Haiku 4.5 $0.00010 $0.00130

Measured 21d ago against content hash 15baf5004035, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

verify-agent-lifecycle 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 21d 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.

internal/extension/bundled_skills/verify-agent-lifecycle/SKILL.md · 97 lines

How it starts

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

Verify the subagent lifecycle

One subagent has six states, three writers, and a pool slot that must be released exactly once. pool.Release is an unguarded channel receive (internal/subagent/pool.go:36-38), so a second release panics the process, and nothing in a single-agent test can produce the interleaving that does it.

The properties: a cancel is never overwritten by the process's own exit reason, an agent that leaves the list has already published its verdict, and exactly one pool slot is released per spawn.

Does my change touch the verified code

git diff --stat <sync-commit>..HEAD -- \
  internal/subagent/orchestrator.go internal/subagent/pool.go internal/subagent/types.go

Model covers (each model step names the function it stands for):

Model action Code
SlotAcquired Spawn past pool.Acquire, orchestrator.go:487-499
SpawnRefused trackAgent refuses after shutdown → abandonSpawn, orchestrator.go:499-505, 599-607
Event / ProcExits the event loop and proc.Wait, orchestrator.go:610-629
Cancel Cancel + validateAgentForCancel, orchestrator.go:806-834
ShutdownRunning / ShutdownIdle ShutdownWithTimeout, orchestrator.go:859-894
PublishKept / PublishEvicted forwardAgentEvents' tail: evict, publish, release, orchestrator.go:628-648, 683-711

Not modelled, and why: the worktree manager (its own stash lifecycle, modelled separately if it becomes a target); spawner.go's event channel and its silent drops when the 64-slot buffer fills; terminalStatus's signal classification (the model takes the outcome as a parameter); recentTasks and the prune loop; concurrency above one agent; Get/List as anything other than a read. A bug in any of those is invisible here.

Run it

hack/formal/check.sh agent           # all rules hold, or the first one that breaks
hack/formal/check.sh agent --chart

Cost: 35 distinct states, under a second. Exit 0 all rules hold, 1 a rule broke, 2 TLC or the environment failed.

Read the full file on GitHub · 97 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. 21d ago First seen · 97 lines · 100 tokens per session scan A 15baf5004035

Subscribe to this mod's changes

verify-agent-lifecycle is a skill published in the GitHub repository dimetron/pi-go (232 stars, last pushed today), licensed MIT. It adds 100 tokens to every session and 1,301 once invoked, about $0.0004 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-11-09.

Related

verify-agent-lifecycle compared with skills from other repositories

verify-agent-lifecycle next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
verify-agent-lifecycledimetron/pi-goSkill232todayMITA100Claude Code, Codex
test-fixpatriceckhart/zotSkill373yesterdayMITA17Claude Code
find-tracesaxiomhq/cliSkill607d agoMITA37Claude Code
troubleshoot-tervaterva-sh/tervaSkill52d agoMITA83Claude Code, Codex
golang-lintalexastrum/sklSkill116d agoMITA100Claude Code
golang-troubleshootingalexastrum/sklSkill116d agoMITA130Claude Code
golang-samber-oopsalexastrum/sklSkill116d agoMITA74Claude Code