Gate your agents on blast radius. Confidence is the one input they can move

Two columns: @hanakoxbt's three gate lanes sorted by how hard a mistake is to undo, and the commands my Claude Code hook blocks on all three of my Macs
Fig. 1. The three lanes are from @hanakoxbt's Loops and Graphs course (X Article, Aug 23, 2026). The hook details are from my own Nov 10 audit and test run.

An X Article from August is going around again. @hanakoxbt's "Loops and Graphs: how to stop babysitting agents and only approve the last step" got reposted yesterday afternoon under a caption that credits Anthropic engineers. It's hanakoxbt's own course, and it holds up.

The core split is simple. A loop makes one unit of work correct: produce, check, correct, repeat until green. A graph decides which units exist, which run at the same time and which wait. In the article's words, the loop lives inside a node and the graph lives between them.

There's a lot in it I'd point people to, like the list of things that are not checks ("the output looks good", "the model says it is confident", "no errors were raised") and the rule to send back the one failing unit instead of the whole batch. The section I keep coming back to is the gate.

Sort the work by what it costs to undo

Most setups let work through when a confidence score clears a threshold. The article says that's the wrong variable, because confidence is the only input the model itself can influence. It sorts work into three lanes instead:

  • Reversible and contained, like a copy change, a test or an isolated function. This lane can open first.
  • Reversible but wide, like a shared utility or a schema addition. Gate it on deterministic checks plus a clean run.
  • Hard to reverse, like migrations, deletions, production data or money. This lane doesn't open, whatever the score says.

The article's reason for the third lane is the best line in it: thresholds get adjusted, and closed lanes don't.

My closed lane is a hook

I have one of these. Claude Code does the coding on my three Macs, and each of them runs the same PreToolUse hook. Before a shell command runs, the hook checks it, and a short list of commands never gets through: force-push, git reset --hard, git clean -f, gh pr merge, reboot and shutdown, plus a few others. It also catches them when they're wrapped in sudo, ssh, sh -c or eval. When it blocks something, the rule in Claude's instructions is to stop and ask me, and never to work around it.

No score gets a force-push through, however sure the model is, so in the article's terms it's a closed lane.

It didn't start that strict. On Nov 10 I had Claude audit my own rules against the code, and a lot of them turned out to be sentences only. The merge gate, posting, secrets and most deletes lived in the instructions file, and nothing enforced them. The hardening that day added git reset --hard, git clean, gh pr merge and a few more to the hook, fixed a false positive where it blocked an echo that only mentioned a reboot, and synced the same file to all three Macs. The hook test script passed 157 of 157 cases on each one.

Where my lane leaks

The article's point about gates cuts the other way too, so here are mine. The hook only sees shell commands. A tool that isn't a shell call goes straight past it. And on purpose, anything it can't parse is allowed through, so a weird command can never jam a session. Both were choices for a hook aimed at model accidents, not at an attacker, and both are holes.

Its last piece of advice is where I'd go next: put the human on one step, the one with the highest consequence and the lowest reversibility. Approve the merge. My hook already stops agents at gh pr merge. Taken all the way, that would be the only place I get asked anything.

Credit: the loop and graph split, the three lanes and the "closed lanes don't" line are from @hanakoxbt's Loops and Graphs course (X Article, Aug 23, 2026). The hook details are from my own Nov 10 audit and test run.

Tags: Agents Claude Code Agent workflow

All ship logs