durable-supervision

A background supervisor for coding-agent sessions that runs a check when an agent turn ends. The check can be a shell command or another judging agent, and the result is reported through an event stream.

In plain words
What is it for?
Use it to validate agent work at the end of turns, monitor groups of sessions, emit pass or fail events, and require human approval before creating a commit.
Why use it?
It makes completion checks continue even when the controlling app is closed and prevents work from being committed before a check passes and a person approves it.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/agentproto/ts/durable-supervision
Any agent
npx skills add agentproto/ts --skill durable-supervision
Clone the repo
git clone --depth 1 https://github.com/agentproto/ts

Made for: Claude Code, Codex.

Per session 172 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,930 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
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 $0.00172 $0.03930
Opus 5 $0.00086 $0.01965
Sonnet 5 $0.00034 $0.00786
Haiku 4.5 $0.00017 $0.00393

Measured 3d ago against content hash e4457738a90b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

durable-supervision scanned grade C with 1 finding 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

**inside** the workspace (cwd does not escape), test, then `rm -rf`.
packages/skill-pack-agentproto/src/skills/durable-supervision/SKILL.md · 285 lines

How it starts

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

Durable supervision (in-daemon policy engine)

The durable supervisor does not live in cowork (which depends on the app being open) but in the agentproto daemon. It subscribes to session events (turn-end/awaiting-input/exited), runs a gate at the end of a turn, and emits the result on an event bus that you read without token-hungry polling. It is the governance layer on top of sessions; topology (who spawns whom) belongs to nested-orchestration, model execution to light-coder-orchestration.

Everything below has been proven live except the sections explicitly marked "source" (code-complete + unit tests, but not re-executed here).

One-line principle

session → (turn-end) → gate (shell|judge) → policy:passed|failed → [then: emit | commit (human ack) → policy:committed]

Before delegating, paste the Brief Contract from supervisor-session into every brief.

1. Attach a policy to a session

policy_attach({
  sessionId: "sess_xxx",        // OR sessionIds:[...] for a fan-in group
  then: "emit",                  // "emit" → policy:passed/failed ; "commit" → stage+commit
  gate: { command, args?, cwd?, timeoutMs? },   // shell: exit 0 = pass
  onFail?: { nudge?, maxRetries? },             // re-prompt N times then blocked
  next?: <policy>                                // DAG: chains a policy on done (source)
})
  • Lifecycle proven: watching → (turn-end) gatingdone (green) / blocked (red, no retry left) / awaiting-ack (commit). Read it via policy_status({policyId}); inventory via policy_list().
  • The gate runs after the watched session's turn-end. Attach the policy BEFORE the session finishes its turn (spawn idle → attach → prompt), otherwise you run the same race risk as wait_for_any (the transient event can be missed).
  • No gate → the policy passes immediately at turn-end (useful to just milestone a completion on the bus).

2. The (shell) gate — two lived invariants

The shell gate is { command, args?, cwd?, timeoutMs? }, exit 0 = pass. Two traps proven live:

Read the full file on GitHub · 285 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. 3d ago First seen · 285 lines · 172 tokens per session scan C e4457738a90b

Subscribe to this mod's changes

durable-supervision is a skill published in the GitHub repository agentproto/ts (5 stars, last pushed 3d ago), licensed Apache-2.0. It adds 172 tokens to every session and 3,930 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

pre-push

Runs the local equivalent of the CI merge gate before you push. Detects which areas (Python, TypeScript, docs) your changes touch, auto-fixes what it can, then runs only those checks. Use when the user asks to run pre-push checks, get push-ready, verify changes before pushing or opening a PR, "make sure CI will pass"…

strands-agents/harness-sdk · 85 tokens

docs-planner

Identify documentation gaps and prioritize the docs backlog. Use when planning a docs improvement sprint, after signals surface repeated friction, when new SDK features ship without docs, or for periodic health assessment. Also triggers on "plan docs work", "what docs need writing", "prioritize the backlog", "docs…

strands-agents/harness-sdk · 73 tokens

pr-feedback

Fetches PR review feedback and inline comments, categorizes them, and presents options to the user. Use when the user asks to get, read, address, or fix review comments on a pull request.

strands-agents/harness-sdk · 44 tokens

document-service

This skill should be used when the user asks to "analyze this codebase", "document this service", "generate technical docs", "I inherited this code", "help me understand this system", "create docs for this project", "what does this system look like", "onboard me to this codebase", "this codebase has no docs"…

awslabs/agent-plugins · 141 tokens

hyperpod-cluster-debugger

Diagnose and remediate cluster-wide HyperPod (EKS or Slurm) problems — creation / deployment failures (CloudFormation, EFA health check, lifecycle scripts, capacity), EKS access, node replacement, CloudFormation nested-stack errors, post-maintenance rollback state, dangling nodes, autoscaler conflicts. Includes…

awslabs/agent-plugins · 80 tokens

hyperpod-nccl

Diagnose NCCL failures and adjacent training-pod failures on HyperPod GPU clusters (EKS or Slurm) — training hangs, AllReduce / collective-op timeouts, EFA or libfabric errors, rendezvous failures, EFA TCP fallback, /dev/shm or memlock issues, NCCL version mismatch across pods, container OOM / exit-137 / OOMKilled…

awslabs/agent-plugins · 150 tokens