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-wait-faningit 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-wait-fanin)<a href="https://agentmods.dev/skills/agentproto/ts/ap-wait-fanin"><img src="https://agentmods.dev/badge/skills/agentproto/ts/ap-wait-fanin/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-wait-fanin"><img src="https://agentmods.dev/badge/skills/agentproto/ts/ap-wait-fanin.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.00087 | $0.00885 |
| Opus 5.5 | $0.00035 | $0.00354 |
| Sonnet 5.5 | $0.00017 | $0.00177 |
| Haiku 4.5 | $0.00009 | $0.00089 |
Grade A, and why
ap-wait-fanin 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 2mo 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 — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Wait For Sessions To Finish (Fan-In)
When to use
You've spawned one or more agentproto sessions (see ap-spawn-agent) and need to know the moment any — or all — of them finish a turn, hit awaiting-input, or exit. This is the fan-in step: block cheaply instead of burning your own context re-checking output by hand.
Gotchas — read this before you wait on anything
- Never write a shell/terminal polling loop (
for i in ...; do check; sleep; done) to wait on children. A watchdog killing you mid-loop permanently corrupts the underlying session into an "already has an in-flight prompt" error that survives a restart — this happened in production on 2026-09-01 and the session never recovered. If you spawn a supervisor sub-agent that will itself wait on children, brief it explicitly:session_monitoris THE fan-in mechanism, shell poll loops are forbidden. - session_monitor can miss ultra-fast children. If a trivial child
finishes before you attach the watch, the watch never fires for it. Parry
by taking a
session_events_pollcursor BEFORE spawning children, or by confirming completion viaagent_outputonce a timeout elapses. - Arm the watch at spawn time. Wakeup timers / scheduled re-checks are a safety net only — the primary mechanism is the long-poll itself, not a cron that happens to fire later.
MCP: session_monitor
Multiplexed long-poll across N sessions. Returns on the FIRST watched session to fire the requested event — you decide whether to keep waiting on the rest.
{
"tool": "session_monitor",
"args": {
"sessionIds": ["sess_abc123", "sess_def456"],
"event": "turn-end",
"timeoutMs": 45000
}
}
Valid event values: turn-end, awaiting-input, exited, any.
timeoutMs accepts 1000-49000 — it is a long-poll, not an indefinite wait,
so for longer horizons re-issue the call after each timeout. Prefer the CLI
alternative below when a real shell is available to you.
MCP: session_events_poll
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.
- 2mo ago First seen · 95 lines · 87 tokens per session scan A 3584c38354fe
ap-wait-fanin is a skill published in the GitHub repository agentproto/ts (11 stars, last pushed today), licensed Apache-2.0. It adds 87 tokens to every session and 885 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-wait-fanin compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ap-wait-faninagentproto/ts | Skill | 11 | today | Apache-2.0 | A | 87 | 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 |