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 agentproto/ts --skill ap-lifecyclegit clone --depth 1 https://github.com/agentproto/tsWrote 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/agentproto/ts/ap-lifecycle)<a href="https://agentmods.dev/skills/agentproto/ts/ap-lifecycle"><img src="https://agentmods.dev/badge/skills/agentproto/ts/ap-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.
<a href="https://agentmods.dev/skills/agentproto/ts/ap-lifecycle"><img src="https://agentmods.dev/badge/skills/agentproto/ts/ap-lifecycle.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00077 | $0.01381 |
| Opus 5.5 | $0.00031 | $0.00552 |
| Sonnet 5.5 | $0.00015 | $0.00276 |
| Haiku 4.5 | $0.00008 | $0.00138 |
Grade A, and why
ap-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 16d 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 — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Session Lifecycle (Kill, Restart, Archive, GC)
When to use
You need to end, pause, recover, hide, or bulk-clean agentproto sessions — distinct from spawning (ap-spawn-agent) or waiting on them (ap-wait-fanin). Covers the full state machine: live → interrupted/killed → restarted, and live → archived/gc'd → gone from the default listing.
MCP: ending or pausing a turn
agent_kill terminates a session outright.
{ "tool": "agent_kill", "args": { "sessionId": "sess_abc123" } }
agent_interrupt cancels the in-flight turn but keeps the session alive and
idle — use this instead of agent_kill when you want to redirect the agent
rather than end it.
{ "tool": "agent_interrupt", "args": { "sessionId": "sess_abc123" } }
MCP: recovery
session_restart respawns an exited or killed session with conversation
continuity — it does not start fresh, it resumes.
{ "tool": "session_restart", "args": { "sessionId": "sess_abc123" } }
MCP: visibility and retention
{ "tool": "session_archive", "args": { "sessionId": "sess_abc123" } }
{ "tool": "session_unarchive", "args": { "sessionId": "sess_abc123" } }
Archiving hides a session from the default list; it's reversible via
session_unarchive. session_archive refuses to archive a still-live
session — kill or let it finish first.
{ "tool": "session_gc", "args": { "mode": "archive", "olderThanDays": 14 } }
Bulk archives (or bulk forgets, depending on mode) terminal sessions past a
retention window. Never touches sessions that are still live.
{ "tool": "session_set_keepalive", "args": { "sessionId": "sess_abc123", "keepalive": true } }
Exempts a session from the idle-reaper — use for a long-running background watcher you don't want auto-archived out from under you.
{ "tool": "session_set_pinned", "args": { "sessionId": "sess_abc123", "pinned": true } }
Pins a session: it stays at the top of listings, survives casual GC sweeps
and is never stopped by the idle reaper (pinned means never stopped). A
session that holds an approval (pending, or approved and not yet consumed) is
also never reaped, and keeps its Bureau tabs until the approval is consumed,
denied or expired. An explicit session_kill still stops a pinned session.
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.
- 16d ago Changed · +3 lines 0875a5b22169
- 1mo ago Changed · +22 lines 55498d2cc4b0
- 2mo ago First seen · 109 lines · 77 tokens per session scan A 3495d60244ab
ap-lifecycle is a skill published in the GitHub repository agentproto/ts (11 stars, last pushed today), licensed Apache-2.0. It adds 77 tokens to every session and 1,381 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-09-04.
ap-lifecycle compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ap-lifecycleagentproto/ts | Skill | 11 | today | Apache-2.0 | A | 77 | Claude Code, Codex |
| skill-creator-primersammcj/agentic-coding | Skill | 174 | 4d ago | Apache-2.0 | A | 74 | Claude Code |
| llm-wikisammcj/agentic-coding | Skill | 174 | 4d ago | Apache-2.0 | A | 82 | Claude Code |
| extract-wisdomsammcj/agentic-coding | Skill | 174 | 4d ago | Apache-2.0 | A | 43 | Claude Code |
| apply-mantel-stylessammcj/agentic-coding | Skill | 174 | 4d ago | Apache-2.0 | A | 37 | Claude Code, Codex |
| home-assistantsammcj/agentic-coding | Skill | 174 | 4d ago | Apache-2.0 | A | 57 | Claude Code |
| deepevalsammcj/agentic-coding | Skill | 174 | 4d ago | Apache-2.0 | A | 19 | Claude Code, Codex |