Agents & MCP
Keep an agent working toward a standing backlog with a Stop hook that re-prompts on exit, plus honest guardrails so a self-continuing loop stays bounded and reviewable.
1 file
Description
Keep an agent working toward a standing backlog with a Stop hook that re-prompts on exit, plus honest guardrails so a self-continuing loop stays bounded and reviewable.
A repo has a durable backlog (for example a NEVERENDING-TODO.md or a QA.md) and you want the agent to pick the next highest-value items, ship them, and continue, instead of stopping after one batch.
A Stop hook fires when the agent finishes a turn. It can block the stop and feed a follow-up instruction, which restarts the agent on the next batch. That turns "do a batch" into "keep doing batches against the backlog file".
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "path/to/next-batch.sh"
}]
}]
}
}
The hook script decides whether to continue: if the backlog still has unchecked high-value items and a per-run budget is not exhausted, it emits the next instruction and blocks the stop; otherwise it lets the agent stop.
A Stop-hook loop keeps momentum, but it does not make the agent correct. Bound it so a bad run cannot spin:
If the loop fans work out to subagents, set a floor on how much each must accomplish (one shipped item, one committed change) so a batch cannot "complete" with nothing done. Pair that with the per-run ceiling above.
Added 2026-07-01. Back to the Skill Library.

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.