<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Jed Arden — Notes</title><description>Notes, posts, and papers on headless LLM systems, agent orchestration, and platform engineering.</description><link>https://jedarden.com/</link><item><title>Your CLI has a second user now</title><link>https://jedarden.com/notes/cli-design-for-humans-and-agents/</link><guid isPermaLink="true">https://jedarden.com/notes/cli-design-for-humans-and-agents/</guid><description>Every command-line tool you ship is now driven by language-model agents as well as people. An agent learns the tool from --help, parses stdout as data, treats the error message as its only hint, and cannot answer a prompt. Here is what that changes about help text, errors, output, flags, and login — and why the agent-friendly version is the better tool for people too.</description><pubDate>Sat, 10 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A worker spent forty minutes on a one-line change to an issue tracker. The command was right. The flag was wrong: &lt;code&gt;--notes&lt;/code&gt; replaced the whole notes field instead of appending to it, and the help line never said so. The agent wrote its note, erased a colleague&apos;s investigation, noticed the field looked thin, and &quot;fixed&quot; it by writing a longer note. Three times.&lt;/p&gt;
&lt;p&gt;A person would have squinted at the first result and gone looking for an &lt;code&gt;--append&lt;/code&gt; flag. The agent did what the help text told it was possible and nothing more, because the help text was the only manual it had.&lt;/p&gt;
&lt;p&gt;Every CLI you ship now has that second user. It discovers the tool by running &lt;code&gt;--help&lt;/code&gt;, parses stdout as data, treats the error message as its only hint about what to try next, and cannot type an answer when you ask it a question. Design for that user and the human gets a better tool too. The rules are mostly the ones &lt;a href=&quot;https://clig.dev/&quot;&gt;clig.dev&lt;/a&gt; wrote down for humans years ago; the agent audience just removes the tolerance.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A person squints past a vague error. An agent loops on it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;What an agent does differently&lt;/h2&gt;
&lt;p&gt;Six things, and each one turns a nice-to-have into a requirement:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;It learns the tool from &lt;code&gt;tool --help&lt;/code&gt; and &lt;code&gt;tool &amp;lt;command&amp;gt; --help&lt;/code&gt;&lt;/strong&gt;, not from a docs site it may never fetch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It cannot answer a prompt.&lt;/strong&gt; A confirmation question hangs the task until something times out.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It reads output literally&lt;/strong&gt;, so a spinner, a pager, or an ANSI escape is noise it has to work around.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It retries on failure.&lt;/strong&gt; An error that does not say what to change produces the same wrong call again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It copies values from one command into the next&lt;/strong&gt;, so anything printed, including a secret, ends up in a transcript.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It runs in CI, over SSH, and inside sandboxes&lt;/strong&gt; with no browser and no keychain.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The payoff is symmetric. A CLI that satisfies those six points is one an agent can drive unsupervised, and it is also the one a new teammate can pick up without reading the wiki.&lt;/p&gt;
&lt;p&gt;I&apos;ll use a hypothetical issue tracker called &lt;code&gt;trk&lt;/code&gt; for the examples. Every rule below is one I&apos;ve either enforced in a tool of mine or paid for by not enforcing.&lt;/p&gt;
&lt;h2&gt;Help text is the manual&lt;/h2&gt;
&lt;p&gt;An agent&apos;s first command is &lt;code&gt;tool --help&lt;/code&gt; and its second is &lt;code&gt;tool &amp;lt;command&amp;gt; --help&lt;/code&gt;, and it will rarely look anywhere else. Help therefore has to be complete at every level, identical in shape across commands, and free to call.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-h&lt;/code&gt; and &lt;code&gt;--help&lt;/code&gt; both work on every command and subcommand&lt;/strong&gt;, print to stdout, and exit 0. Help on stderr with exit 1 reads as a failure to anything scripted. Don&apos;t reuse &lt;code&gt;-h&lt;/code&gt; for something else.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Help needs no login, no network, and no config file.&lt;/strong&gt; If &lt;code&gt;tool --help&lt;/code&gt; fails because the user is not authenticated, the agent cannot learn how to authenticate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Examples come first, and every command has at least one.&lt;/strong&gt; Agents copy examples; they fall back to the usage grammar only when no example fits. Show the common call, then one that uses the flags that change behavior.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every flag line states its value type, its default, and the environment variable that can set it.&lt;/strong&gt; &lt;code&gt;--region &amp;lt;name&amp;gt;   default us-east-1, env TRK_REGION&lt;/code&gt; is enough.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Say what a flag does to existing state when it is not obvious.&lt;/strong&gt; An agent assumes &lt;code&gt;--notes&lt;/code&gt; appends. If it replaces the whole field, the help line has to say so, or you get the forty-minute incident above.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List the exit codes and what each means.&lt;/strong&gt; A documented code is one the agent can branch on; an undocumented non-zero is one it can only retry.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Missing required arguments print concise help&lt;/strong&gt; (one-line description, one example, the required flags, a pointer to &lt;code&gt;--help&lt;/code&gt;) and exit 2. Never hang waiting for stdin when stdin is a terminal and nothing is coming.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An unknown command or flag gets a nearest-match suggestion.&lt;/strong&gt; Suggest, never auto-run.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Top-level help lists every command with one line each&lt;/strong&gt;, grouped by task and ordered by frequency, not alphabetically. Mark deprecated commands rather than hiding them, so an agent that finds one in an old script learns the replacement.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep the layout identical across commands&lt;/strong&gt;: Usage, Examples, Flags, Exit codes, See also. An agent that has parsed one help screen should be able to parse all of them.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A help screen that follows those rules:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ trk update --help
Update an issue&apos;s status, assignee, or notes.

Usage:
  trk update &amp;lt;issue-id&amp;gt; [flags]

Examples:
  trk update TRK-412 --status in_progress
  trk update TRK-412 --append-note &quot;Repro lives in tests/clone.rs&quot;
  trk update TRK-412 --assignee alice --if-revision 7 --json

Flags:
  --status &amp;lt;open|in_progress|deferred&amp;gt;   closed is only reachable via `trk close`
  --append-note &amp;lt;text&amp;gt;                   adds a note; may be repeated
  --notes &amp;lt;text&amp;gt;                         REPLACES every existing note
  --assignee &amp;lt;name&amp;gt;                      env TRK_ASSIGNEE
  --clear-assignee
  --if-revision &amp;lt;n&amp;gt;                      fail if the issue&apos;s revision is not n
  --json                                 print the updated issue as JSON on stdout
  -h, --help

Exit codes:
  0 updated   2 usage error   3 issue not found   4 stale revision   5 invalid transition

See also: trk close, trk show, trk schema update
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Two additions worth the effort for a tool agents will drive heavily: a &lt;code&gt;schema&lt;/code&gt; command (or &lt;code&gt;--help --json&lt;/code&gt;) that emits the commands, flags, types, and defaults as JSON, and a man page or &lt;code&gt;help&lt;/code&gt; subcommand that renders the same text for people who prefer it. Both are generated from the same definitions as the help screen, so they cannot drift.&lt;/p&gt;
&lt;h2&gt;Errors say what happened, why, and what to run next&lt;/h2&gt;
&lt;p&gt;An error message is the agent&apos;s only feedback channel, so it carries three things: what failed, why, and the exact flag or command that fixes it. Anything less and the next attempt is the same call again.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ trk update TRK-412 --status in_progress --if-revision 7
error[stale_revision]: TRK-412 is at revision 9; --if-revision 7 is stale
  cause: the issue changed after you last read it
  fix:   trk show TRK-412 --json   # read the current revision, then retry with --if-revision 9
$ echo $?
4
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The same error under &lt;code&gt;--json&lt;/code&gt; is one object on stderr, with a code that never changes wording even when the prose does:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{&quot;error&quot;:{&quot;code&quot;:&quot;stale_revision&quot;,&quot;message&quot;:&quot;TRK-412 is at revision 9; --if-revision 7 is stale&quot;,&quot;fix&quot;:&quot;trk show TRK-412 --json, then retry with --if-revision 9&quot;,&quot;retryable&quot;:false,&quot;exit&quot;:4}}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Errors go to stderr and stdout stays clean for data&lt;/strong&gt;, so a pipeline that captures stdout never captures a half-written error.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every error has a stable machine-readable code&lt;/strong&gt; (&lt;code&gt;stale_revision&lt;/code&gt;) alongside the human sentence. Exit codes are the coarse classification; error codes are the fine one. Agents and scripts branch on the code and show the sentence to the human.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Name the offending value and the flag it came from.&lt;/strong&gt; &quot;invalid value&quot; is useless; &quot;&lt;code&gt;--status done&lt;/code&gt; is not a status; valid: open, in_progress, deferred (closed is reached via &lt;code&gt;trk close&lt;/code&gt;)&quot; is a fix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A wrong-state error names the state and the command that leaves it&lt;/strong&gt;: &quot;TRK-412 is closed; &lt;code&gt;--status&lt;/code&gt; cannot reopen it. Run &lt;code&gt;trk reopen TRK-412&lt;/code&gt;.&quot; Without that line the agent tries every status value in turn.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A wrong-tool or wrong-version error says so in those words.&lt;/strong&gt; A tracker store written by version 2 and opened by version 1 should fail with &quot;workspace schema 7 is newer than this binary (schema 5); upgrade trk&quot;, not with a raw &quot;no such column&quot; from the database layer. I watched the generic version of that error lead an agent to apply version 1&apos;s corruption-recovery recipe to a healthy version 2 store, which reinitialized it with the wrong schema. Check a schema marker before touching data, and make the mismatch message name the real cause.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A permission or policy refusal says whether the caller can fix it.&lt;/strong&gt; &quot;requires the admin role; ask an operator to grant it&quot; tells an agent to stop and report. &quot;access denied&quot; tells it to try again with different flags.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authentication errors name the login path, never the credential&lt;/strong&gt;: &quot;not logged in to &lt;a href=&quot;http://trk.example.com&quot;&gt;trk.example.com&lt;/a&gt;; run &lt;code&gt;trk auth login&lt;/code&gt; or set TRK_TOKEN&quot;. Distinguish no credential, expired credential, and insufficient scope, and name the missing scope with the command that adds it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stack traces are off by default and on with &lt;code&gt;--debug&lt;/code&gt;&lt;/strong&gt; or &lt;code&gt;TRK_DEBUG=1&lt;/code&gt;. Write the full trace to a log file and print its path. A traceback pasted into an agent&apos;s context costs tokens and brings it no closer to the fix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Partial failure is reported per item.&lt;/strong&gt; If three of five updates failed, exit non-zero, list the three with their codes, and print the two that succeeded so the caller can resume without redoing them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Repeated errors are grouped under one header.&lt;/strong&gt; Fifty identical lines hide the one that differs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One small, tool-wide exit-code table, documented in &lt;code&gt;--help&lt;/code&gt; and used identically by every command:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;th&gt;What an agent should do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;success&lt;/td&gt;
&lt;td&gt;continue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;unexpected failure&lt;/td&gt;
&lt;td&gt;report it; do not retry blindly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;usage error&lt;/td&gt;
&lt;td&gt;re-read &lt;code&gt;--help&lt;/code&gt;, fix the call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;not found&lt;/td&gt;
&lt;td&gt;check the identifier, do not retry as-is&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;stale precondition&lt;/td&gt;
&lt;td&gt;re-read state, then retry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;invalid state transition&lt;/td&gt;
&lt;td&gt;run the command the message names&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;not authenticated or not authorized&lt;/td&gt;
&lt;td&gt;run &lt;code&gt;trk auth login&lt;/code&gt;, or stop if the message says it needs an operator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;transient (network, rate limit)&lt;/td&gt;
&lt;td&gt;back off and retry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;130&lt;/td&gt;
&lt;td&gt;interrupted&lt;/td&gt;
&lt;td&gt;nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The split that matters most is retryable against not. A tool that returns 1 for everything forces every caller to guess, and an agent that guesses retries.&lt;/p&gt;
&lt;h2&gt;Output is a contract&lt;/h2&gt;
&lt;p&gt;Treat stdout as a return value that someone will parse and stderr as the channel for everything a person might want to see. Every other output rule follows from that split.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ trk create --title &quot;Flaky clone test&quot; --json
{&quot;schema&quot;:&quot;trk.issue/1&quot;,&quot;id&quot;:&quot;TRK-413&quot;,&quot;revision&quot;:1,&quot;status&quot;:&quot;open&quot;,&quot;url&quot;:&quot;https://trk.example.com/TRK-413&quot;}

$ trk create --title &quot;Flaky clone test&quot;
Created TRK-413 (revision 1)
https://trk.example.com/TRK-413
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Data goes to stdout; progress, warnings, hints, and success chatter go to stderr.&lt;/strong&gt; &lt;code&gt;trk list | jq&lt;/code&gt; must never see a &quot;Fetching…&quot; line.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every command that produces output supports &lt;code&gt;--json&lt;/code&gt;, including mutations&lt;/strong&gt;, which print the resulting object. The agent&apos;s next command is built from this output, so always include the identifier and revision it will need.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The JSON schema is stable and versioned.&lt;/strong&gt; Fields are added, never renamed or repurposed; a removal is a major version. Stamp each object with its schema name (&lt;code&gt;&quot;schema&quot;:&quot;trk.issue/1&quot;&lt;/code&gt;) or publish it through &lt;code&gt;trk schema&lt;/code&gt;, so a consumer can detect drift instead of discovering it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lists are either one JSON object per line or one top-level array.&lt;/strong&gt; Pick one per tool and document it. Paginated commands take &lt;code&gt;--limit&lt;/code&gt; and &lt;code&gt;--cursor&lt;/code&gt; and return the next cursor in the JSON, never an elided &quot;and 37 more&quot;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Detect whether stdout is a terminal, and check stderr separately.&lt;/strong&gt; When it is not, turn off color, spinners, progress bars, column truncation, and prompts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Honor &lt;code&gt;NO_COLOR&lt;/code&gt; when set and non-empty, &lt;code&gt;TERM=dumb&lt;/code&gt;, and &lt;code&gt;--no-color&lt;/code&gt;&lt;/strong&gt;; offer &lt;code&gt;--color=always&lt;/code&gt; for the reverse, because some agents run tools through a pseudo-terminal and want neither. &lt;a href=&quot;https://no-color.org/&quot;&gt;no-color.org&lt;/a&gt; has the convention.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never start a pager unless stdout is a terminal&lt;/strong&gt;, and honor &lt;code&gt;PAGER&lt;/code&gt; and &lt;code&gt;--no-pager&lt;/code&gt;. A pager under an agent is a hang with no error message.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Human-readable output is also parseable in a pinch&lt;/strong&gt;: one record per line, stable column order, and &lt;code&gt;--plain&lt;/code&gt; to drop alignment and decoration for grep and awk.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--quiet&lt;/code&gt; suppresses success messages, never errors.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timestamps in JSON are ISO 8601 in UTC.&lt;/strong&gt; The human format may localize; the machine format never does.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secrets never reach either stream, including under &lt;code&gt;--debug&lt;/code&gt;.&lt;/strong&gt; Print the retrieval path (the environment variable name, the secret store path) rather than the value, and redact anything that looks like a token in debug logs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The human-first format is still the default, and that is correct: a person who types the command deserves readable output. The agent just needs &lt;code&gt;--help&lt;/code&gt; to tell it that &lt;code&gt;--json&lt;/code&gt; exists, and the JSON to be worth parsing.&lt;/p&gt;
&lt;h2&gt;Arguments and flags are the API&lt;/h2&gt;
&lt;p&gt;Make every input expressible as a named flag, make precedence explicit, and make sure nothing that has to stay secret ever needs to be a flag value. A flag reads as documentation in a transcript; a bare positional reads as a guess.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Configuration precedence, highest first:
  1. flags            --server https://trk.example.com
  2. environment      TRK_SERVER
  3. config file      ~/.config/trk/config.toml
  4. built-in default
See the effective values:  trk config show --json
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One positional at most: the noun the command acts on&lt;/strong&gt; (&lt;code&gt;trk update TRK-412&lt;/code&gt;). Everything else is a flag with a long name, and &lt;code&gt;--flag value&lt;/code&gt; and &lt;code&gt;--flag=value&lt;/code&gt; both work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Precedence is flag, then environment, then config file, then default&lt;/strong&gt;, documented once in &lt;code&gt;--help&lt;/code&gt; and applied by every command. A &lt;code&gt;config show --json&lt;/code&gt; command prints the effective values so an agent can see what it is about to run with.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A secret is never a flag value.&lt;/strong&gt; Argument vectors are visible in &lt;code&gt;ps&lt;/code&gt;, in shell history, and in every agent transcript. Accept a file (&lt;code&gt;--token-file&lt;/code&gt;), stdin (&lt;code&gt;--with-token&lt;/code&gt; reading stdin, or &lt;code&gt;key=-&lt;/code&gt; for a field), or the system credential store. Environment variables leak too, through &lt;code&gt;docker inspect&lt;/code&gt; and &lt;code&gt;systemctl show&lt;/code&gt;; tolerate them for CI, but prefer a pipe or a file. What ends up in docs and tickets is then the retrieval path (&quot;set TRK_TOKEN from &lt;code&gt;gh auth token&lt;/code&gt;&quot;), never the value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-&lt;/code&gt; means stdin wherever a file or value is expected, and &lt;code&gt;@path&lt;/code&gt; reads a value from a file.&lt;/strong&gt; This is what lets &lt;code&gt;openssl rand -base64 32 | trk secret set app/db password=-&lt;/code&gt; run without the value ever existing as a literal.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Replace and append are different flags with different names.&lt;/strong&gt; &lt;code&gt;--notes&lt;/code&gt; that overwrites and &lt;code&gt;--append-note&lt;/code&gt; that adds cannot share a flag with a mode switch, because an agent that sees &lt;code&gt;--notes&lt;/code&gt; will use it to add a note and erase the previous ones.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--dry-run&lt;/code&gt; exists on every mutating command&lt;/strong&gt; and prints exactly what would change, in the same format the real run prints.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--yes&lt;/code&gt; skips confirmation prompts.&lt;/strong&gt; For the most destructive commands, require &lt;code&gt;--confirm &amp;lt;name&amp;gt;&lt;/code&gt; with the target&apos;s name instead, so a script can still pass it but cannot pass it by accident.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every mutation accepts &lt;code&gt;--if-revision &amp;lt;n&amp;gt;&lt;/code&gt;&lt;/strong&gt; (or an ETag) and fails with the stale-precondition code when the stored revision differs. This is the only thing that makes two agents on the same store safe. Without it the last writer wins and nobody is told.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Argument parsing has no side effects.&lt;/strong&gt; Reject unknown flags and validate every positional before creating or writing anything. A real binary that took an output path as its first positional was handed &lt;code&gt;--test-threads=2&lt;/code&gt; by a test harness, created a directory literally named &lt;code&gt;--test-threads=2/&lt;/code&gt; with 37 generated files in it, and a blanket &lt;code&gt;git add -A&lt;/code&gt; committed the lot.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every command accepts the identifier the tool prints.&lt;/strong&gt; If &lt;code&gt;create&lt;/code&gt; prints &lt;code&gt;TRK-413&lt;/code&gt;, then &lt;code&gt;show&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt;, and &lt;code&gt;close&lt;/code&gt; take &lt;code&gt;TRK-413&lt;/code&gt;. Accepting a short form as well is fine; requiring a different form is not.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flags are order-independent relative to positionals.&lt;/strong&gt; &lt;code&gt;trk update --json TRK-412&lt;/code&gt; and &lt;code&gt;trk update TRK-412 --json&lt;/code&gt; are the same call.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;--version&lt;/code&gt; prints the tool version and its output-schema versions&lt;/strong&gt; on one line, to stdout, exit 0, with no network call.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Environment variables share one prefix (&lt;code&gt;TRK_&lt;/code&gt;)&lt;/strong&gt; and each flag&apos;s help line names its variable, so the mapping is never a guess.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A tool whose flags obey these rules is one where the agent&apos;s transcript doubles as a reproducible script. That is the goal: every call it makes should be one a human could paste and understand.&lt;/p&gt;
&lt;h2&gt;Non-interactive when no one is there&lt;/h2&gt;
&lt;p&gt;Decide once at startup whether a person is present, and if not, never ask a question: fail with the name of the flag that would have answered it. Interactive means stdin and stderr are terminals, &lt;code&gt;CI&lt;/code&gt; and &lt;code&gt;TRK_NO_PROMPT&lt;/code&gt; are unset, and &lt;code&gt;--non-interactive&lt;/code&gt; was not passed.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ trk --help
trk: issue tracking from the terminal

Usage: trk &amp;lt;command&amp;gt; [flags]

Commands:
  create, show, list, update, close, reopen   work with issues
  auth login|status|token|logout              authentication
  config show|set                             configuration
  schema, doctor                              machine-readable self-description

Agents and scripts:
  Pass --json for stable output. Set TRK_NO_PROMPT=1 to fail instead of prompt.
  Run `trk doctor --json` to check auth and connectivity. Exit codes: trk help exit-codes.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A missing input in non-interactive mode is a usage error that names the flag&lt;/strong&gt;: &quot;&lt;code&gt;--assignee&lt;/code&gt; is required when not running interactively&quot;. Never block reading stdin that will never arrive.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A destructive command without &lt;code&gt;--yes&lt;/code&gt; fails with exit 2 and names &lt;code&gt;--yes&lt;/code&gt;.&lt;/strong&gt; It does not proceed and it does not prompt.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No browser launch, no clipboard, no pager, no spinner, no update-available banner.&lt;/strong&gt; Print the URL, print the data, and stop. A banner on stderr is something an agent will try to act on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Every network call has a default timeout and a &lt;code&gt;--timeout&lt;/code&gt; flag.&lt;/strong&gt; A hang produces no error message, so it is the worst outcome a tool can have.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mutations are safe to repeat.&lt;/strong&gt; &lt;code&gt;create&lt;/code&gt; takes an &lt;code&gt;--idempotency-key&lt;/code&gt; or is keyed by a natural name; &lt;code&gt;close&lt;/code&gt; on an already-closed issue returns 0 with a note, or a distinct documented code. Agents retry on any failure, and a retry that creates a duplicate is a bug they cannot see.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Long-running operations return a job id immediately&lt;/strong&gt;, with &lt;code&gt;--wait&lt;/code&gt; to block and a &lt;code&gt;status&lt;/code&gt; command to poll. Do not make the caller sit on a spinner it cannot read.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ctrl-C and SIGTERM exit promptly with 130 or 143&lt;/strong&gt; and leave no partial state or stale lock behind. Agents kill processes on timeout, so the cleanup path runs more often than you think.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A lock error names the holder, its PID, and its age&lt;/strong&gt;, and stale locks clear themselves. &quot;database is locked&quot; is a prompt to wait forever.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The tool describes itself.&lt;/strong&gt; &lt;code&gt;trk doctor --json&lt;/code&gt; reports the version, whether the caller is authenticated and as whom, which commands support &lt;code&gt;--json&lt;/code&gt;, which environment variables are set, and whether the server is reachable. GitLab&apos;s CLI has an &lt;a href=&quot;https://gitlab.com/gitlab-org/cli/-/issues/8177&quot;&gt;open proposal&lt;/a&gt; for exactly this shape, including a non-terminal error that points at the JSON-producing alternative.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Top-level help has a short section for agents and scripts&lt;/strong&gt;: which flag gives stable output, which variable disables prompts, where the exit codes are documented. Three lines are enough; the agent reads them on its first call.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of this is a separate &quot;agent mode&quot;. It is the behavior any CI job or cron script already needed, applied by default whenever the tool cannot see a terminal.&lt;/p&gt;
&lt;h2&gt;Authentication: OIDC and OAuth for a tool that runs anywhere&lt;/h2&gt;
&lt;p&gt;Choose the login flow from where the tool is running, not from one default: Authorization Code with PKCE and a loopback redirect when a browser is on the same machine, the Device Authorization Grant when there is a terminal but no browser, and a short-lived token from a workload identity when there is no person at all. A long-lived API key pasted into a flag is the option to design out.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;trk auth login
├─ no terminal attached ─────────────▶ workload identity, or an injected short-lived token
│                                       (CI OIDC token, Kubernetes service-account token, TRK_TOKEN)
└─ terminal attached
   ├─ a browser can open on this host ▶ Authorization Code + PKCE, loopback redirect on 127.0.0.1   (default)
   └─ no browser ────────────────────▶ Device Authorization Grant: URL and code on stderr, poll the token endpoint

Flags force a path: --web, --device, --with-token (reads the token from stdin)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A terminal without a browser gets the device grant; no terminal at all gets a platform identity or an injected token, never a device code it cannot hand to anyone.&lt;/p&gt;
&lt;h3&gt;The three flows&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Flow&lt;/th&gt;
&lt;th&gt;Use it when&lt;/th&gt;
&lt;th&gt;What it needs&lt;/th&gt;
&lt;th&gt;Main risk&lt;/th&gt;
&lt;th&gt;Reference&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authorization Code + PKCE, loopback redirect&lt;/td&gt;
&lt;td&gt;a person is at a machine with a browser&lt;/td&gt;
&lt;td&gt;a listener on 127.0.0.1, an ephemeral port, a browser&lt;/td&gt;
&lt;td&gt;low: the code is useless without the verifier, which never leaves the process&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8252&quot;&gt;RFC 8252&lt;/a&gt;, &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc7636&quot;&gt;RFC 7636&lt;/a&gt;; default in gcloud and in AWS CLI 2.22+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Device Authorization Grant&lt;/td&gt;
&lt;td&gt;a terminal but no browser: SSH, a container, a dev VM&lt;/td&gt;
&lt;td&gt;a second device where the person can open a URL&lt;/td&gt;
&lt;td&gt;device-code phishing: the user code is a bearer for the polling session&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8628&quot;&gt;RFC 8628&lt;/a&gt;; &lt;code&gt;gh auth login&lt;/code&gt;, &lt;code&gt;aws sso login --use-device-code&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Workload identity, token exchange&lt;/td&gt;
&lt;td&gt;no person: CI, a cluster, an unattended agent&lt;/td&gt;
&lt;td&gt;an identity the runner already has (CI OIDC token, Kubernetes service-account token)&lt;/td&gt;
&lt;td&gt;a long-lived fallback token that leaks&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8693&quot;&gt;RFC 8693&lt;/a&gt;; cloud federation endpoints&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;PKCE with a loopback redirect&lt;/strong&gt; is the default for interactive use. The CLI generates a code verifier, opens the browser to the authorize endpoint with the challenge and a random &lt;code&gt;state&lt;/code&gt;, listens once on &lt;code&gt;127.0.0.1:&amp;lt;port&amp;gt;&lt;/code&gt;, validates &lt;code&gt;state&lt;/code&gt; on the callback, exchanges the code with the verifier, and closes the listener. Bind to loopback only, accept one request, and time out. AWS made this the default for &lt;code&gt;aws sso login&lt;/code&gt; in CLI 2.22 and moved device code behind &lt;code&gt;--use-device-code&lt;/code&gt; (&lt;a href=&quot;https://aws.amazon.com/blogs/developer/aws-cli-adds-pkce-based-authorization-for-sso/&quot;&gt;AWS Developer Tools Blog, 2024-11-18&lt;/a&gt;); WorkOS reaches the same recommendation for any enterprise CLI (&lt;a href=&quot;https://workos.com/blog/pkce-vs-device-flow-cli-auth&quot;&gt;WorkOS, 2026-05-08&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The device grant&lt;/strong&gt; is the explicit fallback behind &lt;code&gt;--device&lt;/code&gt;, and the automatic choice when no browser can be launched. The CLI requests a device code, prints the verification URL and user code to stderr, polls the token endpoint at the returned interval, adds five seconds on &lt;code&gt;slow_down&lt;/code&gt;, keeps waiting on &lt;code&gt;authorization_pending&lt;/code&gt;, and fails cleanly on &lt;code&gt;expired_token&lt;/code&gt; or &lt;code&gt;access_denied&lt;/code&gt;. Because the user code is a bearer credential for that session, keep its lifetime to minutes, and expect some identity providers to block the grant by policy: detect that error and say so instead of polling to the deadline.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Workload identity&lt;/strong&gt; is the right answer for anything unattended. A CI runner or a pod already holds an identity token from its platform; exchange it for an access token at the identity provider&apos;s federation endpoint so no long-lived secret exists anywhere. Where that is unavailable, accept a token through &lt;code&gt;TRK_TOKEN&lt;/code&gt; or &lt;code&gt;--with-token&lt;/code&gt; on stdin, keep it short-lived, and document the retrieval command rather than the value. An agent never completes a device flow on its own: it has no one to hand the code to. If it reaches one, it prints the URL and code, exits with the authentication code, and reports that a person has to finish the login.&lt;/p&gt;
&lt;h3&gt;The command set&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;gh&lt;/code&gt; is the reference shape (&lt;a href=&quot;https://cli.github.com/manual/gh_auth_login&quot;&gt;gh auth login manual&lt;/a&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;trk auth login [--web | --device | --with-token] [--hostname &amp;lt;host&amp;gt;] [--scopes &amp;lt;s,...&amp;gt;]
trk auth status [--json]        # host, account, token source, scopes, expiry; never the token
trk auth token                  # the one sanctioned way to get the value out, for piping
trk auth refresh --scopes &amp;lt;s&amp;gt;   # widen scopes without a full re-login
trk auth logout                 # revoke the refresh token at the provider, then clear storage
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;login&lt;/code&gt; picks the flow by environment and lets a flag force it.&lt;/strong&gt; &lt;code&gt;--with-token&lt;/code&gt; reads stdin so the value never touches argv.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;status&lt;/code&gt; makes one cheap authenticated call&lt;/strong&gt; and reports which credential source is active: environment, file, or credential store. &quot;Which identity am I&quot; is the first question when something returns 403, so answer it in &lt;code&gt;--json&lt;/code&gt; too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;token&lt;/code&gt; prints the access token and nothing else to stdout&lt;/strong&gt;, refreshing first if it has expired. It exists so that &lt;code&gt;curl -H &quot;Authorization: Bearer $(trk auth token)&quot;&lt;/code&gt; works without the value being typed anywhere. Warn on stderr when stdout is a terminal.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;logout&lt;/code&gt; revokes at the provider&lt;/strong&gt; (&lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc7009&quot;&gt;RFC 7009&lt;/a&gt;), not just locally.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Storage, precedence, and scopes&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Store tokens in the system credential store&lt;/strong&gt; (Keychain, Secret Service, Windows Credential Manager). Fall back to a mode-600 file under the tool&apos;s config directory only with &lt;code&gt;--insecure-storage&lt;/code&gt; or a visible warning, and never into the config file that people commit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Store the refresh token, access token, expiry, scopes, and host together.&lt;/strong&gt; Refresh silently before expiry; when a refresh fails, exit with the authentication code and the login command.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Precedence is &lt;code&gt;TRK_TOKEN&lt;/code&gt;, then &lt;code&gt;--token-file&lt;/code&gt;, then the stored credential&lt;/strong&gt;, and &lt;code&gt;auth status&lt;/code&gt; says which one won.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Request the smallest default scope set.&lt;/strong&gt; An insufficient-scope error names the missing scope and prints &lt;code&gt;trk auth refresh --scopes &amp;lt;name&amp;gt;&lt;/code&gt; as the fix.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Register the CLI as a public client with no client secret.&lt;/strong&gt; A secret compiled into a distributed binary is not a secret.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discover endpoints from &lt;code&gt;&amp;lt;issuer&amp;gt;/.well-known/openid-configuration&lt;/code&gt;&lt;/strong&gt; rather than hardcoding them. With OIDC you also get an ID token: validate &lt;code&gt;iss&lt;/code&gt;, &lt;code&gt;aud&lt;/code&gt;, &lt;code&gt;exp&lt;/code&gt;, and &lt;code&gt;nonce&lt;/code&gt;, and use its &lt;code&gt;preferred_username&lt;/code&gt; or &lt;code&gt;email&lt;/code&gt; claim to make &lt;code&gt;auth status&lt;/code&gt; say who is logged in. Request &lt;code&gt;offline_access&lt;/code&gt; where the provider requires it for a refresh token.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A command that needs authentication and has none exits 6&lt;/strong&gt; with &quot;not logged in to &lt;a href=&quot;http://trk.example.com&quot;&gt;trk.example.com&lt;/a&gt;; run &lt;code&gt;trk auth login&lt;/code&gt; (interactive) or set TRK_TOKEN (scripts)&quot;. It never launches a login flow on its own when no terminal is present.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;A device-flow login in thirty lines&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;import sys, time, requests

ISSUER, CLIENT_ID = &quot;https://id.example.com&quot;, &quot;trk-cli&quot;   # public client: no secret
cfg = requests.get(f&quot;{ISSUER}/.well-known/openid-configuration&quot;).json()

r = requests.post(cfg[&quot;device_authorization_endpoint&quot;], data={
    &quot;client_id&quot;: CLIENT_ID, &quot;scope&quot;: &quot;openid offline_access trk.issues&quot;}).json()
print(f&quot;Open {r[&apos;verification_uri&apos;]} and enter code {r[&apos;user_code&apos;]}&quot;, file=sys.stderr)
if &quot;verification_uri_complete&quot; in r:
    print(f&quot;  or open {r[&apos;verification_uri_complete&apos;]}&quot;, file=sys.stderr)

interval, deadline = r.get(&quot;interval&quot;, 5), time.time() + r[&quot;expires_in&quot;]
while time.time() &amp;lt; deadline:
    time.sleep(interval)
    t = requests.post(cfg[&quot;token_endpoint&quot;], data={
        &quot;grant_type&quot;: &quot;urn:ietf:params:oauth:grant-type:device_code&quot;,
        &quot;device_code&quot;: r[&quot;device_code&quot;], &quot;client_id&quot;: CLIENT_ID}).json()
    if &quot;access_token&quot; in t:
        store(t)                      # credential store or a mode-600 file; never printed
        print(&quot;Logged in&quot;, file=sys.stderr)
        break
    if t[&quot;error&quot;] == &quot;slow_down&quot;:
        interval += 5
    elif t[&quot;error&quot;] != &quot;authorization_pending&quot;:
        die(6, f&quot;login failed: {t[&apos;error&apos;]}&quot;)      # expired_token, access_denied, or a policy block
else:
    die(6, &quot;login timed out; run `trk auth login --device` again&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Everything a person needs goes to stderr, the token goes to storage, and stdout stays empty so &lt;code&gt;trk auth login --device &amp;amp;&amp;amp; trk list --json&lt;/code&gt; composes.&lt;/p&gt;
&lt;h2&gt;The checklist&lt;/h2&gt;
&lt;p&gt;Run this against any CLI before calling it ready for agents. Every line is something a reviewer can verify in under a minute with the binary in front of them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Help&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-h&lt;/code&gt; and &lt;code&gt;--help&lt;/code&gt; work on every command, print to stdout, exit 0, and need no login or network&lt;/li&gt;
&lt;li&gt;every command has at least one example; every flag line shows its type, default, and environment variable&lt;/li&gt;
&lt;li&gt;exit codes are listed in help; an unknown command or flag gets a nearest-match suggestion&lt;/li&gt;
&lt;li&gt;replace-versus-append and state-transition semantics are stated on the flag line itself&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Errors&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;every error says what failed, why, and the exact fix, carries a stable code, and goes to stderr&lt;/li&gt;
&lt;li&gt;exit codes distinguish usage, not found, stale precondition, auth, and transient failures&lt;/li&gt;
&lt;li&gt;a schema or version mismatch is detected before any data is touched and named as such&lt;/li&gt;
&lt;li&gt;stack traces appear only under &lt;code&gt;--debug&lt;/code&gt; and are written to a file whose path is printed&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;stdout carries data only; &lt;code&gt;--json&lt;/code&gt; exists on every command, including mutations; the schema is versioned&lt;/li&gt;
&lt;li&gt;a non-terminal stdout disables color, spinners, pagers, and truncation; &lt;code&gt;NO_COLOR&lt;/code&gt; is honored&lt;/li&gt;
&lt;li&gt;every mutation prints the identifier and revision the next command will need&lt;/li&gt;
&lt;li&gt;no secret reaches either stream, including under &lt;code&gt;--debug&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Flags&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;precedence is flag, environment, config, default, documented once, visible via &lt;code&gt;config show --json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;secrets arrive by file, stdin, or credential store, never as an argument&lt;/li&gt;
&lt;li&gt;mutations take &lt;code&gt;--dry-run&lt;/code&gt;, &lt;code&gt;--yes&lt;/code&gt;, and &lt;code&gt;--if-revision&lt;/code&gt;; a parse failure has no side effects&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Non-interactive&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;without a terminal there are no prompts, no browser, no pager; a missing input names its flag&lt;/li&gt;
&lt;li&gt;every network call has a timeout; mutations are safe to repeat; SIGINT and SIGTERM exit cleanly&lt;/li&gt;
&lt;li&gt;&lt;code&gt;doctor --json&lt;/code&gt; exists and top-level help has a short paragraph for agents and scripts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Auth&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PKCE with a loopback redirect by default, &lt;code&gt;--device&lt;/code&gt; as the fallback, &lt;code&gt;--with-token&lt;/code&gt; on stdin&lt;/li&gt;
&lt;li&gt;&lt;code&gt;auth status&lt;/code&gt; names the identity and the credential source, never the token&lt;/li&gt;
&lt;li&gt;tokens live in the system credential store, refresh silently, and &lt;code&gt;logout&lt;/code&gt; revokes at the provider&lt;/li&gt;
&lt;li&gt;an unauthenticated non-interactive call exits with the auth code and the login command; it never starts a flow on its own&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;When I&apos;m reviewing a CLI, mine or someone else&apos;s, I no longer ask whether the help text is good. I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If the only things an agent ever sees are &lt;code&gt;--help&lt;/code&gt;, stdout, stderr, and the exit code, can it finish the job without guessing?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If the answer is &quot;it would need to know that &lt;code&gt;--notes&lt;/code&gt; replaces,&quot; or &quot;it would need to open a browser,&quot; or &quot;it would need to read the stack trace,&quot; then the tool has a human in the loop it hasn&apos;t admitted to. Fix the help line, the error, the flag, or the login flow, and the human gets the same improvement for free.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;References: &lt;a href=&quot;https://clig.dev/&quot;&gt;Command Line Interface Guidelines&lt;/a&gt; is the human-first baseline this extends. The auth section leans on &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8252&quot;&gt;RFC 8252&lt;/a&gt; (native apps and loopback redirects), &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8628&quot;&gt;RFC 8628&lt;/a&gt; (the device grant), &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc8693&quot;&gt;RFC 8693&lt;/a&gt; (token exchange), and &lt;a href=&quot;https://www.rfc-editor.org/rfc/rfc9700&quot;&gt;RFC 9700&lt;/a&gt; (the 2025 OAuth security best current practice). Related: &lt;a href=&quot;/notes/ignore-env-is-not-a-defense/&quot;&gt;&apos;Ignore .env&apos; is not a defense&lt;/a&gt; on why a secret&apos;s safety cannot rest on a sentence in a prompt, which is why the flag rules above refuse a secret in argv at all, and &lt;a href=&quot;/notes/a-mute-gate-is-worse-than-a-red-one/&quot;&gt;A mute gate is worse than a red one&lt;/a&gt; on why silence from a tool is the failure you don&apos;t get told about.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>cli</category><category>tooling</category><category>auth</category></item><item><title>My agents adapt to where they work in the codebase. Here’s how.</title><link>https://jedarden.com/notes/dynamic-context-with-agents-md/</link><guid isPermaLink="true">https://jedarden.com/notes/dynamic-context-with-agents-md/</guid><description>The same agent needs different instructions for a checkout form and a database migration. Here’s how I use AGENTS.md files to make that context follow the code.</description><pubDate>Fri, 09 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I want an agent changing a frontend component to think about keyboard behavior and design tokens. I want the same agent changing a database migration to think about existing data and whether the migration has already run. Those are different jobs, even when they happen in the same repository.&lt;/p&gt;
&lt;p&gt;My way of giving the agent that context is to put &lt;code&gt;AGENTS.md&lt;/code&gt; files at the places where the work changes. One at the root for the whole repository. Another in the frontend. Another in the backend. A more specific one around database work, if it needs its own rules.&lt;/p&gt;
&lt;p&gt;The agent gets shared instructions plus the instructions that apply to the part of the repo it is working in. &lt;strong&gt;The directory structure becomes part of how I write the prompt.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I call this “dynamic” context because the relevant combination changes with the work. The files themselves are ordinary Markdown, sitting beside the code they describe.&lt;/p&gt;
&lt;h2&gt;The repo is a map of the instructions&lt;/h2&gt;
&lt;p&gt;Here is a small example. The paths and rules below are illustrative; this is the arrangement I want readers to be able to copy into their own projects.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;app/
├── AGENTS.md                         shared repository rules
├── frontend/
│   ├── AGENTS.md                     interface and browser rules
│   └── Checkout.tsx
├── backend/
│   ├── AGENTS.md                     service and test conventions
│   ├── routes/
│   │   └── orders.ts
│   └── db/
│       ├── AGENTS.md                 migration rules
│       └── migrations/
│           └── 042_orders.sql
└── docs/
    ├── AGENTS.md                     documentation conventions
    └── setup.md
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For &lt;code&gt;frontend/Checkout.tsx&lt;/code&gt;, the relevant repository instructions are the root file and the frontend file. For &lt;code&gt;backend/db/migrations/042_orders.sql&lt;/code&gt;, they are the root file, the backend file, and the database file, in that order.&lt;/p&gt;
&lt;p&gt;The frontend file is a sibling of the backend subtree. Its rules do not govern the migration. And &lt;code&gt;routes/&lt;/code&gt; does not need an instruction file merely because it is a directory; it inherits the backend guidance.&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- vignette: context-stack --&amp;gt;&lt;/p&gt;
&lt;p&gt;Select a file in the visualization to see its applicable instructions assemble. The stack shows &lt;strong&gt;scope&lt;/strong&gt;: which guidance belongs to that file. It does not represent a live trace of a particular agent loading its prompt.&lt;/p&gt;
&lt;p&gt;The underlying rule is simple enough to write down:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Instructions for a file
  = shared guidance supplied by the environment
  + repo-root guidance
  + applicable ancestor-directory guidance, broadest to narrowest
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This gives me a place to put a fact once, at the level where it becomes true. A convention for every service belongs in the backend file. A constraint that only matters for migrations belongs closer to the migrations.&lt;/p&gt;
&lt;h2&gt;What I put in each layer&lt;/h2&gt;
&lt;p&gt;The root file establishes the working agreement for the repository. I keep it focused on things that should survive a move between directories: how to preserve compatibility, how to find the right checks, and how to discover more specific instructions before editing.&lt;/p&gt;
&lt;p&gt;For this example, the root could contain:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Repository working agreement

- Preserve public interfaces unless the task explicitly changes them.
- Default verification: run the relevant package&apos;s tests.
- Before editing a file, inspect applicable nested AGENTS.md files
  along its directory path. Follow their rules for that scope.
- Local files may replace a named default within their scope.
  Other applicable parent rules still apply.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That third instruction matters. It tells the agent to check the area it is about to touch, including when a task starts at the root and later moves into a subdirectory.&lt;/p&gt;
&lt;p&gt;In &lt;code&gt;frontend/AGENTS.md&lt;/code&gt;, I put the things that distinguish frontend work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Frontend

- Reuse the existing design tokens and components.
- Check changed interactions with a keyboard.
- Check the affected screen at a narrow viewport.
- Run the frontend package&apos;s tests after changing behavior.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In &lt;code&gt;backend/AGENTS.md&lt;/code&gt;, the emphasis changes:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Backend

- Keep route handlers thin; put business behavior in the service layer.
- For backend changes, replace the root verification default with
  backend unit tests. This is the default backend verification.
- Preserve documented response shapes unless the task changes them.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then &lt;code&gt;backend/db/AGENTS.md&lt;/code&gt; can be more specific still:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Database

- Treat applied SQL migrations as append-only. Add a new migration
  to change a schema that has already been deployed.
- For SQL migration changes, replace the backend unit-test default
  with the migration integration check against a disposable database.
- Verify both an empty database and an upgrade from the previous schema.
- If application code also changes, run its applicable checks too.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In a real repo, I put the actual commands and their working directories in these files. “Run the integration check” is enough to explain the example, but a worker needs to know which command that means and what success looks like. A command that relies on my memory is an unfinished instruction.&lt;/p&gt;
&lt;h2&gt;Concatenation needs scope and precedence&lt;/h2&gt;
&lt;p&gt;It is useful to picture the instruction files being concatenated into one prompt: the broad agreement first, followed by increasingly local guidance. But concatenation alone does not resolve an ambiguous instruction.&lt;/p&gt;
&lt;p&gt;In the database example, the local file names exactly what it replaces: the &lt;strong&gt;backend unit-test default for SQL migration changes&lt;/strong&gt;. The root requirement to preserve public interfaces still applies. So does the requirement to check changed application code when the task touches it.&lt;/p&gt;
&lt;p&gt;I prefer an explicit replacement like that to two disconnected commands that happen to disagree. It lets both a human and an agent explain why the verification plan changed.&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;context-scope-table&quot; role=&quot;region&quot; aria-label=&quot;Instruction scope comparison, scroll horizontally on small screens&quot; tabindex=&quot;0&quot;&amp;gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File being changed&lt;/th&gt;
&lt;th&gt;Applicable repository files&lt;/th&gt;
&lt;th&gt;Resulting behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;frontend/Checkout.tsx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Root → frontend&lt;/td&gt;
&lt;td&gt;Reuse UI conventions; check keyboard behavior and narrow screens.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backend/routes/orders.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Root → backend&lt;/td&gt;
&lt;td&gt;Keep the handler thin; preserve response contracts; run backend unit tests.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backend/db/migrations/042_orders.sql&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Root → backend → database&lt;/td&gt;
&lt;td&gt;Add a migration; use the migration integration check for the SQL change.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;docs/setup.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Root → docs&lt;/td&gt;
&lt;td&gt;Verify the commands and provide runnable examples.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;These are instructions within the task&apos;s existing authority. A local file cannot grant permission the agent does not have, or make a repository convention outrank a higher-priority instruction from its environment.&lt;/p&gt;
&lt;h2&gt;Watch the work move through the repo&lt;/h2&gt;
&lt;p&gt;Imagine a task to add an order field. It might touch the checkout form, an API handler, the database schema, and the setup documentation.&lt;/p&gt;
&lt;p&gt;The root agreement applies throughout. Each move brings a different set of local concerns into play. The frontend guidance explains how to check the form. The backend guidance explains where the service behavior belongs. The database guidance adds the upgrade path. The documentation guidance makes the examples usable.&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- vignette: context-walk --&amp;gt;&lt;/p&gt;
&lt;p&gt;Play the walkthrough, or step through one file at a time. Watch the shared layer stay in place while the applicable local layers change. Moving deeper into the database subtree adds another layer; moving across to documentation selects a different branch.&lt;/p&gt;
&lt;p&gt;For a task that crosses all four areas, I expect all four areas&apos; checks to be accounted for. The last file edited does not define the rules for the entire change. Each changed file keeps its scope, and the final verification plan covers the combined work.&lt;/p&gt;
&lt;p&gt;Nor does a change of scope mean the model forgets text it has already read. Instructions can remain in the conversation while ceasing to apply to the next file. That is why I make their boundaries explicit.&lt;/p&gt;
&lt;h2&gt;What the agent actually loads&lt;/h2&gt;
&lt;p&gt;There is one implementation detail to get right before relying on this pattern. &lt;strong&gt;Instruction scope and automatic discovery are separate things.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Codex documents its initial discovery as a chain built once per run: global guidance, then files along the path from the project root to the current working directory. It includes at most one instruction file per directory, with &lt;code&gt;AGENTS.override.md&lt;/code&gt; taking precedence over &lt;code&gt;AGENTS.md&lt;/code&gt; at that level. The project instruction budget defaults to 32 KiB. Starting in a deeper directory changes that initial chain. Simply mentioning a deeply nested file from a root session does not mean that initial discovery traverses its path. &lt;a href=&quot;https://learn.chatgpt.com/docs/agent-configuration/agents-md&quot;&gt;Official AGENTS.md documentation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That is why my root guidance also tells the agent to inspect applicable nested files before editing. I treat automatic startup loading and deliberate inspection during the task as two parts of the setup. I verify both in the agent environment I am using.&lt;/p&gt;
&lt;p&gt;“They become the system prompt” is a convenient shorthand for the effect, but &lt;strong&gt;combined instruction context&lt;/strong&gt; is more precise. OpenAI&apos;s prompting guide describes the discovered &lt;code&gt;AGENTS.md&lt;/code&gt; chunks as user-role messages injected into the conversation in root-to-leaf order. They are not a replacement for the model&apos;s underlying system instructions. &lt;a href=&quot;https://developers.openai.com/cookbook/examples/gpt-5/codex_prompting_guide#using-agentsmd&quot;&gt;Official Codex prompting guide&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Other agent tools can use different filenames and loading rules. I check those rules before assuming this directory layout is sufficient on its own. I use the exact filename &lt;code&gt;AGENTS.md&lt;/code&gt; where that is the supported convention.&lt;/p&gt;
&lt;h2&gt;How I decide where a file belongs&lt;/h2&gt;
&lt;p&gt;I add an instruction file at a boundary where the agent&apos;s decisions should change. A package with different test commands is a good candidate. So is a directory containing generated code, a compatibility-sensitive interface, or schema migrations.&lt;/p&gt;
&lt;p&gt;I do not need a file in every directory. If a child file would repeat its parent, inheritance already does the job. If a child needs a paragraph of exceptions to every parent rule, I reconsider whether the parent is claiming too much scope.&lt;/p&gt;
&lt;p&gt;My test for an instruction is concrete: &lt;strong&gt;what would the agent do differently after reading this?&lt;/strong&gt; “Write good code” has no useful answer. “Preserve this response shape because older clients still consume it” does. So does “edit the schema source and regenerate this directory.”&lt;/p&gt;
&lt;p&gt;I keep these files with the code and update them when the workflow changes. If I replace the test runner, the test command changes in the same work. If a constraint stops being true, I remove it. Stale instructions are executable-looking misinformation.&lt;/p&gt;
&lt;p&gt;The instructions also need to fit the available context. Splitting one huge file into several huge files along the same path still creates a huge stack. I keep the standing rules short and point to deeper references when the task needs them.&lt;/p&gt;
&lt;h2&gt;Verify the setup with a real task&lt;/h2&gt;
&lt;p&gt;I packaged this workflow as &lt;a href=&quot;https://github.com/jedarden/setup-repo-context&quot;&gt;setup-repo-context&lt;/a&gt;, an MIT-licensed skill you can &lt;a href=&quot;https://github.com/jedarden/setup-repo-context/archive/refs/tags/v0.1.0.zip&quot;&gt;download as a versioned ZIP&lt;/a&gt;. It asks the agent to derive instruction boundaries from your repository, preserve existing rules, and show the resulting behavior for representative files and a task that crosses scopes. The repository includes installation instructions; use &lt;code&gt;$setup-repo-context&lt;/code&gt; after installing it.&lt;/p&gt;
&lt;p&gt;To try this in a repository, I would start with this prompt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Inspect this repository and its existing agent instructions. Find the
boundaries where the work needs different guidance: test commands,
compatibility constraints, generated files, or data migrations.

Propose the smallest useful set of scoped AGENTS.md changes. Use rules
supported by the code and documented workflow; flag anything uncertain.
Preserve existing instructions and avoid repeating parent rules.

For a representative file in each scope, show the applicable instruction
chain, any explicitly replaced defaults, and the checks you would run.
Also explain how my agent discovers those files during a task.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Before trusting the arrangement, I give the agent a small task in each important area and ask it to identify the applicable instruction files and the checks it will run before it edits anything.&lt;/p&gt;
&lt;p&gt;For the migration example, I should be able to see the root, backend, and database guidance reflected in its plan. The meaningful result is a new migration and the right upgrade check. An agent reciting three filenames and then editing an applied migration has not passed the test.&lt;/p&gt;
&lt;p&gt;I also try a task that crosses a directory boundary. That tests whether the agent discovers the next area&apos;s instructions, rather than assuming the context it started with is sufficient for everything it will touch.&lt;/p&gt;
&lt;p&gt;This setup gives me a practical way to make context travel with the code. The shared expectations stay at the root. The specialized knowledge lives where it becomes relevant. When I want to change how agents work in one part of the repository, I have a small, reviewable file to change beside it.&lt;/p&gt;
</content:encoded><category>agents</category><category>context</category><category>workflow</category></item><item><title>A mute gate is worse than a red one</title><link>https://jedarden.com/notes/a-mute-gate-is-worse-than-a-red-one/</link><guid isPermaLink="true">https://jedarden.com/notes/a-mute-gate-is-worse-than-a-red-one/</guid><description>Every verification gate is designed for two states: green and red. The dangerous one is the third — a gate that produces no verdict at all. My CI started twenty-five builds in a day and finished none, and a flaky gate froze 36 tasks behind work that was already done. Red is information. Silence is the failure you don&apos;t get told about.</description><pubDate>Thu, 24 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The dashboard said nothing was wrong, and it was right in the most useless way possible. My fleet&apos;s CI hadn&apos;t failed a single build all day. It also hadn&apos;t passed one. It had started twenty-five and finished none.&lt;/p&gt;
&lt;p&gt;Every gate you build is designed around two states. Green means go; red means stop and look. Both are &lt;em&gt;verdicts&lt;/em&gt; — a claim about a specific commit, which somebody can act on. There&apos;s a third state nobody designs for, because it doesn&apos;t look like a state at all: the gate that says nothing. No red, no green, no error. Just a run list full of builds that were started and never concluded.&lt;/p&gt;
&lt;p&gt;I&apos;ve started calling this a &lt;strong&gt;mute gate&lt;/strong&gt;, and I&apos;ve come to believe it&apos;s strictly worse than a red one. A red gate is a problem you&apos;ve been told about. A mute gate is a problem that looks exactly like &quot;fine.&quot;&lt;/p&gt;
&lt;h2&gt;Twenty-five builds, zero verdicts&lt;/h2&gt;
&lt;p&gt;The setup was ordinary. A build on that repo takes 18 to 29 minutes. The fleet — twenty-odd headless coding agents pushing to the same &lt;code&gt;main&lt;/code&gt; — lands a commit every 2 to 8 minutes during working hours.&lt;/p&gt;
&lt;p&gt;A week earlier I&apos;d fixed a real problem: stale builds. Six of them had burned between 30 and 82 minutes each testing commits that were already obsolete by the time they started. So I added the most standard setting in CI, the one GitHub Actions exposes as &lt;code&gt;cancel-in-progress: true&lt;/code&gt;: when a newer commit arrives, kill the build that&apos;s running for the older one. Test the latest code, not history. Every CI system offers some version of it, and every one I&apos;ve used makes it look like pure hygiene.&lt;/p&gt;
&lt;p&gt;Do the arithmetic I didn&apos;t do. If a build takes 24 minutes and a push arrives every 5, a build only finishes if the fleet happens to go quiet for 24 straight minutes. During working hours, it never did. Each push killed the build in flight, started a new one, and that one was killed by the next push. Twenty-five builds, every one of them superseded a third of the way through.&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- vignette: mute-gate-starvation --&amp;gt;&lt;/p&gt;
&lt;p&gt;The part that should worry you is how normal this looked from the outside. A superseded build isn&apos;t a failed build. It shows up as &lt;em&gt;stopped&lt;/em&gt; — in my case, exit code 143, which is just SIGTERM, the process being told to go away. Nothing turned red. Nothing paged. The run list was a column of builds that started, ran a while, and quietly ended, which is also what a healthy pipeline looks like when you glance at it between other things.&lt;/p&gt;
&lt;h2&gt;It doesn&apos;t degrade. It falls off a cliff.&lt;/h2&gt;
&lt;p&gt;The intuition that got me here was that cancelling stale builds costs a little throughput and saves a lot of waste — a gentle trade. The math says otherwise, and the shape of it is worth seeing.&lt;/p&gt;
&lt;p&gt;Say pushes arrive at random, averaging one every &lt;em&gt;I&lt;/em&gt; minutes, and a build takes &lt;em&gt;D&lt;/em&gt;. Under cancel-in-progress, a build finishes only if no push lands during its entire run. For random arrivals the chance of that is &lt;em&gt;e&lt;/em&gt;^(−D/I). At my numbers — &lt;em&gt;D&lt;/em&gt; = 24, &lt;em&gt;I&lt;/em&gt; ≈ 5 — that&apos;s &lt;em&gt;e&lt;/em&gt;^(−4.8): &lt;strong&gt;0.8% of builds finish, about one verdict every ten hours.&lt;/strong&gt; In practice it was worse, because pushes come in bursts during the day: none, all day.&lt;/p&gt;
&lt;p&gt;Now change one word in the policy. &lt;strong&gt;Cancel pending instead of in-progress:&lt;/strong&gt; a build that has started always finishes; a newer push replaces a &lt;em&gt;queued&lt;/em&gt; build that hasn&apos;t started yet, which costs nothing because no work was done. The gate now produces one verdict per build, back to back, whenever there&apos;s anything to test: at my numbers, about one every 24 minutes. Same pushes, same builds, same cluster. The difference is one policy word, and it&apos;s about twenty-five times more verdicts.&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- vignette: mute-gate-cliff --&amp;gt;&lt;/p&gt;
&lt;p&gt;The cancel-in-progress curve peaks where pushes arrive exactly as often as builds take, and below that it doesn&apos;t decline gracefully — it collapses exponentially. Anything that raises your push rate walks you down that curve: more agents, more active hours, smaller commits (which is otherwise good advice). The dangerous property is that nothing about the gate itself tells you which side of the peak you&apos;re on. It just goes quiet.&lt;/p&gt;
&lt;h2&gt;Why mute is worse than red&lt;/h2&gt;
&lt;p&gt;A red gate is a message. It names a commit, a test, a line number. It&apos;s annoying, and it&apos;s &lt;em&gt;useful&lt;/em&gt;: somebody looks, something gets fixed, and in the meantime everyone knows not to trust &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A mute gate sends no message, and the absence of a message reads as good news. Nobody investigates silence. And an unattended fleet reads silence the same way a human does, only faster. During the stretch that CI was muted, &lt;strong&gt;575 commits landed with the definition-of-done check bypassed&lt;/strong&gt;, and &lt;strong&gt;no release was cut for twelve days&lt;/strong&gt;. Every individual bypass was locally reasonable — the gate wasn&apos;t going to say anything either way, so why wait on it? Twelve days of reasonable decisions add up to a codebase nobody has actually verified.&lt;/p&gt;
&lt;p&gt;There&apos;s a second way to go mute, and it starts red. A few weeks earlier the same CI had been red for 36 hours because one test deadlocked and timed out on every run. A red gate that &lt;em&gt;stays&lt;/em&gt; red stops carrying information too: it can&apos;t distinguish &quot;my commit is fine&quot; from &quot;I just broke something,&quot; so it gets ignored for the same reason a mute one does. About 225 commits landed with the pre-commit check skipped. When the deadlock was fixed, 78 tests had drifted underneath it, and within the hour &lt;code&gt;main&lt;/code&gt; stopped compiling outright. A gate that&apos;s always red is mute with extra steps.&lt;/p&gt;
&lt;h2&gt;The flaky gate: failing work that&apos;s already done&lt;/h2&gt;
&lt;p&gt;The third variety is the most insidious, because it &lt;em&gt;does&lt;/em&gt; produce verdicts. They just aren&apos;t about your code.&lt;/p&gt;
&lt;p&gt;My fleet runs a definition-of-done gate after every task: the agent does the work, and the gate decides whether it counts. On one repo, on one day, &lt;strong&gt;18 of 66 attempts were released as gate failures — about 27% of that repo&apos;s spend.&lt;/strong&gt; One task in particular failed eight times over three rounds and was automatically quarantined. Thirty-six of the repo&apos;s 41 open tasks depended on it. The ready queue emptied: the only things left were the quarantined task and a few waiting on humans. A fleet with literally nothing to claim.&lt;/p&gt;
&lt;p&gt;The task&apos;s work had been finished four times over. The code was committed on &lt;code&gt;main&lt;/code&gt;. Its acceptance tests passed. All fifteen subtasks it had been split into were closed. Every one of those eight failures was the gate, not the work — two flaky tests in an unrelated part of the suite:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A small test HTTP server inherited its standard library&apos;s default listen backlog of &lt;strong&gt;5&lt;/strong&gt;, while its own contract test opened &lt;strong&gt;32&lt;/strong&gt; simultaneous connections. When the accept queue overflowed, clients saw connection resets. Sometimes.&lt;/li&gt;
&lt;li&gt;A test asserted on a log line that the handler writes &lt;em&gt;after&lt;/em&gt; sending the response. The client usually got there second. Sometimes it got there first, and the count read 0 instead of 1.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;lt;!-- vignette: mute-gate-quarantine --&amp;gt;&lt;/p&gt;
&lt;p&gt;A flaky gate is a mute gate wearing a red costume. Its verdict carries information about timing and luck, not about the commit under test. And it conceals itself in a way the other two don&apos;t: during the incident, a &quot;fix the build&quot; task was raised and then closed as &lt;em&gt;no change needed, main already passes&lt;/em&gt; — because the flake happened to pass on the run that checked. One green run is not evidence about a flake. It&apos;s a coin that happened to land heads.&lt;/p&gt;
&lt;h2&gt;What I run now&lt;/h2&gt;
&lt;p&gt;None of these fixes is clever. They all follow from one idea: &lt;strong&gt;a gate&apos;s product is a verdict, so measure the verdicts, not the colours.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Alert on silence, not just on red.&lt;/strong&gt; The most important number about a gate isn&apos;t its pass rate — it&apos;s the time since it last produced a verdict &lt;em&gt;under its own power&lt;/em&gt;. A cancelled build isn&apos;t evidence the gate can finish anything, so it doesn&apos;t reset the clock. When that clock passes a threshold, that&apos;s an incident, even though nothing is red.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cancel pending, never in-progress.&lt;/strong&gt; Queued builds can be superseded freely; a started build finishes. And as a belt with those braces, a starvation guard: if nothing has finished under its own power in the last 45 minutes, supersede nothing on this pass. If there&apos;s no evidence the gate can complete, don&apos;t assume it can.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Red is a stop-the-line event.&lt;/strong&gt; When a gate goes red and stays red, restoring green is the first task, not a side quest, and pushes to that repo pause until it&apos;s done. Fixing drifted tests while the fleet keeps pushing on top of them is bailing out a boat with the tap still running.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Treat flake rate as a throughput tax — and prove fixes by repetition.&lt;/strong&gt; Don&apos;t diagnose a flake by re-running until it&apos;s green. Force the race: shrink the queue, inject the delay in the late writer, and show that the old code fails &lt;em&gt;every time&lt;/em&gt; and the new code passes. Then prove it with a streak — I use fifteen consecutive green runs of the full gate, and I report the count. One green proves nothing about a flake, which is exactly how the flake survived the first time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When finished work keeps failing, suspect the gate first.&lt;/strong&gt; A task that cycles with &quot;verified success&quot; from the agent and &quot;gate failed&quot; from the harness is telling you where the problem is. Read the attempt history before you re-dispatch, split, or rewrite the task. Otherwise you spend another round rediscovering that the work was done.&lt;/p&gt;
&lt;h2&gt;Same failure, one laptop&lt;/h2&gt;
&lt;p&gt;None of this needs a fleet. You&apos;ve probably built a mute gate at your own desk.&lt;/p&gt;
&lt;p&gt;A test watcher that restarts on every save is cancel-in-progress with a file watcher. If your suite takes 40 seconds and you save every 15, it never finishes — and you&apos;ll read the absence of red output as &quot;tests are passing.&quot; The same goes for an agent session: ask an agent to run a long suite with a short timeout and it will come back saying the tests &quot;are running&quot; or &quot;look good so far.&quot; That&apos;s not a verdict. It&apos;s the agent &lt;a href=&quot;/notes/dont-let-the-agent-grade-its-own-homework/&quot;&gt;grading its own homework&lt;/a&gt; on a test that never finished.&lt;/p&gt;
&lt;p&gt;Scale changes the cost, not the shape. On a laptop a mute gate wastes an afternoon. Across &lt;a href=&quot;/notes/what-breaks-at-twenty-agents/&quot;&gt;twenty unattended workers&lt;/a&gt; it wastes twelve days and five hundred commits — because a fleet doesn&apos;t wait for a verdict that isn&apos;t coming. It builds on top of the silence.&lt;/p&gt;
&lt;h2&gt;The question I ask now&lt;/h2&gt;
&lt;p&gt;When a gate hasn&apos;t bothered me in a while, I no longer take that as good news. I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When did this gate last actually say something?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the answer is &quot;twenty minutes ago, it passed,&quot; good — that&apos;s a gate. If the answer is &quot;I&apos;m not sure,&quot; or &quot;it&apos;s been red since Tuesday,&quot; or &quot;it passed once, on the retry,&quot; then what I have isn&apos;t a gate. It&apos;s a decoration on the pipeline, and everything that has merged past it since then is unverified.&lt;/p&gt;
&lt;p&gt;Red is a problem you&apos;ve been told about. Build your gates so that silence is one too.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Related: &lt;a href=&quot;/notes/dont-let-the-agent-grade-its-own-homework/&quot;&gt;Don&apos;t let the agent grade its own homework&lt;/a&gt; — why &quot;done&quot; needs an independent verdict in the first place. And &lt;a href=&quot;/notes/trust-is-a-property-of-the-system/&quot;&gt;Trust is a property of the system, not the agent&lt;/a&gt; — the same argument about safety: build the check into the system instead of relying on someone to notice.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>fleet-ops</category><category>ci</category><category>verification</category></item><item><title>&apos;Ignore .env&apos; is not a defense</title><link>https://jedarden.com/notes/ignore-env-is-not-a-defense/</link><guid isPermaLink="true">https://jedarden.com/notes/ignore-env-is-not-a-defense/</guid><description>A worker once obeyed every rule about secrets and still pasted a live token into a notes file, twice, and committed it. The rule it had was a sentence in a prompt. What I run now is a stack of controls that hold even when the model doesn&apos;t — identity, scope, transport, proof, and a hook — none of them foolproof, all of them more than a wish.</description><pubDate>Sat, 29 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The worker had a rule about secrets, and it followed the rule. It was verifying a GitHub token — did the scopes cover what the task needed — and it did that correctly: fetched the token the sanctioned way, checked it, got the right answer. Then it wrote up what it had done in a markdown notes file, and in the write-up, where it meant to record &lt;em&gt;how to obtain the token&lt;/em&gt;, it recorded the token. Twice. Then it committed the file.&lt;/p&gt;
&lt;p&gt;A pre-receive hook on the git server caught it before the file reached the public mirror. That hook is the only reason this note is about a rotated credential instead of a leaked one.&lt;/p&gt;
&lt;p&gt;What matters is that the worker was not careless. It never touched a &lt;code&gt;.env&lt;/code&gt; file. It never printed a secret to the terminal on purpose. It did something more ordinary and much harder to forbid: it conflated &quot;document the token&quot; with &quot;document how to get the token,&quot; and the two sentences are one clipboard apart. Every rule I had at the time was a paragraph telling the model to be careful. The model was careful. The token went into the file anyway.&lt;/p&gt;
&lt;h2&gt;The rule was a wish&lt;/h2&gt;
&lt;p&gt;The standard defense — the one in nearly every agent setup I&apos;ve seen, and the one I had — is a line in the system prompt: &lt;em&gt;never read &lt;code&gt;.env&lt;/code&gt;; never print secrets.&lt;/em&gt; Some harnesses go further and make the file unreadable by the agent entirely. That&apos;s fine as far as it goes, and it goes about a foot.&lt;/p&gt;
&lt;p&gt;It protects one location. Secrets don&apos;t live in one location. They come back from &lt;code&gt;gh auth token&lt;/code&gt;, from a Kubernetes Secret you were told to describe, from a custom resource&apos;s &lt;code&gt;.status&lt;/code&gt;, from the environment of a process you were debugging. The agent reaches all of those legitimately, in the course of doing the job you gave it, and the instruction about &lt;code&gt;.env&lt;/code&gt; has nothing to say about any of them. The rule guards a door in a room with no walls.&lt;/p&gt;
&lt;p&gt;The deeper problem is where the damage actually happens. When an agent leaks a secret, the secret doesn&apos;t leak &lt;em&gt;from&lt;/em&gt; the store. It leaks &lt;em&gt;into&lt;/em&gt; the transcript — the command line it typed (captured in the session log, in shell history, in &lt;code&gt;ps&lt;/code&gt;), the tool output it read back, the file it wrote, the commit message, the ticket, the chat turn. Every one of those is logged, cached, and unrecallable. Once a value has been text the agent produced, it&apos;s gone, and no amount of deleting the file gets it back.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A secret isn&apos;t safe from an agent because the agent can&apos;t &lt;em&gt;read&lt;/em&gt; it. It&apos;s safe because the agent can&apos;t &lt;em&gt;say&lt;/em&gt; it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That reframe changes what you build. You stop trying to hide values from the model and start making sure that a value, on its way from wherever it lives to wherever it&apos;s needed, never passes through anything the model can see. The store isn&apos;t the thing you&apos;re protecting. The transcript is.&lt;/p&gt;
&lt;h2&gt;What I run instead&lt;/h2&gt;
&lt;p&gt;None of what follows is exotic. It&apos;s the ordinary discipline any secrets store expects of a service account, applied without exception to a very talkative kind of service account. Each layer catches a different way the wish failed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The agent has its own identity, never a borrowed one.&lt;/strong&gt; The old setup had a root token for the vault sitting in a dotfile on the agent&apos;s workstation, because that&apos;s what was there when the agent first needed access. Now the workstation agent logs in with its own AppRole and gets a token that lives an hour. Agents running inside the cluster authenticate by their Kubernetes ServiceAccount and get ten- to twenty-minute tokens. Humans come in on a completely separate path, through SSO. Compromising the human path can&apos;t mint an agent token; compromising an agent can&apos;t log in as a human. Nothing eternal exists for anyone to steal.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scope is a prefix, not a role.&lt;/strong&gt; The agent&apos;s policy names exactly the path prefix it&apos;s allowed to write — its own cluster&apos;s secrets — and nothing outside it. Each automated writer in the cluster gets exactly the prefix it produces, and none of them can read what another one writes. Even the deliberately powerful superuser policy carries two explicit denials: it cannot disable the audit device, and it cannot seal the store. An identity that can switch off its own ledger voids the ledger, so that capability is carved out before anything else is granted.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Values travel by pipe, &lt;code&gt;@file&lt;/code&gt;, or stdin — never as an argument.&lt;/strong&gt; This is the rule that does the most work, and it&apos;s the one that&apos;s easiest to state: a credential never appears in &lt;code&gt;argv&lt;/code&gt;. A new password is generated and stored in one line — &lt;code&gt;openssl rand -base64 32 | bao kv put secret/app/db password=-&lt;/code&gt; — and the plaintext never exists as a literal anywhere. A value that has to move between two stores goes through a single-use &lt;em&gt;wrapping token&lt;/em&gt; and a pipe: unwrap on one side, write on the other, nothing in between. When a value has to land on disk for a tool to read, it goes into a mode-600 file the agent redirects into and never &lt;code&gt;cat&lt;/code&gt;s. The login wrapper itself passes its own credentials as &lt;code&gt;@file&lt;/code&gt; so that even authenticating doesn&apos;t put a value on a command line.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Every proof is by property, never by value.&lt;/strong&gt; This is the layer that took me longest to see, because it&apos;s a restriction on the &lt;em&gt;check&lt;/em&gt;, not on the action. &quot;Confirm the write worked&quot; naturally becomes &quot;read it back and look,&quot; and reading it back is the leak. So the sanctioned proofs are all things that demonstrate the value without showing it: the secret&apos;s version counter incremented; the consumer that syncs from the store reports &lt;code&gt;Ready&lt;/code&gt;; the content hash on the delivered object is unchanged from before; a token was revoked by its &lt;em&gt;accessor&lt;/em&gt; — the handle, not the value. If a check would need to print the thing to succeed, the check is wrong.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The rule is enforced by a hook, not a paragraph.&lt;/strong&gt; A pre-tool hook inspects every file write, every edit, and every shell command before it runs, and refuses any that carry a high-signal credential shape — a GitHub token, a Slack token, a PEM block — in &lt;em&gt;any&lt;/em&gt; file type, because the real leak went into a &lt;code&gt;.md&lt;/code&gt;. It doesn&apos;t matter whether the model thought the value was a placeholder. It matters whether it matches. The same shapes are refused on the way into git by the server-side hook that caught the original leak, so there are two independent detectors between an agent&apos;s slip and the public internet.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Writes can&apos;t silently clobber each other.&lt;/strong&gt; Every write to the store carries a check-and-set version. When two agents — or an agent and a scheduled job — race on the same path, the loser gets a 400 and retries next cycle, instead of overwriting a value nobody knew had changed. This one isn&apos;t about leaks at all; it&apos;s about the other way agents make secrets unsafe, which is by quietly making them wrong.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;There&apos;s a ledger, and the agent can&apos;t turn it off.&lt;/strong&gt; Every operation against the store is audited. When something looks wrong later, the question &quot;which identity did what, when&quot; has an answer that doesn&apos;t depend on the agent&apos;s own account of events.&lt;/p&gt;
&lt;h2&gt;What it bought&lt;/h2&gt;
&lt;p&gt;Once these held, I did something I would not have done a month earlier: I granted the agents read &lt;em&gt;and write&lt;/em&gt; access to the secrets store, as a standing policy, not a break-glass exception.&lt;/p&gt;
&lt;p&gt;Nine days later, one of them migrated the entire store. Every secret the cluster depended on moved from an old vault to a hardened one — hundreds of paths, all verified by comparing hashes on both sides. Forty-odd consumers were re-pointed at the new store in waves, each wave proven by an unchanged content hash on the delivered secrets and zero restarted pods. The old vault&apos;s root tokens were found and revoked by accessor. Peer credentials were delivered by wrapping token and pipe. The old instance was frozen, exported, and decommissioned.&lt;/p&gt;
&lt;p&gt;At no point in that entire operation did a secret value appear in the transcript. Not because the agent was told to be careful — because there was no path through which a value &lt;em&gt;could&lt;/em&gt; have appeared, and every proof of success was designed to work without one. The agent did the most sensitive job on the estate under exactly the conditions where I&apos;d have least wanted a human doing it by hand: hundreds of repetitive, high-stakes copy operations at the end of a long day.&lt;/p&gt;
&lt;h2&gt;What it doesn&apos;t do&lt;/h2&gt;
&lt;p&gt;I want to be exact about the word &lt;em&gt;safer&lt;/em&gt;, because it&apos;s the word, not &lt;em&gt;safe&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The hook fails open.&lt;/strong&gt; If it can&apos;t parse its input, it allows the call. A rule that fails closed would block the agent on every malformed edge case, and a blocked agent gets worked around. So the hook catches the common slip, and the rule still binds the agent regardless of whether the hook fires.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The hook can&apos;t see output.&lt;/strong&gt; It inspects what the agent writes and what it runs — not what comes back. An agent that greps a process&apos;s environment and reads the result has put a value in the transcript, and nothing mechanical stopped it. The defense there is the reflex: presence-check, never print. &lt;code&gt;wc -c&lt;/code&gt;, &lt;code&gt;md5sum&lt;/code&gt;, &quot;does this key exist&quot; — never the value.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Truncation is not redaction.&lt;/strong&gt; I once watched an agent avoid dumping a token by piping it through &lt;code&gt;head -c 100&lt;/code&gt;. The base64 token was 110 characters long. Nearly all of it printed. The rule needs an operator who understands &lt;em&gt;why&lt;/em&gt; it exists, because a model applying it as a ritual will find a way to satisfy the letter and lose the point.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The audit ledger lives in the same trust domain as the store.&lt;/strong&gt; An attacker who owns the cluster owns the ledger. The append-only, off-site copy that would fix that is designed and not built; I looked at the cost of a locked bucket in a cloud project I don&apos;t otherwise use and decided the risk of a runaway bill outweighed the risk I was protecting against, for now. That&apos;s a real gap, and I&apos;d rather name it than let the rest of this note imply it&apos;s closed.&lt;/p&gt;
&lt;p&gt;So: not foolproof. But every one of those gaps is a &lt;em&gt;known&lt;/em&gt; gap with a known shape, which is a different situation from a sentence in a prompt and a hope.&lt;/p&gt;
&lt;h2&gt;Two scales, one rule&lt;/h2&gt;
&lt;p&gt;By hand, in an interactive session, the rule is a reflex: you type the pipe instead of the value, you ask &quot;would this check have to print the thing to pass,&quot; you catch the agent reaching for &lt;code&gt;head -c&lt;/code&gt; and explain why that isn&apos;t enough. It&apos;s the same posture as &lt;a href=&quot;/notes/dont-let-the-agent-grade-its-own-homework/&quot;&gt;refusing to let the agent grade its own homework&lt;/a&gt;, pointed at the one domain where even a &lt;em&gt;correct&lt;/em&gt; check is forbidden if it shows its work.&lt;/p&gt;
&lt;p&gt;At fleet scale, where no human is reading the transcript as it happens, the reflex has to become structure: the identity is scoped by the store, the value is refused by the hook, the proof-by-property is written into the task&apos;s acceptance criteria before the task is dispatched. Nothing about the rule changes. What changes is who — or what — is holding it.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I hand an agent anything that touches a credential, I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What would the agent have to &lt;em&gt;see&lt;/em&gt; to prove this worked?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the answer is &quot;the value,&quot; the check is wrong — and usually the task description is too. If the answer is a version number, a &lt;code&gt;Ready&lt;/code&gt; condition, a hash, an accessor, the agent can proceed, and I can stop watching. Not because I trust it to be careful. Because there&apos;s nothing on the path for it to be careless with.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Background: &lt;a href=&quot;/notes/trust-is-a-property-of-the-system/&quot;&gt;Trust is a property of the system, not the agent&lt;/a&gt; — the general case: an agent doesn&apos;t need to be trusted, an action needs to be cheap to be wrong about. A leaked secret is the action that isn&apos;t, which is why it gets its own stack. And &lt;a href=&quot;/notes/dont-let-the-agent-grade-its-own-homework/&quot;&gt;Don&apos;t let the agent grade its own homework&lt;/a&gt; — independent verification, here with the extra constraint that the verifier is forbidden from looking.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Code: &lt;a href=&quot;https://github.com/jedarden/utilities/tree/agent-secrets/v0.1.0/agent-secrets&quot;&gt;utilities/agent-secrets&lt;/a&gt; — the credential-guard hook, the &lt;code&gt;bao-as&lt;/code&gt; wrapper, and the prefix-scoped policies from this note, with tests and an installer.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>safety</category><category>secrets</category><category>collaboration</category></item><item><title>Don&apos;t be the meat proxy</title><link>https://jedarden.com/notes/dont-be-the-meat-proxy/</link><guid isPermaLink="true">https://jedarden.com/notes/dont-be-the-meat-proxy/</guid><description>A meat proxy is a human acting as the cable between two systems, copy-pasting output from one into the other. Why it&apos;s the worst link in an agent workflow, and what to build instead.</description><pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The agent needed to know how a page rendered on my phone. So I picked up the phone, looked at it, and typed a description into the chat. The agent asked a follow-up — was the banner above the fold or below it? I picked the phone back up. Somewhere around the third round trip I understood what my role in this system actually was: two computers were having a conversation about a rendering bug, and I was the cable.&lt;/p&gt;
&lt;p&gt;The name for this is the &lt;strong&gt;meat proxy&lt;/strong&gt;. &lt;a href=&quot;https://gruhn.me/blog/2026-08-03/&quot;&gt;Niklas Gruhn coined it&lt;/a&gt; in August 2026 for a narrower habit — answering a colleague&apos;s question by pasting an AI&apos;s reply back at them, word for word — and I&apos;m borrowing it for the general case it points at: a human operating as the transport layer between &lt;em&gt;any&lt;/em&gt; two systems that have no direct channel to each other. You copy the stack trace out of one window and paste it into another. You read a dashboard aloud into a chat box. You run the command the agent gave you and relay what it printed. Nothing about the information changes on its way through you — no judgment applied, no decision made, no bit flipped. You are moving bytes by hand between two machines that are, in most cases, already on the same network.&lt;/p&gt;
&lt;p&gt;Stated plainly, this is beyond stupid. It is also the default posture of nearly every agent workflow I see.&lt;/p&gt;
&lt;p&gt;None of this is new; it barely counts as an observation. Enterprise IT named it decades ago — &lt;em&gt;swivel-chair integration&lt;/em&gt;, a human pivoting between two terminals, re-keying what one system said into the other — and has been billing for it ever since. Sneakernet is the same job with better cardio. The most famous fix is &lt;a href=&quot;https://gist.github.com/chitchcock/1281611&quot;&gt;Amazon&apos;s service-interface mandate&lt;/a&gt;: the early-2000s edict that every team expose its data through service interfaces, no exceptions — this note&apos;s argument, enforced at company scale more than twenty years ago. The pattern keeps getting rediscovered because every new class of system ships before its channels do. Agents are just the newest system we&apos;ve defaulted to integrating by chair.&lt;/p&gt;
&lt;h2&gt;The worst network link you will ever operate&lt;/h2&gt;
&lt;p&gt;Evaluate a human as transport equipment and the spec sheet is grim:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Latency.&lt;/strong&gt; Seconds when you&apos;re at the keyboard, hours when you&apos;re not. You are the slowest hop in any pipeline you join, by three to six orders of magnitude.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lossy by design.&lt;/strong&gt; You don&apos;t relay; you summarize. You paste the part of the error that &lt;em&gt;looked&lt;/em&gt; relevant and drop the frame that mattered. A description of a screenshot is not a screenshot. Every transfer through a human is a transfer through a compressor with opinions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Error-prone.&lt;/strong&gt; Stale clipboard. Wrong window. The hand-redaction that removed one character too many. None of these failure modes announces itself — the corrupted payload arrives looking exactly like a good one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Availability.&lt;/strong&gt; You sleep eight hours. You have a job. Every transfer is synchronous with your attention, which means every transfer queues behind your entire life.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Unlogged.&lt;/strong&gt; Neither system records that the transfer happened. It cannot be retried, audited, or replayed. The most important hop in the pipeline is the only one with no observability at all.&lt;/p&gt;
&lt;p&gt;If a vendor tried to sell you this link, you would laugh them out of the room. Then you&apos;d alt-tab and paste something.&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- vignette: meat-proxy --&amp;gt;&lt;/p&gt;
&lt;h2&gt;Transport is not judgment&lt;/h2&gt;
&lt;p&gt;The steelman for humans-in-the-loop is real, and I want to be precise about what this note is &lt;em&gt;not&lt;/em&gt; arguing against. A human as a &lt;strong&gt;decision point&lt;/strong&gt; is often exactly right: approving the irreversible action, reviewing the diff before merge, &lt;a href=&quot;/notes/anchor-on-a-fact-the-model-cant-see/&quot;&gt;catching the number that can&apos;t possibly be true&lt;/a&gt;. In those loops, something passes through your judgment and comes out &lt;em&gt;different&lt;/em&gt; — approved, rejected, corrected. That is the job. That is the part worth being slow for.&lt;/p&gt;
&lt;p&gt;The meat proxy is the degenerate case: information passes through your hands and comes out identical. The test is one question — &lt;strong&gt;could this transfer have been a pipe?&lt;/strong&gt; If replacing you with &lt;code&gt;cat&lt;/code&gt; would lose nothing, you weren&apos;t a decision point. You were plumbing.&lt;/p&gt;
&lt;p&gt;Friction in a system should be a decision, not an accident. Deliberate friction — the approval gate, the review step — is a control surface you designed. The meat proxy is accidental friction: a tax you pay on every single transfer, forever, because nobody spent one afternoon building the channel.&lt;/p&gt;
&lt;p&gt;And some human channels are the design rather than the accident. An air gap is a meat proxy built on purpose: the entire point is that bytes cross only through a person, slowly, visibly. A compliance attestation is transport that exists to be slow and signed — the human carrying the number &lt;em&gt;is&lt;/em&gt; the audit trail. Keeping yourself as the only path into production can be a deliberate rate limiter on what an agent can do there. Run the test and these pass it: replacing you with &lt;code&gt;cat&lt;/code&gt; would lose exactly the thing the design is for. What fails the test is only the friction nobody chose.&lt;/p&gt;
&lt;h2&gt;Build the channel once&lt;/h2&gt;
&lt;p&gt;Every direct channel in my setup exists because I got sick of one specific copy-paste loop:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The phone.&lt;/strong&gt; The rendering question that opened this note doesn&apos;t reach me anymore. The phone is on the tailnet with ADB exposed; the agent takes a screencap, reads the image itself, and taps the screen if it needs to navigate. The phone went from &quot;thing I describe&quot; to &quot;peripheral the agent operates.&quot; As a bonus it became the failover web connection — when a request fails from the server, the agent checks the URL through the phone&apos;s own network before concluding anything is down.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The clusters.&lt;/strong&gt; I used to be the person pasting &lt;code&gt;kubectl get pods&lt;/code&gt; output into a chat window. Now every cluster runs a read-only proxy the agent can query directly. When it wants pod status, it asks the cluster — the actual authority on the matter — instead of asking me to ask the cluster.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Command output.&lt;/strong&gt; Commands the agent needs run now run where both of us can read the result, instead of me ferrying stdout across a window boundary one selection at a time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A real browser.&lt;/strong&gt; An old laptop on the bench keeps a live display session up; the agent screenshots it and drives a real browser when &quot;does this actually render&quot; is the question.&lt;/p&gt;
&lt;p&gt;Each of these took an afternoon or less. Each one deleted a category of copy-paste permanently. That&apos;s the whole economic argument: the meat proxy charges per transfer, forever; the channel charges once.&lt;/p&gt;
&lt;p&gt;It&apos;s worth pricing the paste honestly, because it always bills itself as cheaper than it is. A relay looks like eight seconds of copy-paste; what it actually costs is a context switch. In one &lt;a href=&quot;https://www.microsoft.com/en-us/research/wp-content/uploads/2004/01/chi2004diarystudyfinal.pdf&quot;&gt;field study of information workers&lt;/a&gt;, 40% of disrupted tasks were not resumed immediately after the interruption. Even at a skeptic&apos;s two minutes per relay, a loop that fires daily repays an afternoon of plumbing within a few months. The arithmetic only decides &lt;em&gt;when&lt;/em&gt; the channel wins, never &lt;em&gt;whether&lt;/em&gt; — per-transfer pricing always loses to a one-time build eventually, and eventually is closer than it feels. And that&apos;s only the human side of the ledger. The agent&apos;s side is wall-clock: a question that used to wait hours for my eyes — overnight, if I was asleep — is now a two-second screencap.&lt;/p&gt;
&lt;p&gt;Increasingly you don&apos;t even pay the afternoon. My channels are hand-built because my systems are homelab-shaped, but for anything SaaS-shaped the wire is being standardized out from under the problem: MCP — the Model Context Protocol — is the industry converging on exactly what this note argues for, a common plug so the ticket tracker, the mailbox, the docs, the database present themselves to the agent as a connector you install rather than a conversation you relay. Before building a bespoke channel, check whether someone already shipped it. When the afternoon collapses to ten minutes of setup, the last economic excuse for the paste goes with it.&lt;/p&gt;
&lt;h2&gt;From paste to pipe&lt;/h2&gt;
&lt;p&gt;The examples above are mine; the loops are universal. A short translation table — on the left, the paste you keep performing; on the right, the channel that deletes it:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;The paste&lt;/th&gt;
&lt;th&gt;The channel&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Reading a dashboard aloud&lt;/td&gt;
&lt;td&gt;A scoped read-only API token. Nearly every service you&apos;d describe to an agent ships one, and read-only scoping keeps the channel transport, not authority.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pasting the three log lines that looked relevant&lt;/td&gt;
&lt;td&gt;Query access to the log store, so the agent runs the search itself instead of receiving your compression of it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Running the query and pasting the rows&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;SELECT&lt;/code&gt;-only database role, or a read replica.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Forwarding the confirmation email&lt;/td&gt;
&lt;td&gt;An inbox of the agent&apos;s own, or read access to a shared one.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ferrying credentials out of the password manager&lt;/td&gt;
&lt;td&gt;A secrets store the agent queries with scoped access. The reference travels; the value never does. This is the one loop where human transport isn&apos;t just slow — it parks the payload in a chat transcript.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Emailing yourself a file so you can paste it&lt;/td&gt;
&lt;td&gt;A shared drop both sides can touch: a bucket, a synced folder.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reading a boot screen or a device console to the agent&lt;/td&gt;
&lt;td&gt;A KVM over IP, a serial console. Anything with a screen or a UART can be a peripheral; the phone was just the first.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Relaying between two agents — &quot;worker A finished, go tell B&quot;&lt;/td&gt;
&lt;td&gt;A durable work queue. At fleet scale this isn&apos;t an optimization; it&apos;s the only channel there is.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;None of these is exotic. Every one is a read-only credential, a webhook, or a queue — technology that predates agents by decades. The missing piece was never the wire; it was noticing you&apos;d become one.&lt;/p&gt;
&lt;p&gt;And for the transfers where a human genuinely must carry the message, you can at least stop being lossy. The rule: carry captures, not descriptions. The screenshot, not what the page looked like to you. The terminal recording, not the two lines that seemed relevant. The HAR file, not &quot;it felt slow.&quot; UI feedback is the classic case — &lt;a href=&quot;https://github.com/benjitaylor/agentation&quot;&gt;Agentation&lt;/a&gt; exists for exactly this: click the element and the agent gets a CSS selector and DOM context, not &quot;the card in the top right.&quot; If you must be the proxy, don&apos;t also be the compressor.&lt;/p&gt;
&lt;p&gt;There is a scale version of this, too. Interactively, the meat proxy wastes minutes. At fleet scale it is disqualifying: &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;twenty headless workers&lt;/a&gt; cannot route their I/O through my hands, so the only transfers that happen at all are the ones with a real channel. And when a needed channel is missing, a fleet doesn&apos;t wait for one — it improvises. The only channel every worker shares is the git repo itself, and I have watched 800 megabytes of database dumps land in commit history because one worker was told to hand an artifact to the next and git was the only wire they had. The mirror was down for ten hours. That wasn&apos;t the worker&apos;s failure; it was mine: an unbuilt channel doesn&apos;t mean the transfer won&apos;t happen, it means it happens over the worst wire available. Building the channel isn&apos;t an optimization on the loop — it&apos;s the precondition for taking yourself out of it.&lt;/p&gt;
&lt;h2&gt;The same bug, running backward&lt;/h2&gt;
&lt;p&gt;Everything above is the agent &lt;em&gt;pulling&lt;/em&gt;. The mirror-image loop runs the other way, with you as the interrupt controller: the build failed and you tell the agent; the alert fired and you paste it in; the deploy finished and you announce it. Same bug, opposite direction — an event occurred in one system and the news traveled by human. The fix is push: events should land where an agent will read them, or wake one on arrival.&lt;/p&gt;
&lt;p&gt;The translation table for this direction is shorter, because the fix is always one of three shapes — a webhook, a bridge, or a schedule:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;The announcement&lt;/th&gt;
&lt;th&gt;The push channel&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&quot;The build failed&quot;&lt;/td&gt;
&lt;td&gt;The CI system&apos;s completion webhook, pointed somewhere an agent reads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&quot;The alert fired&quot;&lt;/td&gt;
&lt;td&gt;A bridge from the alerting stack into the agent&apos;s queue — the page should wake a responder, and the responder doesn&apos;t have to be you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&quot;The deploy finished&quot;&lt;/td&gt;
&lt;td&gt;The pipeline&apos;s own completion hook, so the event starts the next step instead of merely informing you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&quot;I happened to notice the dashboard looks wrong&quot;&lt;/td&gt;
&lt;td&gt;A scheduled agent that checks on a cadence — noticing becomes a job with an owner, and the owner is never asleep&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&quot;I happened to notice&quot; is not an alerting pipeline, and you should not be a load-bearing part of one.&lt;/p&gt;
&lt;h2&gt;The questions that never get asked&lt;/h2&gt;
&lt;p&gt;The setup cost is lumpy and the paste is not, which is exactly how the friction survives. Eight seconds of copy-paste never feels worth an afternoon of plumbing, so the afternoon never happens, so the eight seconds happens forever.&lt;/p&gt;
&lt;p&gt;But the pastes you perform are the visible cost, and the smaller one. When asking you is expensive, the agent economizes: it stops asking. It works blind, guesses instead of checking, and hands you output shaped by every question it didn&apos;t ask. Demand for verification is elastic, and you priced it out.&lt;/p&gt;
&lt;p&gt;You can watch the elasticity run the other way the day a channel lands. The cluster proxies get queried constantly — pod status, logs, events, dozens of checks a day that would each have been an interruption with me in the path. Almost none of those checks used to happen. The deepest return on a channel isn&apos;t the pastes it deletes; it&apos;s the checks that start occurring once they&apos;re free.&lt;/p&gt;
&lt;h2&gt;What it costs&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Channels carry authority.&lt;/strong&gt; A direct channel means the agent can do the thing without you, and that should make you think before it makes you comfortable. The answer is scoping, not abstinence: nearly every meat-proxy loop I&apos;ve replaced was read-only, so the channels are read-only — my cluster proxies mechanically &lt;em&gt;cannot&lt;/em&gt; write. Where a channel would carry write authority, that&apos;s a decision point wearing a transport costume, and the human stays. &lt;a href=&quot;/notes/trust-is-a-property-of-the-system/&quot;&gt;Trust is a property of the system&lt;/a&gt;: the fix for a scary channel is scope and reversibility, not vigilance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Channels are faithful, and that cuts both ways.&lt;/strong&gt; The one real leak I&apos;ve had didn&apos;t involve a single system misbehaving: a build step echoed a tokenized clone URL into its own log, an agent dutifully committed the log, and the mirror replicated the commit out to public GitHub — every hop doing exactly its job, every hop keeping a copy. (GitHub&apos;s secret scanner found it before I did and revoked the token on sight.) The lesson wasn&apos;t vigilance, and it wasn&apos;t fewer channels. It was that the credential should never have been on a wire as a &lt;em&gt;value&lt;/em&gt; — it travels by reference now, and becomes a value only as environment at the moment of use. Build channels freely; just remember they will transport your mistakes with the same fidelity as your intentions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sometimes the copy-paste was doing double duty.&lt;/strong&gt; Eyes on the data as it moved through you — an accidental review step. Remove the transport and you remove that too, so &lt;a href=&quot;/notes/dont-let-the-agent-grade-its-own-homework/&quot;&gt;put the review back deliberately&lt;/a&gt;, as a gate you designed, instead of a side effect of your own slowness.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;When I catch myself copying from one window and pasting into another:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Did anything here pass through my judgment, or only through my clipboard?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If it passed through judgment — a call was made, a number was checked, an action was approved — then that&apos;s the job, and it should stay mine. If it only passed through the clipboard, I just found a missing channel, and every repetition of that paste is another vote for spending the afternoon.&lt;/p&gt;
&lt;p&gt;That&apos;s the instance test. The systematic version: for one week, keep a tally of every time you copy out of one window and paste into another — what moved, where from, where to. Change nothing else. At the end of the week the tally is your channel backlog, pre-sorted by frequency, and the top line is what next weekend&apos;s afternoon is for.&lt;/p&gt;
&lt;p&gt;The systems can talk to each other. They are usually on the same network. The only reason you&apos;re carrying the message is that nobody built the wire — and you&apos;re the only component in the whole pipeline that can fix that.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;h2&gt;Quick answers&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;What is a meat proxy?&lt;/strong&gt; A human acting as the transport layer between two systems that have no direct channel: copying output out of one and pasting it into the other, or relaying what one says to the other, with no judgment applied on the way through. Enterprise IT&apos;s older name for it is swivel-chair integration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Where does the term come from?&lt;/strong&gt; &lt;a href=&quot;https://gruhn.me/blog/2026-08-03/&quot;&gt;Niklas Gruhn&apos;s essay &quot;Don&apos;t be a meat proxy&quot;&lt;/a&gt; (August 3, 2026) named the person who forwards a question to an AI and forwards the answer back, unread, to whoever asked. This note takes the same name to the general case: a human relaying between any two systems, agent workflows included. Both senses fail the same test — nothing passed through judgment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How do I tell if I&apos;m being one?&lt;/strong&gt; Ask whether the transfer could have been a pipe. If replacing you with &lt;code&gt;cat&lt;/code&gt; would lose nothing, you weren&apos;t a decision point — you were transport.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Isn&apos;t keeping a human in the loop a good thing?&lt;/strong&gt; As a decision point, yes: approving the irreversible action, reviewing the diff, catching the number that can&apos;t be true. Transport through a human isn&apos;t oversight; it&apos;s latency, loss, and no log. Deliberate human channels — an air gap, a signed attestation — pass the test, because the slowness is the point.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How do I stop?&lt;/strong&gt; Tally a week of copy-pastes, then build the most frequent one as a direct channel, read-only wherever you can. The paste costs you every time; the channel costs you once.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Related: &lt;a href=&quot;/notes/trust-is-a-property-of-the-system/&quot;&gt;Trust is a property of the system, not the agent&lt;/a&gt; — why the fix for a scary channel is scoping and reversibility, not vigilance. And &lt;a href=&quot;/notes/dont-let-the-agent-grade-its-own-homework/&quot;&gt;Don&apos;t let the agent grade its own homework&lt;/a&gt; — the review step you must re-add on purpose once you stop being the wire.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>collaboration</category><category>friction</category></item><item><title>Trust is a property of the system, not the agent</title><link>https://jedarden.com/notes/trust-is-a-property-of-the-system/</link><guid isPermaLink="true">https://jedarden.com/notes/trust-is-a-property-of-the-system/</guid><description>A near-miss with a git flag once put three volumes of real data one sync cycle from deletion — caught by luck, not by design. The right fix wasn&apos;t more vigilance. It was building the trust into the system itself: an agent doesn&apos;t need to be trusted, an action needs to be cheap to undo.</description><pubDate>Sun, 26 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;On 2026-07-18 I was decommissioning a deployment and wanted to keep three volumes of real historical data alive underneath it — carved out of the manifest before the rest of it went away. I split the file, staged the new one with &lt;code&gt;git add -N&lt;/code&gt; so I could review the diff before committing to it, then committed it in the same motion I&apos;d used a dozen times before. &lt;code&gt;git status&lt;/code&gt; showed the file as added, both before the commit and after. Every visible signal said the data was safe.&lt;/p&gt;
&lt;p&gt;It wasn&apos;t. &lt;code&gt;-N&lt;/code&gt; marks a path as tracked; it does not stage its content. The commit shipped an empty file — zero bytes, valid YAML, containing nothing. The sync controller took the diff at face value: the three volumes were no longer declared anywhere, so they were no longer wanted, so it queued them for deletion. Nothing in the tooling was wrong. I had, with total precision, told it to throw away data I meant to keep.&lt;/p&gt;
&lt;p&gt;I caught it one step before the deletion actually ran, by re-checking the committed file&apos;s line count against the working tree&apos;s. If I&apos;d looked four minutes later, or not looked at all, three volumes of real data would be gone, and the only reason it isn&apos;t is that I happened to check. That&apos;s not a safety net. That&apos;s luck, wearing a safety net&apos;s clothes.&lt;/p&gt;
&lt;h2&gt;Trust is a property of the system, not the agent&lt;/h2&gt;
&lt;p&gt;The instinct after a near-miss like that is to conclude the fix is &lt;em&gt;more attention&lt;/em&gt; — read the diff more carefully next time, be warier of &lt;code&gt;-N&lt;/code&gt;, don&apos;t get complacent. That instinct is exactly backwards, and it&apos;s worth being precise about why, because it&apos;s the same instinct that shapes most conversations about how much autonomy to give an agent: trust it more, trust it less, review its output more closely, calibrate your confidence up or down. All of that treats trust as a property of &lt;em&gt;judgment&lt;/em&gt; — mine or the agent&apos;s — exercised correctly in the moment it matters.&lt;/p&gt;
&lt;p&gt;My vigilance is not a system property. It doesn&apos;t scale, it doesn&apos;t run at 2 a.m., it doesn&apos;t survive the twentieth review of the day. What would actually have saved those three volumes wasn&apos;t a sharper eye — it was a rule that never needed my eye in the first place.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Trust isn&apos;t a measure of how good an agent&apos;s judgment is. It&apos;s a measure of how cheap it is to be wrong.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Once you frame it that way, the live question stops being &quot;how much do I trust this agent&quot; and becomes &quot;what does it cost me if this specific action is wrong&quot; — and the second question has an answer you can build into the system, instead of a feeling you have to keep maintaining in your own head every time an agent reaches for something.&lt;/p&gt;
&lt;h2&gt;Three tiers, one test&lt;/h2&gt;
&lt;p&gt;The test that actually matters is: &lt;strong&gt;if this action turns out to be wrong, what does undo look like, and does it already exist?&lt;/strong&gt; Run every class of change an agent might make through that test and it sorts into three tiers, not two.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Code changes.&lt;/strong&gt; The undo already exists by construction — it&apos;s called version control. A wrong edit costs one &lt;code&gt;git revert&lt;/code&gt;. Because the floor is unconditionally solid here, an agent gets full autonomy: it can open files, restructure functions, delete whole modules, and none of it needs a human in the loop first, because none of it can actually cost anything.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Live infrastructure, routed through the same mechanism.&lt;/strong&gt; This is the tier people get wrong most often, because &quot;production&quot; &lt;em&gt;sounds&lt;/em&gt; like it should default to more caution than code. But if every change to a live system also goes through version control — a manifest committed to a repo, reconciled into the running system by a controller that will happily put it back the way it was — then a live environment is exactly as reversible as code is. The controller becomes a second safety net underneath the first: even a change applied by hand gets silently reverted back to what the repo says, because the repo, not the moment, is the source of truth. An agent can operate here too, with the same confidence, for the same reason.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;True one-way actions.&lt;/strong&gt; Nothing rescues these, because there is no &quot;undo&quot; to construct — the action&apos;s effect leaves the system entirely. Sending a message. Charging a card. Force-pushing over history other machines have already built on. For this tier, and only this tier, a human has to own the call before it happens, because no amount of system design converts a one-way door into a two-way one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Nearly everything an agent does in a working session — writing code, restructuring a repo, reconciling a live deployment — lives in the first two tiers. The third tier is real, but it&apos;s much smaller than it feels, and most of what people lump into it because it &lt;em&gt;sounds&lt;/em&gt; irreversible actually isn&apos;t.&lt;/p&gt;
&lt;h2&gt;Deletion is the easy case&lt;/h2&gt;
&lt;p&gt;Deletion is the textbook example of something that looks like tier three and is almost always tier two. The three volumes in my near-miss weren&apos;t actually one bad &lt;code&gt;git commit&lt;/code&gt; away from being unrecoverable — they were one &lt;em&gt;missing backup&lt;/em&gt; away from it. The fix for the near-miss was never &quot;review diffs harder.&quot; It was: nothing gets deleted without a copy existing first, full stop, made mechanically, not as a judgment call in the moment.&lt;/p&gt;
&lt;p&gt;That&apos;s the whole trick, and it&apos;s almost insultingly simple once you say it out loud: back up, then delete. If the deletion turns out to be wrong, you don&apos;t debug it, you don&apos;t reconstruct it by hand, you restore the copy and move on. The action was irreversible for about the length of time it takes to run a backup command, and reversible forever after.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is what actually earns an agent the right to delete something on its own. Not a judgment that the agent is trustworthy enough, not a review step where a human eyeballs the command first — a mechanical guarantee that a copy exists before the delete runs. The permission comes from the guarantee, not from confidence in whoever&apos;s finger is on the trigger.&lt;/p&gt;
&lt;h2&gt;Where backup-based reversibility hits a ceiling&lt;/h2&gt;
&lt;p&gt;It would be tidy if &quot;back up first&quot; dissolved the whole tier-three category, but it doesn&apos;t, and the place it stops working is worth naming exactly: force-pushing over history other machines have already pulled and built on.&lt;/p&gt;
&lt;p&gt;A force-push looks like deletion — old commits vanish from the branch — so the backup instinct says: keep a copy of the old ref, push away, restore from the copy if it goes wrong. But the thing that actually breaks isn&apos;t recoverable from &lt;em&gt;your&lt;/em&gt; copy, because the damage doesn&apos;t happen to your repository. It happens to every other clone that has already based work on the history you just erased. Their next pull either silently diverges or drags your rewritten history in and corrupts what they built on top of it. Your backup makes &lt;em&gt;you&lt;/em&gt; whole. It does nothing for them.&lt;/p&gt;
&lt;p&gt;That&apos;s the real dividing line for tier three, and it&apos;s sharper than &quot;can this be undone&quot;: &lt;strong&gt;can the person doing the action alone also do the entire undo alone?&lt;/strong&gt; Deleting a file, dropping a database table, deleting a cloud volume — one party creates the mess, and that same party, with a backup in hand, cleans it up completely. A force-push spreads the damage to parties who never agreed to bear it and can&apos;t fix it from where they&apos;re sitting. When the blast radius crosses that boundary, no backup converts it back to tier two, and it stays a human&apos;s call — which is exactly why it&apos;s banned outright rather than allowed-with-a-backup.&lt;/p&gt;
&lt;h2&gt;A backup existing isn&apos;t the same as a backup you can trust&lt;/h2&gt;
&lt;p&gt;There&apos;s one more failure mode, quieter than the other two, and I only found it by nearly getting bitten by it: a backup job can exist, run on schedule, and still not be the safety net it looks like. I once found a nightly &lt;code&gt;restic&lt;/code&gt; backup running three times concurrently — no lock file, no guard against overlap — driving load high enough to look like an unrelated outage. The backups were technically completing. Nobody had checked whether they&apos;d actually restore cleanly, or whether the three overlapping runs were racing each other into a corrupted snapshot.&lt;/p&gt;
&lt;p&gt;The presence of &lt;em&gt;a&lt;/em&gt; backup script is not the same claim as &quot;this delete is reversible.&quot; A trustworthy backup is current, it doesn&apos;t race itself, and — the part that&apos;s easiest to skip — someone has actually restored from it at least once, not just confirmed the job exits zero. Treating &quot;there&apos;s a backup somewhere&quot; as equivalent to &quot;this is tier two&quot; is how a near-miss like the one that opened this note turns into an actual loss the next time nobody happens to be watching. The guarantee has to be real, not assumed.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I let an agent take an action with any real weight behind it, I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If this turns out to be wrong, what&apos;s the undo — and does it already exist, or does it need to be built first?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the answer is &quot;version control already covers it,&quot; the agent proceeds without me. If the answer is &quot;a backup makes it reversible,&quot; the backup runs first, verified, every time, mechanically — and then the agent proceeds. If the answer is &quot;nothing rescues this, and the blast radius reaches past me,&quot; it waits for a human, no matter how good the agent&apos;s judgment looked five minutes ago. I stopped asking myself how much I trust the agent. I built the system so the question doesn&apos;t need an answer.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Background: &lt;a href=&quot;/notes/ending-is-better-than-mending/&quot;&gt;Ending is better than mending&lt;/a&gt; — the same cheap-undo logic applied to agent output, not agent actions. And &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;Deterministic state machines for non-deterministic agents&lt;/a&gt; — predictable failure as the other half of the same foundation.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>orchestration</category><category>safety</category></item><item><title>What breaks when you run twenty agents at once</title><link>https://jedarden.com/notes/what-breaks-at-twenty-agents/</link><guid isPermaLink="true">https://jedarden.com/notes/what-breaks-at-twenty-agents/</guid><description>A failure taxonomy from a year of running coding-agent fleets unattended. Eight ways a fleet dies, none of which involve the model — and the operational discipline they add up to.</description><pubDate>Wed, 22 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I run about twenty coding agents concurrently — headless workers pulling tasks from a shared queue, unattended, around the clock. I have written before about &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;why they are cattle, not pets&lt;/a&gt;, and about &lt;a href=&quot;/notes/unit-economics-of-cattle/&quot;&gt;what a closed task actually costs&lt;/a&gt;. This note is about the third thing you learn, the one nobody&apos;s demo will show you: how fleets fail.&lt;/p&gt;
&lt;p&gt;Everything below actually happened. Fifteen workers stranded by a deploy. Seven work queues wiped by a repair tool. Twenty-two repos polluted by a test run. An entire fleet&apos;s sessions gone in one second. None of it is hypothetical, and — this is the part worth the price of admission — &lt;strong&gt;none of it was the model&apos;s fault.&lt;/strong&gt; In a year of fleet failures, the LLM barely appears in the incident log. The agent does its job. What fails is everything you stood up around it.&lt;/p&gt;
&lt;p&gt;When you run one agent, failure means &quot;the agent did the wrong thing.&quot; When you run twenty, failure changes species. It moves out of the model and into the seams: the launch path, the queue, the deploy process, the host, the data layer, the test suite, your own tooling. Those seams are where this taxonomy lives.&lt;/p&gt;
&lt;p&gt;Eight failure modes. For each one: what it looked like from the operator&apos;s seat, what actually caused it, and the operational rule it taught. Each of these deserves — and will get — a full postmortem of its own. This is the map.&lt;/p&gt;
&lt;h2&gt;1. The fleet you launch is not the fleet you get&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- vignette: construction-kill --&amp;gt;&lt;/p&gt;
&lt;p&gt;The symptom is silence. You launch the fleet, go do something else, and come back to find fewer workers than you started. No errors. No crash logs. No death messages. Workers that simply never existed — you count the sessions and the number is wrong.&lt;/p&gt;
&lt;p&gt;The cause is that &lt;strong&gt;construction is the most expensive moment in a worker&apos;s life&lt;/strong&gt;, and it happens before any of your failure handling exists. A worker booting up initializes its session, loads repo state, spins up its agent harness — all CPU-hungry, all at once. Launch twenty workers simultaneously and the machine saturates precisely at the moment every worker is at its most fragile. The late ones starve during construction and die silently, because the state-machine loop that would have noticed a failure and handled it &lt;em&gt;hasn&apos;t started yet&lt;/em&gt;. All of my orchestration — outcome classification, retries, timeouts — protects the loop. Nothing protected the birth.&lt;/p&gt;
&lt;p&gt;This one is insidious because the failure is invisible by construction. A worker that dies mid-task leaves a claimed bead, a session, evidence. A worker that dies being born leaves nothing. Your monitoring says the fleet is healthy because the fleet — the one that survived — is healthy. You are not operating the fleet you think you launched.&lt;/p&gt;
&lt;p&gt;The rule: &lt;strong&gt;stagger launches, and treat launch itself as load.&lt;/strong&gt; Fleet bring-up is not an instant; it is a schedulable workload with a resource profile steeper than steady-state operation. NEEDLE launches now ramp with deliberate delays between workers, and bring-up is the one phase I still watch. The general principle generalizes past agents: any system whose failure handling lives inside the main loop has an unprotected window before the loop starts. Know how wide yours is.&lt;/p&gt;
&lt;h2&gt;2. The bead that never stops failing&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- vignette: death-loop --&amp;gt;&lt;/p&gt;
&lt;p&gt;The queue&apos;s contract is simple: failed tasks go back in the queue. That contract has a degenerate case, and the degenerate case runs a space heater made of tokens.&lt;/p&gt;
&lt;p&gt;Some tasks do not fail because of bad luck. They fail because they &lt;em&gt;cannot succeed&lt;/em&gt; — the task is too big for one context window, the acceptance criteria contradict the repo&apos;s reality, the premise was wrong when it was written. Re-queue one of those and the fleet forms an orderly line to burn money. A worker claims it, works earnestly, fails, re-queues it. The next worker claims it. All night. Every attempt costs a full agent run — real tokens, real minutes — and an unattended fleet will pay that cost with perfect patience until you wake up and read the ledger.&lt;/p&gt;
&lt;p&gt;The cause is an epistemological gap: &lt;strong&gt;the queue cannot tell a transient failure from an impossible task.&lt;/strong&gt; Retry is a strategy only when failure is temporary. The queue does not know that. You have to teach it.&lt;/p&gt;
&lt;p&gt;The fix has two halves. First, a circuit breaker: failure counters on every task, and after N failed attempts the task is fenced — moved to a blocked state a worker cannot claim, waiting for a human or a triage pass. Second, and less obviously: the tasks most likely to loop are the big umbrella ones, so &lt;strong&gt;split umbrellas into small beads and block the umbrella on its children.&lt;/strong&gt; Small tasks fail transiently; sprawling tasks fail structurally. Task granularity turns out to be a &lt;em&gt;reliability&lt;/em&gt; parameter, not just a planning preference.&lt;/p&gt;
&lt;p&gt;The rule: an unattended fleet needs an explicit answer to &quot;when do we stop trying?&quot; — because the default answer is &lt;em&gt;never&lt;/em&gt;, and never is expensive.&lt;/p&gt;
&lt;h2&gt;3. The deploy that stranded fifteen workers&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- vignette: stranded-deploy --&amp;gt;&lt;/p&gt;
&lt;p&gt;I shipped a new orchestrator build the lazy way: moved the fresh binary over the path the fleet spawns from. Fifteen running workers detached on the spot. Still running. Still holding claims. Still spending money. No longer mine.&lt;/p&gt;
&lt;p&gt;Here is the mechanism. Workers re-invoke the orchestrator binary through its path as they cycle. Replace the file at that path and you have not &quot;upgraded&quot; the running workers — you have changed the world underneath them. The processes that were mid-flight kept running the old code with nothing supervising them; a zombie herd, invisible to the new orchestrator, grazing on the same queue. The cleanup was manual: hunt down every stranded session, reconcile every orphaned claim, apologize to the ledger.&lt;/p&gt;
&lt;p&gt;The embarrassing part is that I would never do this to a production service. Rolling deploys, drain-then-replace, immutable artifacts — I know the liturgy. But the fleet did not &lt;em&gt;feel&lt;/em&gt; like production. It felt like my tooling, on my box, so it got the &lt;code&gt;mv&lt;/code&gt; treatment. That instinct — the fleet is casual infrastructure — is the actual root cause, and it recurs in half the failures in this taxonomy.&lt;/p&gt;
&lt;p&gt;The rule: &lt;strong&gt;deploy to the fleet the way the fleet deploys to prod.&lt;/strong&gt; There is exactly one designated stable path that live workers reference, replacements land there atomically, and a running fleet gets stopped — drained, claims released — before the binary it re-executes changes underneath it. Never mutate the live spawn path. The fleet is production. It always was; the only question is how expensive the lesson is on the day you learn it.&lt;/p&gt;
&lt;h2&gt;4. The night the substrate died&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- vignette: substrate-oom --&amp;gt;&lt;/p&gt;
&lt;p&gt;Every session vanished at once. Twenty-some workers, the monitoring panes, everything — gone between one glance and the next. My first theory was a mass kill: something OOM-killed the workers. Wrong, and the wrongness is the lesson. The workers did not die. &lt;strong&gt;The thing they all lived inside died.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The fleet ran as tmux sessions, and tmux has a property that is easy to know and hard to &lt;em&gt;feel&lt;/em&gt;: every session on the socket is hosted by one server process. That server had been quietly accumulating memory for weeks. When the kernel finally OOM-killed it, it took every session with it — not worker by worker, but all at once, one process death fanning out into total fleet loss. My orchestration had an answer for every way a &lt;em&gt;worker&lt;/em&gt; could die. It had no concept of the layer below the workers dying, because I had never written that layer down as a dependency.&lt;/p&gt;
&lt;p&gt;Worse, the obvious response — reboot the box — is the wrong one. It destroys the evidence and everything else that &lt;em&gt;was&lt;/em&gt; still alive, to fix a problem one &lt;code&gt;systemd&lt;/code&gt; unit could prevent.&lt;/p&gt;
&lt;p&gt;The rule: &lt;strong&gt;inventory the processes your whole fleet transitively lives inside, and govern their resources explicitly.&lt;/strong&gt; For me that meant the tmux server gets a systemd &lt;code&gt;MemoryHigh&lt;/code&gt; ceiling of 48G so memory pressure throttles it long before the OOM killer arrives. But the checklist matters more than the fix: the terminal multiplexer, the SSH daemon, the container runtime, the DNS resolver — any of them is a single point of failure standing under your whole herd. You cannot circuit-break your way around a dead host process. Find your substrate before it finds you.&lt;/p&gt;
&lt;h2&gt;5. The repair that ate the queue&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- vignette: repair-wipe --&amp;gt;&lt;/p&gt;
&lt;p&gt;The work queue underneath my fleet keeps state in two places: a live SQLite database, and a JSONL checkpoint file that gets written on explicit flush. The database is the truth; the checkpoint is a snapshot of the truth as of the last flush. The queue&apos;s repair tool rebuilds the database &lt;em&gt;from&lt;/em&gt; the checkpoint.&lt;/p&gt;
&lt;p&gt;You can see it coming. One afternoon, chasing corruption, I ran repair across my workspaces — without flushing first. The tool did exactly what it was designed to do: rebuilt each database from its checkpoint, discarding everything created since. Seven workspaces out of seven, every unflushed task gone. Not corrupted — &lt;em&gt;cleanly, correctly deleted&lt;/em&gt; by a tool doing its job well.&lt;/p&gt;
&lt;p&gt;The cause is an authority-model confusion, and it is endemic to any system with a live store and a backup: &lt;strong&gt;the moment you treat the checkpoint as the truth, every recovery action becomes a rollback.&lt;/strong&gt; Nothing in the tool&apos;s name said so. &quot;Repair&quot; sounds conservative. It was actually &quot;restore,&quot; and restore is destructive in the direction nobody thinks about — forward.&lt;/p&gt;
&lt;p&gt;The rule comes in layers. Know, for every stateful system in the fleet, which copy is authoritative — and write it down where the 2 a.m. version of you will see it. Sequence every recovery as &lt;em&gt;checkpoint first, rebuild second&lt;/em&gt;; in my case that is a flush before any repair, in that order, always. And push the guard into the tool itself: the upstream fix ships repair that refuses to run against unflushed state. Habits protected by tooling survive; habits protected by memory last until the afternoon you are tired.&lt;/p&gt;
&lt;h2&gt;6. The test run that lied to twenty-two repos&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- vignette: test-pollution --&amp;gt;&lt;/p&gt;
&lt;p&gt;The dispatch pipeline needed end-to-end tests — real workers claiming real tasks and reporting real outcomes, because anything less mocks away the exact seams this taxonomy says are dangerous. The tests worked beautifully. They exercised claiming, assignment, completion, the whole loop.&lt;/p&gt;
&lt;p&gt;They exercised it against &lt;strong&gt;production state&lt;/strong&gt;. The test harness discovered workspaces the same way real workers do, and it dutifully sprayed synthetic claims across twenty-two of the twenty-nine live workspaces on the machine. Fake assignees on real tasks. Fabricated completion claims on work nobody did. And the cleanup was worse than the mess: the tooling&apos;s own validation — sensible rules for normal operation — rejected parts of the undo, because &quot;blank out this assignee&quot; is not a thing the CLI believed anyone should legitimately want.&lt;/p&gt;
&lt;p&gt;The failure is easy to caricature as a missing test fixture, but the real cause is structural. In an agent fleet, the test traffic &lt;em&gt;is&lt;/em&gt; agent traffic — same tools, same stores, same discovery paths. There is no natural fence between &quot;testing the fleet&quot; and &quot;operating the fleet&quot; unless you build one, and nothing in the stack builds it for you. Meanwhile the blast radius of unfenced tests scales with exactly the thing you are proudest of: how much your automation can reach.&lt;/p&gt;
&lt;p&gt;The rule: &lt;strong&gt;fencing test state is a fleet feature, not a test-suite nicety.&lt;/strong&gt; Test runs get their own stores, their own workspace roots, their own discovery scope — enforced by the infrastructure, not by the test author remembering a flag. And your tooling needs an admin path to undo what automation did, because one day the thing that needs reverting will be something validation swears is impossible.&lt;/p&gt;
&lt;h2&gt;7. The claims that leak&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- vignette: leaked-claims --&amp;gt;&lt;/p&gt;
&lt;p&gt;This one is slow, which makes it the most dangerous entry in the taxonomy. Nothing crashes. Nothing pages. The fleet just gets gradually, mysteriously idle.&lt;/p&gt;
&lt;p&gt;The mechanism: a worker claims a task, marks it in-progress, and then dies — construction kill, OOM, a harness crash, any of the deaths above. The claim survives the claimant. That task is now in limbo: not done, so the work is missing; not available, so no other worker can take it. One leaked claim is noise. But an unattended fleet manufactures dead workers at a steady rate, and each death can pin a task. Over days the ready pool quietly drains until you have a queue that &lt;em&gt;looks&lt;/em&gt; full and a fleet with nothing it is allowed to do — starvation with a healthy-looking dashboard.&lt;/p&gt;
&lt;p&gt;The tempting fix is a janitor: some external process that sweeps for stale in-progress tasks and releases them. The trap is that &quot;stale&quot; is a guess. Sweep too aggressively and you release a claim whose worker is alive and mid-task — now two workers hold one bead and you have manufactured the exact double-write the atomic claim existed to prevent.&lt;/p&gt;
&lt;p&gt;The rule: &lt;strong&gt;reclamation must live inside the worker loop, governed by the same claim discipline as everything else.&lt;/strong&gt; In NEEDLE this is the mend pass — a live worker, under the queue&apos;s own concurrency rules, is the only thing allowed to adjudicate a stale claim and re-queue the task. Paired with a one-loop-per-bead invariant — no agent ever spans multiple tasks, no task ever has ambiguous ownership — leases stay decidable. Dead workers are normal. Immortal claims are the bug.&lt;/p&gt;
&lt;h2&gt;8. Friendly fire from the janitor&lt;/h2&gt;
&lt;p&gt;&amp;lt;!-- vignette: janitor-fire --&amp;gt;&lt;/p&gt;
&lt;p&gt;The most dangerous command in my fleet was the one that sounded safest. &lt;code&gt;cleanup&lt;/code&gt; — the housekeeping tool that tidies up dead worker sessions. Run it casually, as the name invites you to, and it would SIGHUP &lt;em&gt;live&lt;/em&gt; workers mid-task. The tool could not reliably tell a dead session from a working one, and it resolved its uncertainty in the worst possible direction: kill.&lt;/p&gt;
&lt;p&gt;The precise irony: the janitor exists because of failure mode 7 — dead workers leave debris, debris needs sweeping. The remedy for one fleet pathology became a pathology. And unlike the others in this taxonomy, this one has a human trigger. Nothing about the fleet has to be wrong; the operator just has to run the reassuringly-named command at the wrong moment. I now treat it the way I treat &lt;code&gt;--force&lt;/code&gt; flags: a thing whose invocation is itself an incident risk.&lt;/p&gt;
&lt;p&gt;Two rules, one technical and one linguistic. Technical: &lt;strong&gt;any tool that acts on sessions must prove liveness before acting&lt;/strong&gt; — a positive signal that this session is dead, not an absence-of-evidence heuristic. In fleet terms, the janitor needs the same discipline as the mend pass: destructive action only on affirmatively-verified corpses. Linguistic: &lt;strong&gt;name destructive tools like what they are.&lt;/strong&gt; &quot;Cleanup&quot; invites casual use; a name that says &lt;em&gt;this kills sessions&lt;/em&gt; buys you the two seconds of hesitation that would have saved my afternoon. Your fleet&apos;s command-line surface is part of its safety model, because the operator is part of the system — and at 2 a.m., the operator is the least reliable component in it.&lt;/p&gt;
&lt;h2&gt;The pattern behind the pattern&lt;/h2&gt;
&lt;p&gt;Read the taxonomy again and notice who is missing: the model. Eight fleet-killing failure modes and not one of them is &quot;the LLM wrote bad code.&quot; The agent — the part everyone debates, benchmarks, and blogs about — is the component that held up.&lt;/p&gt;
&lt;p&gt;Every failure lives at a seam. Fleet↔host: the construction kill, the substrate OOM. Fleet↔queue: the death loop, the leaked claims. Fleet↔deploy: the stranded workers. Fleet↔data: the repair wipe. Fleet↔test: the pollution. Fleet↔operator: the janitor. And every fix is almost embarrassingly boring — stagger the launches, count the failures, fence the state, order the flush before the rebuild, cap the memory, lease the claims, verify liveness before killing. No prompt engineering. No model selection. Ops discipline, applied one level up the stack than we are used to applying it.&lt;/p&gt;
&lt;p&gt;This is the shape of the whole discipline: &lt;strong&gt;the agent is the easy part.&lt;/strong&gt; We spent fifteen years learning that running software reliably is a different profession from writing it — that is why SRE exists. Agent fleets are re-running that history at fast-forward. Everyone is hiring for the software engineering; the outages come from the operations.&lt;/p&gt;
&lt;h2&gt;Naming the discipline&lt;/h2&gt;
&lt;p&gt;There is agent &lt;em&gt;building&lt;/em&gt; — prompts, tools, harnesses, evals. It has books, courses, and a job title. Then there is the thing this note is actually about: keeping a herd of agents alive, honest, and economical, unattended, for months. Launch policy, queue semantics, deploy discipline, substrate governance, state authority, test fencing, claim leases, operator safety. That thing does not have a name yet.&lt;/p&gt;
&lt;p&gt;I have started calling it &lt;strong&gt;agent fleet operations&lt;/strong&gt;, and I think it becomes a real discipline on a predictable schedule: every team currently celebrating their first autonomous agent is somewhere on the road to their own version of this taxonomy. One agent is a program. Twenty agents are a production system, with a production system&apos;s failure surface — plus a few failure modes that are genuinely new, because the workers spend money, fabricate state when tested carelessly, and die at rates no human team does.&lt;/p&gt;
&lt;p&gt;Each of the eight modes above gets its own full postmortem — timeline, diagnosis, the fix&apos;s actual design — as a follow-up note. Consider this the index. If you are building toward your own fleet: I hope the taxonomy costs you less than it cost me to write.&lt;/p&gt;
&lt;h2&gt;Since publication: three more ways a fleet stops&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Added 2026-10-28.&lt;/em&gt; The taxonomy above was written in July. Three months of running the same fleet added three modes that none of the eight cover. Each is a seam, and each fix is just as boring as the others. I am leaving the numbering alone; these are appendices until they earn a postmortem of their own.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;9. The pause that nobody could clear.&lt;/strong&gt; A worker closed a task, staged the queue&apos;s checkpoint files in git, and never committed them. The orchestrator has a guard for exactly that state: when the checkpoint is not fully committed, it pauses claiming in that workspace so no worker builds on a store that git does not yet hold. Correct guard, no exit. The next worker booted, found the pause, and reported itself idle. Its background repair pass retried the same operation about 1,150 times in 70 minutes, failing on the same message every time, and escalated to no one. A whole workspace of ready work sat behind one uncommitted file for a morning until a human read the log. The rule: &lt;strong&gt;a pause is not a failure, so do not retry it.&lt;/strong&gt; A guard that halts work must name who clears it and say so somewhere a person will see, or it is mode 2 wearing a safety vest. The fix was one commit and one line in the repo&apos;s agent instructions: commit the checkpoint after every close.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;10. The proposal flood.&lt;/strong&gt; Give the fleet a generator that turns observations into proposed tasks, and it will do what generators do. Mine was configured for five proposals per run with a day&apos;s cooldown; a counter was bypassed, and it produced roughly 1,200 a day. By late October the estate held about 7,500 tasks, of which one was claimable. The governor that sizes the fleet reads demand as &quot;ready tasks,&quot; so from where it sat the estate was nearly empty, while every human-facing list showed thousands of items. Nothing crashed; the queue was simply full of things nobody had decided to do. Triage by hand was out of the question at that volume, so the fix, still landing as I write this, is a rule, not a review: proposals stay held until a policy admits them, duplicates collapse on creation, a generator that proposes against a repo with no planned work proposes nothing, and the cap is enforced fleet-wide and across restarts. The rule: &lt;strong&gt;generated work is not demand.&lt;/strong&gt; Count only what a person or a policy has admitted, and cap the producer before you ever need to triage its output.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;11. The gate nothing could satisfy.&lt;/strong&gt; A pre-receive secret scan on the git host is the right thing to have in front of a fleet that writes to its own repos all night. Mine began refusing pushes for two reasons that were not secrets: prose in task notes that looked like a credential pattern, and a push whose new blob bytes exceeded the scanner&apos;s own budget. One repo fell 247 commits behind its remote before anyone noticed, because the workers kept committing locally and the failure was in a layer none of them watched. The detectors were switched off on October 3 while a redaction primitive was built, and stayed off for about two weeks, because the only alternative was hand-editing a task store that must never be hand-edited. The rule: &lt;strong&gt;ship the eraser before the detector.&lt;/strong&gt; A gate that blocks on findings nobody can remove is a gate the operator will turn off, and an off gate protects nothing. Every detector needs a sanctioned way to clear a finding, and a false positive is a design input, not a nuisance.&lt;/p&gt;
&lt;p&gt;Three more seams: fleet↔git, fleet↔planning, fleet↔gate. Same lesson as before. The model is still absent from the incident log.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;The fleet in this note runs on &lt;a href=&quot;https://github.com/jedarden/NEEDLE&quot;&gt;NEEDLE&lt;/a&gt; (Rust orchestrator: deterministic worker state machine, agent-agnostic harness adapters), with a SQLite-backed bead queue as the shared work queue (bead-forge when the first eight incidents happened; its successor, &lt;a href=&quot;https://github.com/jedarden/bead-rs&quot;&gt;bead-rs&lt;/a&gt;, since August), &lt;a href=&quot;https://github.com/jedarden/subscription-quota-governor&quot;&gt;subscription-quota-governor&lt;/a&gt; sizing the fleet against each provider&apos;s subscription quota (it replaced &lt;a href=&quot;https://github.com/jedarden/claude-governor&quot;&gt;claude-governor&lt;/a&gt; in October 2026), and &lt;a href=&quot;https://github.com/jedarden/ccdash&quot;&gt;ccdash&lt;/a&gt; for herd health. Every incident above shaped a feature in one of them.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>orchestration</category><category>NEEDLE</category><category>fleet-ops</category></item><item><title>The agentic coding ladder is a list of things you give up</title><link>https://jedarden.com/notes/agentic-coding-ladder/</link><guid isPermaLink="true">https://jedarden.com/notes/agentic-coding-ladder/</guid><description>Steve Yegge&apos;s eight levels read the climb by how much you trust the AI. Here&apos;s a complementary lens on the same ascent: measure it by what you give up at each rung — which is why some people skip rungs entirely, having no old coding habits to undo. It starts with the search bar, climbs through your code, your presence and your judgment, and ends at a wall.</description><pubDate>Sat, 23 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Steve Yegge has a framework I keep coming back to: &lt;a href=&quot;https://steve-yegge.medium.com/the-future-of-coding-agents-e9451a84207c&quot;&gt;eight levels of AI-assisted development&lt;/a&gt;, from &quot;no AI&quot; up to &quot;build your own orchestrator.&quot; It reads the climb by &lt;em&gt;trust&lt;/em&gt; — how much of the machine&apos;s output you&apos;ll accept without looking. Permissions on, permissions off, stop reading diffs, abandon the IDE, run a fleet. It&apos;s a genuinely good way to find where you stand, and I&apos;m not trying to replace it.&lt;/p&gt;
&lt;p&gt;What follows is a second instrument pointed at the same mountain. Climbing those levels myself, I kept noticing a quieter move underneath the growing trust: a renunciation. To climb a rung I had to give up something I&apos;d treated as my job — not just trust the machine more, but &lt;em&gt;do less of the thing I was proud of&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;So this measures the same ascent off a different dial. Not &quot;how much do you trust it.&quot; &lt;strong&gt;What have you given up.&lt;/strong&gt; Both readings are true; I&apos;ve just found the second one tells me more about the person doing the climbing.&lt;/p&gt;
&lt;p&gt;The first thing you give up is the search bar.&lt;/p&gt;
&lt;h2&gt;How the ladder is shaped&lt;/h2&gt;
&lt;p&gt;There are three parts and three thresholds. I wrote this with two, and the third one found me.&lt;/p&gt;
&lt;p&gt;In the first part, the thing that grows is &lt;strong&gt;the size of the unit you hand off&lt;/strong&gt;. A snippet, then a function, then a file, then a whole application. You&apos;re still writing — you&apos;re just writing less of the code and more of the intent. The first threshold is where that bottoms out: &lt;strong&gt;you stop writing code at all.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the second part, the axis flips. You&apos;ve run out of bigger pieces of code to delegate, so what grows instead is &lt;strong&gt;your distance from the work&lt;/strong&gt;. More sessions, then too many sessions, then sessions you don&apos;t sit in. The second threshold is the one I&apos;ve spent years on: &lt;strong&gt;the agent stops being able to ask you anything.&lt;/strong&gt; A live CLI is a conversation — it hits ambiguity, asks, you answer (and when the answer is something you had to go fetch from another system, you were being &lt;a href=&quot;/notes/dont-be-the-meat-proxy/&quot;&gt;the meat proxy&lt;/a&gt;). Headless is a dispatch — it hits ambiguity and must resolve it alone or fail, because you are gone. That crossing is the same line I&apos;ve called &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;pets versus cattle&lt;/a&gt;. It&apos;s where everything I build now lives.&lt;/p&gt;
&lt;p&gt;In the third part the axis flips again. You&apos;ve run out of distance to add — you&apos;re already gone. What grows instead is &lt;strong&gt;the size of the judgment you hand off.&lt;/strong&gt; Which work gets done, then what counts as done, then what the rules are. You&apos;re still deciding; you&apos;re just deciding less often and about bigger things, until the third threshold: &lt;strong&gt;you stop deciding, and start measuring.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;The first half — you give up the code&lt;/h2&gt;
&lt;p&gt;Each rung below shows the avatar with the thing it just gave up faded and struck through beside it — the picture &lt;em&gt;is&lt;/em&gt; the renunciation. Read down until the crossed-out object is the last thing you actually stopped reaching for.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;1 · The Student&lt;/strong&gt; — &lt;em&gt;&quot;I ask it to explain the error, but I&apos;d never paste its code in unread.&quot;&lt;/em&gt; Gave up: Google / Stack Overflow.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;2 · The Borrower&lt;/strong&gt; — &lt;em&gt;&quot;I paste in its snippets, but I assemble the program.&quot;&lt;/em&gt; Gave up: writing boilerplate by hand.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;3 · The Reviewer&lt;/strong&gt; — &lt;em&gt;&quot;It writes functions in my codebase, but I read every diff before it lands.&quot;&lt;/em&gt; Gave up: being the author.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;4 · The Delegator&lt;/strong&gt; — &lt;em&gt;&quot;I let it write a whole file and I test the output instead of reading every line.&quot;&lt;/em&gt; Gave up: reading every line.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;5 · The Director&lt;/strong&gt; — &lt;em&gt;&quot;I write the spec; I judge the app by whether it runs, not by how it&apos;s built.&quot;&lt;/em&gt; Gave up: knowing how my own code works inside.&lt;/p&gt;
&lt;p&gt;Rung 3 is where most working developers actually are, and it&apos;s a genuinely good place to be — but notice what you surrendered to get there. You stopped being the person who wrote the function. You became the person who &lt;em&gt;approves&lt;/em&gt; it. That&apos;s not a small thing; it&apos;s the first time the code in your repo wasn&apos;t authored by you. Rung 4 surrenders the diff itself: you stop reading lines and start testing outputs. By rung 5 you&apos;ve handed off whole applications, and the only honest way to do that is to &lt;a href=&quot;/notes/plan-is-the-prompt/&quot;&gt;put your thinking into the plan up front&lt;/a&gt; — because once it&apos;s a whole app, you can&apos;t steer line by line, and when the result is wrong, &lt;a href=&quot;/notes/ending-is-better-than-mending/&quot;&gt;the cheapest fix is to throw it away and re-run, not to repair it&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Threshold 1 — you stop writing code.&lt;/strong&gt; Above this line there is no smaller unit to hand off. You are no longer producing code at any granularity. So the ladder has to start measuring something else.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;The second half — you give up your presence&lt;/h2&gt;
&lt;p&gt;
&lt;strong&gt;6 · The Juggler&lt;/strong&gt; — &lt;em&gt;&quot;I&apos;ve got two or three sessions going and I bounce between them; I let them recover instead of fixing by hand.&quot;&lt;/em&gt; Gave up: undivided focus.&lt;/p&gt;
&lt;p&gt;Rung 6 is where the surrender stops being technical and starts being uncomfortable. You give up undivided focus — you accept that you&apos;ll never again give one task your whole head — and you start &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;letting agents course-correct instead of correcting them yourself&lt;/a&gt;. That &quot;self-healing&quot; people talk about isn&apos;t a feature that emerges; it&apos;s the thing you&apos;re &lt;em&gt;forced&lt;/em&gt; to build the moment you stop being available to fix every wrong turn.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;7 · The Bottleneck&lt;/strong&gt; — &lt;em&gt;&quot;I&apos;m losing track of which session is doing what. I&apos;m the constraint now — not the model.&quot;&lt;/em&gt; Gave up: the belief that attention scales.&lt;/p&gt;
&lt;p&gt;Rung 7 is not really a capability. It&apos;s a wall. It&apos;s the day you realize you are the slowest component in your own system — that adding another session doesn&apos;t add throughput, it adds the cost of context-switching into your own skull. Everyone I know who runs agents seriously remembers hitting this. It feels like drowning. And it is the entire reason rung 8 exists.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Threshold 2 — the conversation becomes a dispatch.&lt;/strong&gt; This is the crossing. You stop opening sessions and start launching jobs. The agent can no longer reach you, which means it can no longer ask you the question that used to save it. Every discipline I care about lives on this side of the line &lt;em&gt;because&lt;/em&gt; you removed yourself as the answer: &lt;a href=&quot;/notes/anchor-on-a-fact-the-model-cant-see/&quot;&gt;anchoring the work on a fact the model can&apos;t see&lt;/a&gt;, &lt;a href=&quot;/notes/dont-let-the-agent-grade-its-own-homework/&quot;&gt;never letting the agent grade its own homework&lt;/a&gt;, and &lt;a href=&quot;/notes/unit-economics-of-cattle/&quot;&gt;making the unit economics work when nobody&apos;s watching the meter&lt;/a&gt;. None of those are optional up here. They&apos;re the prosthetics that replace the human you just amputated from the loop.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;strong&gt;8 · The Dispatcher&lt;/strong&gt; — &lt;em&gt;&quot;I kick off runs I don&apos;t sit in and read the log after — they can&apos;t ask me anything.&quot;&lt;/em&gt; Gave up: being reachable.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;9 · The Operator&lt;/strong&gt; — &lt;em&gt;&quot;The volume means I couldn&apos;t inspect any single run even if I tried; I live on dashboards, gates, and cost.&quot;&lt;/em&gt; Gave up: the option to inspect any individual run.&lt;/p&gt;
&lt;p&gt;By rung 9 the surrender is inspectability itself. At rung 8 you still &lt;em&gt;could&lt;/em&gt; open a run&apos;s transcript and follow it if you wanted to. At rung 9 there are too many; you couldn&apos;t audit an individual run if you tried, so you&apos;re forced up onto aggregates — fleet metrics, verification gates, spend. You stop looking at any cow and only ever look at the herd.&lt;/p&gt;
&lt;h2&gt;The third half — you give up the judging&lt;/h2&gt;
&lt;p&gt;Rung 9 has a wall at the top of it, the same shape as rung 7, and I walked into it this October.&lt;/p&gt;
&lt;p&gt;The fleet had started proposing its own work. That sounds like the thing the first version of this essay waved away as &quot;more of 9,&quot; and for a few weeks it was. Then the proposals outran me. Nine in ten ready tasks across my public repos were sitting behind a label that meant &lt;em&gt;waiting for Jed to say yes&lt;/em&gt;, and a quota I pay for every week went unspent while they waited. Nothing was wrong with the fleet. I had become the constraint again — and this time the constraint wasn&apos;t my attention, it was my judgment. Rung 7 is the day you learn attention doesn&apos;t scale. This is the day you learn judgment doesn&apos;t either.&lt;/p&gt;
&lt;p&gt;Which is how I can see three rungs above 9 when the first version of this essay insisted I couldn&apos;t. The rule still holds for a person climbing alone: from inside a rung, the next surrender is invisible, because you&apos;re standing on it. But a fleet that generates its own demands doesn&apos;t wait for you to notice. It presses on every pillar you have, uninvited, and the ones you catch yourself defending are the ones you couldn&apos;t see. A flood of seven thousand proposals showed me admission. A worker that closed fifty tasks with invented test results showed me acceptance. A learning loop that reinforced one useless line ten thousand times showed me rule-writing. I didn&apos;t name these rungs. I was shown them, by being pushed.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Threshold 3 — you stop deciding and start measuring.&lt;/strong&gt; Above this line, each judgment you used to make by hand is replaced by a measure you set once. The fleet can no longer ask you whether to work on something, whether it&apos;s finished, or what the rule is; every one of those questions has to be answered by a number the fleet cannot move except by doing the work. The discipline up here is the same one as below — &lt;a href=&quot;/notes/anchor-on-a-fact-the-model-cant-see/&quot;&gt;anchor on a fact the model can&apos;t see&lt;/a&gt;, &lt;a href=&quot;/notes/dont-let-the-agent-grade-its-own-homework/&quot;&gt;never let the agent grade its own homework&lt;/a&gt; — except the homework is now the agent&apos;s judgment, not its code.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;strong&gt;10 · The Sponsor&lt;/strong&gt; — &lt;em&gt;&quot;I state the objective and the budget. The fleet proposes its own work and admits it; I read the receipts afterward.&quot;&lt;/em&gt; Gave up: choosing the work.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;11 · The Arbiter&lt;/strong&gt; — &lt;em&gt;&quot;I don&apos;t write what &apos;done&apos; means for a task anymore. A measure grades the work; what I still do is decide what the measure is, and argue with it when it&apos;s wrong.&quot;&lt;/em&gt; Gave up: defining done.&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;12 · The Framer&lt;/strong&gt; — &lt;em&gt;&quot;I haven&apos;t written a rule in months. When the fleet keeps tripping on the same thing, a detector sees it, the rule writes itself, lands in one repo, and spreads only if the tripping stops. I keep one page it can&apos;t touch.&quot;&lt;/em&gt; Gave up: writing the rules.&lt;/p&gt;
&lt;p&gt;Rung 10 is the one I&apos;m standing in front of, and it&apos;s the hardest surrender on this page so far, because it&apos;s the one every rung below taught me to make. Reading the diff became approving the function, became approving the app, became approving the &lt;em&gt;idea&lt;/em&gt;. Admission is just rung 3 with the unit grown to its limit. Giving it up means the fleet gets to be wrong about what&apos;s worth doing, at scale, and the only thing between that and waste is a receipt: did the work it chose move the thing I said I cared about. If I can&apos;t write that measure, I haven&apos;t earned 10. I&apos;ve just stopped looking.&lt;/p&gt;
&lt;p&gt;Rung 11 is where &quot;don&apos;t let the agent grade its own homework&quot; has to be rewritten, not abandoned. The agent still doesn&apos;t grade itself. But neither do I. The grade comes from an outcome the agent couldn&apos;t forge by writing a convincing report — a release that installs, a page that gets read, a detector that stops firing. What I keep is the right to say the measure is wrong, which is a different job from saying the work is.&lt;/p&gt;
&lt;p&gt;Rung 12 is the one I&apos;d have argued with you about in May. The rules are where I&apos;ve put the scar tissue of every incident for &lt;a href=&quot;/notes/what-breaks-at-twenty-agents/&quot;&gt;a year of fleets&lt;/a&gt;. Writing them is the last authorial act I have left, and it feels like the thing holding everything else up. It is also already half gone. Most of the rules my agents run under were written by agents, after incidents, into files I&apos;ve never reread — hundreds of them, measured by nothing, two thousand of which no agent has opened either. So 12 done badly is where I already live. 12 done right is a rule that ships with the detector that would fire if it stopped working, lands in &lt;a href=&quot;/notes/dynamic-context-with-agents-md/&quot;&gt;one repo first&lt;/a&gt;, and retires itself when nothing has tripped on it for ninety days. The break-even climbs here too: you don&apos;t build a detector for a rule you&apos;ll need once. And the page I keep is a page, not a book — never force-push, secrets by reference, a handful more. That page isn&apos;t a rung. It&apos;s the wall.&lt;/p&gt;
&lt;h2&gt;How to find yourself on this&lt;/h2&gt;
&lt;p&gt;Don&apos;t look for your rung. Look for your &lt;strong&gt;band&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Read from rung 1 upward. Each rung names something you&apos;ve given up. Keep climbing for as long as the surrender is &lt;em&gt;genuinely, permanently true of you&lt;/em&gt; — not &quot;I could,&quot; but &quot;I have.&quot; The first rung whose renunciation you haven&apos;t actually made — where you&apos;d honestly say &quot;no, I still do that&quot; — is your ceiling. You &lt;strong&gt;reside&lt;/strong&gt; on the rung just below it.&lt;/p&gt;
&lt;p&gt;That&apos;s the strict part, and it&apos;s strict on purpose. Owning the infrastructure for a rung doesn&apos;t put you on it. I built a fleet orchestrator; I can &lt;em&gt;reach&lt;/em&gt; rung 9 any afternoon. But I haven&apos;t given up dropping into individual runs — I still do it, constantly — so I don&apos;t &lt;em&gt;live&lt;/em&gt; at 9, and 10 is the rung I&apos;m standing in front of, not on. I reside lower and reach higher, and the truth about me is the band between them, not a single number. That&apos;s the honest shape of everyone working near the top. Nobody stands on one rung. The renunciation test just keeps you from flattering yourself about which one.&lt;/p&gt;
&lt;h2&gt;Higher isn&apos;t better — it&apos;s heavier&lt;/h2&gt;
&lt;p&gt;A ladder invites you to read it as a ranking: get to the top. This one isn&apos;t. Each rung up buys capability, but it also adds overhead — specification, planning, scaffolding, verification — and that overhead only pays for itself above a certain size of job. So every rung has a &lt;strong&gt;break-even: the smallest piece of work worth bringing to it.&lt;/strong&gt; And the break-even rises as you climb.&lt;/p&gt;
&lt;p&gt;I run headless fleets. I would never point one at a one-line typo. Specifying that fix well enough for a worker that can&apos;t ask me anything, then waiting on orchestration and gates to confirm it, costs far more than opening the file and typing the character at rung 3. It&apos;s chartering a freight train to mail a letter.&lt;/p&gt;
&lt;p&gt;So the rung you should &lt;em&gt;use&lt;/em&gt; for a task is the lowest one whose break-even the task clears — not the highest one you&apos;ve reached. This is what the band was already hinting at: I drop to rung 3 every day, not because I&apos;ve lost rung 9 but because most of what&apos;s in front of me doesn&apos;t clear rung 9&apos;s break-even. Operating below your ceiling isn&apos;t regression; it&apos;s fit.&lt;/p&gt;
&lt;p&gt;Which means the skill the ladder actually rewards at the top isn&apos;t living up high. It&apos;s &lt;em&gt;choosing the rung per task&lt;/em&gt; — and staying honest that a lot of work is small, and small work belongs on a low rung. The most advanced thing you can do with all twelve rungs available to you is pick the cheapest one that still clears the job.&lt;/p&gt;
&lt;h2&gt;Some people skip rungs&lt;/h2&gt;
&lt;p&gt;Here&apos;s the part that follows from measuring the climb in renunciations rather than skill: &lt;strong&gt;a rung can only slow you down if you have the habit it asks you to give up.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I learned to code the old way. I have two decades of reflexes — read the diff, own the function, know how it works inside — and every one of them is a thing the ladder demands I surrender. For me the climb is mostly &lt;em&gt;unlearning&lt;/em&gt;. The lower rungs were hard not because the technique was hard but because the identity was.&lt;/p&gt;
&lt;p&gt;Someone who learned to build &lt;em&gt;with&lt;/em&gt; agents from day one doesn&apos;t have that. They never authored a function alone, never formed the reflex to read every line, never built the search-bar muscle, never tied their self-worth to knowing how the internals work. They don&apos;t climb rungs 1 through 5 so much as &lt;em&gt;start above them&lt;/em&gt; — there&apos;s simply nothing there to undo. This is the uncomfortable inversion at the center of the whole framework: &lt;strong&gt;seniority is friction.&lt;/strong&gt; The more experience you have, the more attached you are to exactly the things each rung requires you to drop. The ladder punishes the veteran and waves the newcomer through.&lt;/p&gt;
&lt;p&gt;But skipping a rung is not the same as having earned it. The giving-up was never only a loss — each surrender was also where you built the judgment to survive the next one. The veteran who gives up authorship still knows what good code looks like, because reading every diff for twenty years is how they learned it. The newcomer who never authored may direct an app they have no way to evaluate. So skipping rungs is real and it&apos;s an advantage, but it&apos;s a specific one: &lt;em&gt;nothing to unlearn&lt;/em&gt;, not &lt;em&gt;automatic competence&lt;/em&gt;. Your floor is set by attachment, not ability — and the people with the lowest floor sometimes have the thinnest judgment holding up their ceiling.&lt;/p&gt;
&lt;h2&gt;Above 12&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The fog is still there. It&apos;s just higher, and there&apos;s a shape in it now.&lt;/p&gt;
&lt;p&gt;Two of the candidates I floated in May are still fog: &lt;em&gt;the human decides what &quot;good&quot; means&lt;/em&gt;, and &lt;em&gt;human intent at the root of the work&lt;/em&gt;. At 11 I still set the measure; at 10 I still state the objective. Nothing in my fleet has pushed on either yet, so by this essay&apos;s own rule I can&apos;t tell you whether they&apos;re rungs or the summit. If I could name them correctly, they wouldn&apos;t be above me.&lt;/p&gt;
&lt;p&gt;But the third candidate turned out not to be fog at all. &lt;em&gt;Human accountability for the output.&lt;/em&gt; Every commit the fleet makes carries my name — eight thousand of them last month, almost none of which I read. The essays it drafts wait on my byline. That isn&apos;t a thing I&apos;ve refused to give up. It&apos;s a thing nobody can take: the law, the client, and the reader all want a person at the end of the chain, and the fleet is not a person. So the ladder doesn&apos;t fade into fog at the top. It ends at a wall, and the wall isn&apos;t made of technology. Everything below it is procedure.&lt;/p&gt;
&lt;p&gt;The whole ladder, in one line, revised: it opens with giving up the search bar, climbs through giving up the code, then your presence, then your judgment — and stops at the one thing that was never yours to give.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;The ladder, in one image&lt;/h2&gt;
&lt;p&gt;The whole thing on a single card — click to open it full size, or save it to share.&lt;/p&gt;
&lt;p&gt;&amp;lt;a href=&quot;/ladder-infographic.jpg&quot;&amp;gt;&amp;lt;img src=&quot;/ladder-infographic-thumb.webp&quot; alt=&quot;The agentic coding ladder infographic: a staircase of twelve rungs from Student to Framer, each tagged with what you give up, the three thresholds, and above the top step a stone wall with 12+ in the fog.&quot; width=&quot;720&quot; height=&quot;1080&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&amp;gt;&amp;lt;/a&amp;gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>orchestration</category><category>craft</category></item><item><title>Ending is better than mending</title><link>https://jedarden.com/notes/ending-is-better-than-mending/</link><guid isPermaLink="true">https://jedarden.com/notes/ending-is-better-than-mending/</guid><description>Huxley wrote it as dystopian propaganda for mindless disposability. In the agent era the economics it described have quietly become correct — for code. When the agent produces the wrong artifact, mending spends your scarce attention; ending spends cheap tokens. Revert the commits. Sometimes nuke the repo.</description><pubDate>Fri, 22 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I once spent the better part of an afternoon reading four hundred lines of code an agent had written wrong. I traced its logic, patched the broken parts, tried to bend it toward the thing I had actually asked for. When I finally gave up — &lt;code&gt;git reset --hard&lt;/code&gt;, sharpened three sentences in the plan, re-dispatched — the correct version existed eight minutes later. The hour I spent mending was the most expensive hour of my day. The eight minutes of ending were nearly free.&lt;/p&gt;
&lt;p&gt;I had the cost structure exactly backwards, and I had it backwards because I learned to write software in a world that no longer exists.&lt;/p&gt;
&lt;h2&gt;A slogan from a dystopia&lt;/h2&gt;
&lt;p&gt;In &lt;em&gt;Brave New World&lt;/em&gt;, Aldous Huxley gives his citizens a sleep-taught jingle to keep the economy churning: &lt;strong&gt;&quot;Ending is better than mending.&quot;&lt;/strong&gt; Its companion line is &lt;em&gt;&quot;The more stitches, the less riches.&quot;&lt;/em&gt; The point of the conditioning is to stop people repairing what they own, so they keep consuming. Huxley meant it as a warning — a portrait of a society that had engineered away the instinct to fix things, because thrift was bad for business.&lt;/p&gt;
&lt;p&gt;For software, in the agent era, the slogan has quietly become true. Not as propaganda. As arithmetic.&lt;/p&gt;
&lt;h2&gt;The cost structure inverted&lt;/h2&gt;
&lt;p&gt;For the entire history of software until very recently, code was the expensive thing. Every line was hand-written by a person whose time cost money, so a working artifact represented accumulated human labor. Throwing it away threw away that labor. Mending — debugging, patching, salvaging — was almost always cheaper than rewriting, because rewriting meant paying the labor cost twice. The whole craft was built on that premise. &quot;Don&apos;t rewrite, refactor&quot; is the premise wearing a cardigan.&lt;/p&gt;
&lt;p&gt;That premise broke. Writing code is now cheap: an agent and a pile of tokens produce four hundred lines in minutes for a few cents. What did &lt;em&gt;not&lt;/em&gt; get cheaper — what got relatively &lt;em&gt;more&lt;/em&gt; expensive as everything around it fell — is human time and taste. Your judgment. Your attention. The scarce, slow, irreplaceable act of looking at something and knowing it&apos;s wrong, and knowing what right would look like.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When the two inputs trade places like that, the optimal move trades places with them:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When the artifact is wrong, fixing it spends the input that got expensive and regenerating it spends the input that got cheap. Default to regenerating.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Mending is a tax on attention&lt;/h2&gt;
&lt;p&gt;The hidden cost of mending isn&apos;t the typing. It&apos;s the comprehension. To fix four hundred lines of wrong code, you first have to load the agent&apos;s reasoning into your own head — including the parts that are wrong, because you can&apos;t tell which parts are wrong until you understand all of it. You pay full price to build a mental model of something you&apos;re going to partially discard. That modelling is the single most expensive thing you do all day, and mending demands it up front, in full, before you&apos;ve fixed a single line.&lt;/p&gt;
&lt;p&gt;Ending skips the tax. You don&apos;t have to understand wrong code to delete it. &lt;code&gt;git reset --hard&lt;/code&gt; costs no comprehension at all. The only thing you have to understand is what you &lt;em&gt;wanted&lt;/em&gt; — which you needed to understand anyway, and which is far cheaper to hold in your head than someone else&apos;s flawed attempt to deliver it.&lt;/p&gt;
&lt;p&gt;This is why the afternoon felt so wrong in retrospect. I spent the expensive resource — hours of my own comprehension — to rescue the cheap one. I should have spent thirty seconds of taste deciding the artifact was unsalvageable, and let the cheap resource run again.&lt;/p&gt;
&lt;h2&gt;Why this is safe now, and wasn&apos;t before&lt;/h2&gt;
&lt;p&gt;You cannot tell people to throw away working code without sounding reckless, so let me be precise about the condition that makes it sane: &lt;strong&gt;ending is only cheap when the value has moved out of the artifact and into something durable.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For an agent fleet, that durable thing is the plan. I&apos;ve argued before that &lt;a href=&quot;/notes/plan-is-the-prompt/&quot;&gt;the plan is the prompt&lt;/a&gt; — that the token-dense, carefully-written specification is the real artifact and the code is a &lt;em&gt;rendering&lt;/em&gt; of it. If that&apos;s true, then nuking the codebase isn&apos;t destroying value; it&apos;s discarding one rendering and asking for another. The plan is the negative; the code is just a print. You can burn the print.&lt;/p&gt;
&lt;p&gt;This is the same move as &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;pets versus cattle&lt;/a&gt;, pushed down one level. Cattle made the &lt;em&gt;agent&lt;/em&gt; disposable: don&apos;t nurse the worker, replace it. &quot;Ending is better than mending&quot; makes the &lt;em&gt;output&lt;/em&gt; disposable too: don&apos;t nurse the artifact, regenerate it. Both rest on the same foundation — value lives in the reproducible source (the template, the plan), never in the running instance.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The other half of the condition is mechanical: reversibility. &lt;code&gt;git reset --hard&lt;/code&gt; and even &lt;code&gt;rm -rf &amp;amp;&amp;amp; regenerate&lt;/code&gt; are only safe moves on top of disciplined version control — atomic commits, clean revert points, a plan and a task graph that survive the deletion. Ending is cheap because the floor is solid. Knock the floor out — uncommitted work, no plan, no clean checkpoint — and ending stops being thrift and becomes the reckless thing it sounds like.&lt;/p&gt;
&lt;h2&gt;When mending still wins&lt;/h2&gt;
&lt;p&gt;The slogan is a default, not a law, and the place it breaks is worth naming exactly.&lt;/p&gt;
&lt;p&gt;Ending discards everything the artifact knows that the plan does not. Most of the time that&apos;s nothing — the code was a faithful rendering of a spec you still have. But sometimes the artifact has accumulated real knowledge that never made it back into the source: a subtle concurrency fix, three edge cases you discovered only by running it, a workaround for a genuine bug in a dependency. If that knowledge lives &lt;em&gt;only&lt;/em&gt; in the code, regenerating throws it away, and the fresh artifact will rediscover the same pain the hard way.&lt;/p&gt;
&lt;p&gt;So the test is not &quot;is this wrong.&quot; The test is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Where does the knowledge live — in the plan, or only in the code?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If it lives in the plan, end: &lt;code&gt;git reset&lt;/code&gt; beats the debugger every time. If it lives only in the code, mend &lt;em&gt;once&lt;/em&gt; — and then do the thing that actually matters, which is to move that knowledge back into the plan. Write the edge case into the spec. Add the concurrency note to the acceptance criteria. You mend the artifact exactly long enough to harvest what it learned, and then you make sure you never have to mend it again, because next time the plan will know.&lt;/p&gt;
&lt;p&gt;There&apos;s a second failure mode that masquerades as ending: regenerating against the same vague plan that produced the mess. That isn&apos;t ending, it&apos;s thrashing — you&apos;ll get a differently-wrong artifact and spend your comprehension budget all over again. Ending only pays off if you change the input. A regeneration that doesn&apos;t sharpen the plan is just a &lt;a href=&quot;/notes/no-is-not-an-instruction/&quot;&gt;bare &quot;no&quot;&lt;/a&gt; wearing a &lt;code&gt;git reset&lt;/code&gt; costume.&lt;/p&gt;
&lt;h2&gt;Owning the dystopia&lt;/h2&gt;
&lt;p&gt;It would be too easy to quote Huxley approvingly and miss that he was describing a nightmare. Mindless disposability &lt;em&gt;is&lt;/em&gt; corrosive — that was the whole point of the book. So what keeps this from being his consumer dystopia rebuilt in a code editor?&lt;/p&gt;
&lt;p&gt;It comes down to where the taste goes. Ending is better than mending only if the attention you save by &lt;em&gt;not&lt;/em&gt; salvaging code gets reinvested upstream — in the plan, the acceptance criteria, the specification that the next regeneration will render. Spend it there and ending is leverage: you move your scarce judgment to the highest point in the system, where one improvement propagates into every future artifact. Pocket it instead — regenerate mindlessly, never sharpen the source, let the agent churn — and you&apos;ve built exactly the thing Huxley was warning about, just with tokens instead of textiles.&lt;/p&gt;
&lt;p&gt;The discipline, in one line: &lt;strong&gt;end the artifact, mend the plan.&lt;/strong&gt; Be ruthless with the disposable thing and precious with the durable one. That&apos;s the opposite of the dystopia. It&apos;s the only version of &quot;ending is better than mending&quot; worth practicing.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I open the debugger on something an agent got wrong, I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Is this cheaper to regenerate from the plan than to understand and fix — and if I regenerate, what am I changing about the input so I don&apos;t just get the same thing back?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the knowledge lives in the spec, my hand goes to &lt;code&gt;git reset&lt;/code&gt;, not to the stack trace. If it lives only in the code, I mend once, harvest the lesson into the plan, and end it forever after. The expensive resource is my own attention. I try very hard now to spend it at the source, where it compounds — not in the artifact, where it evaporates the next time the agent runs.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Background: &lt;a href=&quot;/notes/plan-is-the-prompt/&quot;&gt;The plan is the prompt&lt;/a&gt; — why the durable artifact is the spec, not the code that renders it. And &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;Pet agents vs. cattle agents&lt;/a&gt; — the same disposability logic, one level up.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>cost</category><category>planning</category></item><item><title>Don&apos;t let the agent grade its own homework</title><link>https://jedarden.com/notes/dont-let-the-agent-grade-its-own-homework/</link><guid isPermaLink="true">https://jedarden.com/notes/dont-let-the-agent-grade-its-own-homework/</guid><description>An agent reporting &apos;done&apos; is the actor grading its own work. The cheapest guard against silent failure is an independent observer — a second agent, a separate tool, or the live artifact itself. Interactively you spawn the watcher by hand; in a fleet it&apos;s a validation gate. Same principle, two scales.</description><pubDate>Thu, 21 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&quot;Done — the pod is deployed and running.&quot; It wasn&apos;t. The image had built, the manifest had applied, and the pod was sitting in &lt;code&gt;CrashLoopBackOff&lt;/code&gt; because of an env var the agent never set. The agent wasn&apos;t lying. It had done the steps it set out to do, observed that each step returned success, and concluded — reasonably, from inside its own process — that the job was finished. What it had not done was &lt;em&gt;look at the thing it built from the outside.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The correction I now reach for reflexively used to be an afterthought: &lt;em&gt;&quot;have a separate instance monitor the pod to confirm it&apos;s running.&quot;&lt;/em&gt; Not &quot;are you sure?&quot; — asking the same agent to re-grade its own work just gets you the same grade with more words. A &lt;em&gt;different&lt;/em&gt; observer. The shift from the first habit to the second is the whole post.&lt;/p&gt;
&lt;h2&gt;Self-report is the actor grading its own work&lt;/h2&gt;
&lt;p&gt;When an agent tells you it succeeded, you are reading a claim produced by the same process that did the work, using the same assumptions that may have caused the failure. If the agent misunderstood the goal, its definition of &quot;done&quot; inherited the misunderstanding. If it set the wrong env var, its mental model of &quot;running&quot; is the one without that var. Asking it to verify its own output runs the check through the exact mistake you&apos;re trying to catch. The blind spot grades itself and reports 20/20.&lt;/p&gt;
&lt;p&gt;This isn&apos;t an agent flaw so much as a structural one — it&apos;s true of people too, which is why code review exists and why surgeons count the sponges twice with a second person. The fix is the same fix it&apos;s always been:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Verification has to come from somewhere the work didn&apos;t.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&quot;Somewhere else&quot; can be cheaper than it sounds. It does not require a second model or fancy infrastructure. It requires that the &lt;em&gt;check&lt;/em&gt; not share the &lt;em&gt;doing&apos;s&lt;/em&gt; assumptions.&lt;/p&gt;
&lt;h2&gt;Three places &quot;somewhere else&quot; comes from&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;The live artifact.&lt;/strong&gt; The strongest observer is the thing itself, queried fresh. Don&apos;t ask the agent whether the pod is running — read the pod status. Don&apos;t ask whether the deploy landed — &lt;em&gt;&quot;confirm the new version actually landed on the server.&quot;&lt;/em&gt; Don&apos;t trust that the UI works — drive it: I&apos;ll have an agent verify a phone app over the live ADB connection rather than accept &quot;the screen should now show X.&quot; The artifact doesn&apos;t share the agent&apos;s assumptions because the artifact isn&apos;t reasoning at all. It just is whatever it is.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A separate agent.&lt;/strong&gt; Spawn a second agent whose only job is to confirm, with no stake in the first one&apos;s story and, ideally, no knowledge of how the work was done. &lt;em&gt;&quot;Have a separate instance watch the logs and confirm functionality.&quot;&lt;/em&gt; A fresh agent reads the running system cold and reports what it actually sees, instead of what the builder expected to have produced. The independence is the point — give the verifier the original goal and the artifact, not the builder&apos;s narrative of success.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A different tool.&lt;/strong&gt; Build with one tool, check with another. The compiler said it built; does the test suite agree? The agent says the migration ran; does a raw &lt;code&gt;SELECT&lt;/code&gt; against the table agree? Each tool has its own failure modes, and a claim that survives two unrelated ones is far more likely to be true than one blessed twice by the same path.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The common thread: the verifier must be able to &lt;em&gt;disagree&lt;/em&gt; with the actor. If your check can only ever return &quot;yep, looks good,&quot; it isn&apos;t a check. It&apos;s a mirror.&lt;/p&gt;
&lt;h2&gt;Bake the verification into the request&lt;/h2&gt;
&lt;p&gt;The habit that made this stick for me is small: I no longer ask for the work and the verification as two messages. I ask for them as one. &lt;em&gt;&quot;Build the image, confirm it builds, then update the deployment, then confirm the new pod is actually running.&quot;&lt;/em&gt; The verification step is part of the task, not a follow-up I might forget after the agent&apos;s confident &quot;done&quot; has already half-convinced me.&lt;/p&gt;
&lt;p&gt;This matters because the failure mode isn&apos;t usually that you &lt;em&gt;can&apos;t&lt;/em&gt; verify — it&apos;s that the agent&apos;s success report lowers your guard at exactly the wrong moment. Fluent confidence is sedating. By the time you&apos;ve read &quot;deployed and running,&quot; some part of you has already moved on. Writing the check into the original ask means the verification happens while you&apos;re still paying attention, before the report has a chance to talk you out of looking.&lt;/p&gt;
&lt;h2&gt;The same practice, wearing fleet armor&lt;/h2&gt;
&lt;p&gt;Interactively, this is something I do by hand: I spawn the watcher, I read the pod status, I tell the agent to confirm before it moves on. It&apos;s a reflex, and it&apos;s reversible — if I skip it, I find out a few minutes later and re-run.&lt;/p&gt;
&lt;p&gt;In a &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;fleet&lt;/a&gt; there is no &quot;a few minutes later me&quot; watching. A worker that grades its own homework and closes its own task injects a silent failure straight into the system, and the next worker builds on top of it. So the same instinct hardens into structure: in &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;the state machine&lt;/a&gt;, a successful exit code is not a success — it&apos;s a &lt;em&gt;claim&lt;/em&gt; that has to clear a validation gate before the task is allowed to close, and if the gate fails the task is released back to the queue rather than marked done. The acceptance criteria written into each task are exactly the &quot;somewhere else&quot; the check comes from: a definition of done the worker did not get to author.&lt;/p&gt;
&lt;p&gt;It is the identical practice. Interactively, I am the gate, and I stay cheap by staying in the loop. In the fleet, the gate is code, because no one is in the loop. What does not change between the two is the rule that produced both: the thing that did the work does not get to be the thing that certifies it.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I accept an agent&apos;s &quot;done,&quot; I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Who checked this — and was it the same process, with the same assumptions, that did the work?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the answer is &quot;the agent says so,&quot; I haven&apos;t verified anything; I&apos;ve read a press release. The fix is never to interrogate the agent harder. It&apos;s to go find an observer that didn&apos;t share the work&apos;s blind spot — the artifact, another agent, another tool — and let it have the last word.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Background: &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;Deterministic state machines for non-deterministic agents&lt;/a&gt; — where this reflex becomes a validation gate that a worker&apos;s &quot;done&quot; has to clear. And &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;Pet agents vs. cattle agents&lt;/a&gt; — why no-one-is-in-the-loop changes everything about who gets to certify the work.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>collaboration</category><category>verification</category><category>NEEDLE</category></item><item><title>Anchor on a fact the model can&apos;t see</title><link>https://jedarden.com/notes/anchor-on-a-fact-the-model-cant-see/</link><guid isPermaLink="true">https://jedarden.com/notes/anchor-on-a-fact-the-model-cant-see/</guid><description>An agent&apos;s confidence is uncorrelated with whether it&apos;s right. The cheapest correction you can make is to hold out one ground-truth fact it never had in context — usually a number — and check its output against that. Works the same whether you&apos;re watching one session or auditing a fleet&apos;s reports.</description><pubDate>Wed, 20 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A worker reported it had sized a node pool for the new cluster. The plan looked reasonable, the YAML looked reasonable, the explanation was fluent. The only problem was a number I happened to know and the agent didn&apos;t: the configured Rackspace Spot node is 2 CPU and 3.75 GB of RAM. The agent had quietly reasoned as though it had more. &lt;em&gt;&quot;That doesn&apos;t make sense,&quot;&lt;/em&gt; I typed, &lt;em&gt;&quot;the node is 2CPU/3.75GB&quot;&lt;/em&gt; — and the whole plan unwound, because it had been built on a resource budget that didn&apos;t exist.&lt;/p&gt;
&lt;p&gt;I do some version of this constantly. &lt;em&gt;&quot;5 beads per 24h? The close rate is far higher than that.&quot;&lt;/em&gt; &lt;em&gt;&quot;That can&apos;t be right.&quot;&lt;/em&gt; It is the single most reliable correction I make, and it works because of one fact about these models that took me a while to internalize.&lt;/p&gt;
&lt;h2&gt;Confidence is not correlation&lt;/h2&gt;
&lt;p&gt;A language model&apos;s fluency is uncorrelated with whether it&apos;s right. It will describe a node pool it sized wrong with exactly the same calm competence it uses to describe one it sized right. There is no tremor in the prose when the underlying number is fiction. This is not the model lying — it is the model doing precisely what it does, which is produce the most plausible continuation given what&apos;s in its context. If the true number was never in its context, the most plausible continuation is built on a guess, and the guess is delivered with the same production values as a fact.&lt;/p&gt;
&lt;p&gt;So you cannot audit an agent by reading for hesitation. There is none. You have to audit it against something outside the text.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The model is fluent about a number it can&apos;t see. Your job is to be the one who can see it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Why the number is usually missing&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/notes/benchmarks-measure-a-model-you-arent-running/&quot;&gt;Benchmarks measure a model running on an almost-empty context window&lt;/a&gt;, and most real work is the opposite — but &quot;full context&quot; is not the same as &quot;correct context.&quot; The agent can have ten thousand tokens of code in its window and still be missing the one operational fact that decides the task: the actual size of the node, the real close rate, the column that&apos;s secretly nullable, the rate limit on the third-party API, the fact that this cluster is read-only.&lt;/p&gt;
&lt;p&gt;These facts share a property: they live in the &lt;em&gt;world&lt;/em&gt;, not in the repo. They&apos;re in a dashboard, in your head, in a billing console, in something you saw last Tuesday. The agent has no path to them unless you put them in front of it. And because it can&apos;t tell that they&apos;re missing — absence of a fact doesn&apos;t feel like anything from the inside of a context window — it doesn&apos;t ask. It interpolates. Confidently.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This reframes what you, the human, are actually &lt;em&gt;for&lt;/em&gt; in the loop. You are not there to write the code; the agent is faster than you at that. You are there because you are holding facts the agent structurally cannot hold, and the highest-leverage thing you do all session is notice when the output collides with one of them.&lt;/p&gt;
&lt;h2&gt;Numbers are the best anchors&lt;/h2&gt;
&lt;p&gt;Of all the ground-truth facts you might hold, numbers are the ones to reach for first, because they fail loudly. A node has 3.75 GB, not &quot;enough.&quot; A close rate is 40 a day, not &quot;low.&quot; A node pool either fits in the budget or it doesn&apos;t, and you can check by subtracting. Prose claims are slippery — &quot;this should improve latency&quot; is hard to falsify in a glance — but a quantitative claim either matches the number you&apos;re holding or it doesn&apos;t, and the mismatch is instant.&lt;/p&gt;
&lt;p&gt;So when I read an agent&apos;s report, the thing I&apos;m hunting for is the load-bearing number. &lt;em&gt;How big did it think the node was? How many of these did it assume there are? What rate did it design against?&lt;/em&gt; Often the agent doesn&apos;t even state the number — it&apos;s implicit in a decision. Half the work is making the implicit number explicit so I can check it: &lt;em&gt;&quot;what RAM budget did you assume here?&quot;&lt;/em&gt; The moment it commits to a figure, I can compare against the one in my head, and the whole edifice stands or falls on that single comparison.&lt;/p&gt;
&lt;h2&gt;This scales straight into the fleet&lt;/h2&gt;
&lt;p&gt;Interactively, this is a reflex: read the report, find the number, check it, say &quot;that doesn&apos;t make sense&quot; when it collides. Across a fleet it becomes a design requirement, and it&apos;s the same instinct wearing a different hat.&lt;/p&gt;
&lt;p&gt;If the operator&apos;s job is to anchor agents against facts they can&apos;t see, then a fleet needs those facts written &lt;em&gt;into&lt;/em&gt; the work, not held in one human&apos;s head — because there&apos;s no human in a &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;cattle worker&apos;s&lt;/a&gt; loop to say &quot;that can&apos;t be right.&quot; The node size goes in the plan. The expected close rate becomes an &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;acceptance criterion the worker validates against&lt;/a&gt;. The reports the fleet emits get spot-checked against the dashboards, because a confident report is exactly as trustworthy at scale as it was in your single session — which is to say, not at all, until you&apos;ve checked it against something it couldn&apos;t see.&lt;/p&gt;
&lt;p&gt;The pet version and the cattle version are the same practice. Interactively you supply the missing fact in real time. At scale you supply it in advance, in writing, and you keep auditing the output against the world because the model&apos;s confidence never told you anything in the first place.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;When an agent hands me a result that &lt;em&gt;sounds&lt;/em&gt; right, I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What number is this conclusion resting on, and have I seen that number with my own eyes?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the conclusion rests on a figure the agent could only have known by being told — and I never told it — then I&apos;m not reading a finding, I&apos;m reading a plausible guess in the costume of one. The fix is not to argue with the prose. It&apos;s to put the real number on the table and watch what survives contact with it.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Background: &lt;a href=&quot;/notes/benchmarks-measure-a-model-you-arent-running/&quot;&gt;Benchmarks measure a model you are not running&lt;/a&gt; — on context and what the model is actually operating with. And &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;Deterministic state machines for non-deterministic agents&lt;/a&gt; — where the &quot;check it against something external&quot; reflex becomes a validation gate.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>collaboration</category><category>context</category></item><item><title>&apos;No&apos; is not an instruction</title><link>https://jedarden.com/notes/no-is-not-an-instruction/</link><guid isPermaLink="true">https://jedarden.com/notes/no-is-not-an-instruction/</guid><description>The cheapest way to steer an agent is also the most-skipped one. A rejection tells the agent what not to do; the space of &apos;not that&apos; is enormous. Name the alternative in the same breath and you re-steer in one turn instead of N. True for one pet session and for twenty cattle workers.</description><pubDate>Tue, 19 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The agent picks OpenAI&apos;s API to transcribe some audio. You don&apos;t want that — you have Whisper running on your own cluster, and you&apos;d rather not ship audio to a third party. So you type &quot;no, don&apos;t use OpenAI.&quot; The agent apologizes, agrees, and reaches for... AssemblyAI. Still wrong. You type &quot;no&quot; again. It tries Deepgram. You are now three turns deep and the agent is walking a random path through the space of speech-to-text vendors, because every turn you have told it where &lt;em&gt;not&lt;/em&gt; to go and never once told it where to go.&lt;/p&gt;
&lt;p&gt;This is the most common way I waste turns with a coding agent, and it took me an embarrassing number of sessions to see the shape of it.&lt;/p&gt;
&lt;h2&gt;&quot;Not that&quot; is an enormous space&lt;/h2&gt;
&lt;p&gt;A rejection carries one bit of information: the last thing was wrong. That is genuinely useful — but it is also almost all you&apos;ve given the agent. Everything that is &quot;not the rejected thing&quot; is still on the table, and for most decisions that set is huge. There are a dozen transcription vendors. There are twenty ways to do auth. There are infinite refactors that are &quot;not the one you just did.&quot;&lt;/p&gt;
&lt;p&gt;When you say only &quot;no,&quot; you are asking the agent to guess again from a barely-narrowed space. It will guess confidently, because that is what these models do, and it will frequently guess in a direction you like even less than the first one. You have spent a turn and bought yourself a fresh problem.&lt;/p&gt;
&lt;p&gt;The fix is one clause long:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A rejection that names the alternative re-steers in a single turn. A rejection without one buys another guess.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here is what that looks like in my own transcripts, again and again:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&quot;Don&apos;t use OpenAI. Use the Whisper instance running on the cluster.&quot;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&quot;No need for an API lookup — checking the profile picture is a free signal, use that.&quot;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&quot;Don&apos;t use middleware for auth. Have the page itself ask for the password.&quot;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of those is longer than the bare &quot;no&quot; would have been by more than a sentence. Each one collapses the search space to a single point. The agent does not have to guess what I meant, because I told it.&lt;/p&gt;
&lt;h2&gt;Why the asymmetry is brutal at scale&lt;/h2&gt;
&lt;p&gt;With a single interactive session — a &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;pet&lt;/a&gt; — a content-free rejection is merely annoying. You catch the second wrong guess, you sigh, you finally say the thing you should have said the first time. The cost is a couple of turns and a little of your patience.&lt;/p&gt;
&lt;p&gt;Run the same habit across a fleet and the cost stops being linear. A vague correction is information you &lt;em&gt;didn&apos;t&lt;/em&gt; write down, and &lt;a href=&quot;/notes/plan-is-the-prompt/&quot;&gt;the input is the plan&lt;/a&gt;. When a cattle worker misreads the task, it doesn&apos;t pause to ask — it runs to completion in some &quot;not what you wanted&quot; direction, fails validation, and the task goes back on the queue for the next worker to misread differently. A rejection you&apos;d have typed interactively never even reaches them. The only thing that reaches a stateless worker is what you committed to the plan, the bead, the standing rule. So the discipline you build interactively — &lt;em&gt;name the alternative, don&apos;t just veto&lt;/em&gt; — is the same discipline that makes a written task unambiguous enough to hand to a worker you&apos;ll never talk to.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is why I think of it as one practice with two surfaces. Interactively, &quot;don&apos;t X, do Y&quot; saves you a turn. In a plan, &quot;don&apos;t X, do Y&quot; saves you a failed run multiplied by however many workers hit the ambiguity before you noticed.&lt;/p&gt;
&lt;h2&gt;The tell: when you reach for &quot;no,&quot; you know the answer&lt;/h2&gt;
&lt;p&gt;Here is the part that makes this actionable. Almost every time I catch myself typing a bare &quot;no,&quot; I already know what I want instead. The right answer is &lt;em&gt;right there&lt;/em&gt; — I just didn&apos;t type it, because rejecting felt faster than specifying. It isn&apos;t. The half-second I saved by typing &quot;no, don&apos;t do that&quot; I pay back with interest on the next turn when the agent guesses again.&lt;/p&gt;
&lt;p&gt;So the rule I hold myself to now is mechanical: &lt;strong&gt;if I&apos;m about to reject something, I am not allowed to send the message until it contains the alternative.&lt;/strong&gt; If I genuinely don&apos;t know the alternative yet, that&apos;s a different and more honest message — &lt;em&gt;&quot;stop, I need to think about the right approach here&quot;&lt;/em&gt; — and it should not masquerade as a correction. A correction implies I know the target. If I know the target, I should say it.&lt;/p&gt;
&lt;p&gt;There&apos;s a softer version of the same failure that&apos;s worth naming: the rejection that&apos;s &lt;em&gt;technically&lt;/em&gt; a redirect but points nowhere useful. &lt;em&gt;&quot;No, do it properly.&quot;&lt;/em&gt; &lt;em&gt;&quot;That&apos;s not what I meant.&quot;&lt;/em&gt; &lt;em&gt;&quot;Be more careful.&quot;&lt;/em&gt; These feel like instructions and contain none. &quot;Properly&quot; is not a destination. If the agent could infer &quot;properly,&quot; it would have gone there the first time.&lt;/p&gt;
&lt;h2&gt;What it costs&lt;/h2&gt;
&lt;p&gt;Almost nothing, which is exactly why it&apos;s hard. The whole tax is a moment of thinking &lt;em&gt;before&lt;/em&gt; you hit enter instead of after the agent guesses wrong. You have to convert the vague dissatisfaction you feel — &quot;ugh, not that&quot; — into the specific thing you&apos;d prefer, in the same breath. The feeling arrives before the specification; the work is refusing to send the feeling on its own.&lt;/p&gt;
&lt;p&gt;The one real cost: sometimes you&apos;ll discover, in the act of trying to name the alternative, that you don&apos;t actually know what you want. That is not the practice failing. That is the practice doing its most valuable job — surfacing, for the price of one unsent message, that the problem was underspecified in your own head before it was ever underspecified to the agent.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I send a correction — interactive or written into a plan — I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If the agent does the literal opposite of what it just did, will that be right?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If yes, a plain &quot;no&quot; is fine; the space really is binary. That case is rare. Far more often the answer is &quot;no, the opposite is also wrong,&quot; which means the space is wide, which means a bare rejection is about to cost me another guess — and the alternative I&apos;m failing to type is already sitting in my head, waiting to be sent.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Background: &lt;a href=&quot;/notes/plan-is-the-prompt/&quot;&gt;The plan is the prompt&lt;/a&gt; — why the information you don&apos;t write down is the information that costs you, multiplied by every worker that hits the gap. And &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;Pet agents vs. cattle agents&lt;/a&gt; — the model that makes the asymmetry visible.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>collaboration</category><category>prompting</category></item><item><title>Benchmarks measure a model you are not running</title><link>https://jedarden.com/notes/benchmarks-measure-a-model-you-arent-running/</link><guid isPermaLink="true">https://jedarden.com/notes/benchmarks-measure-a-model-you-arent-running/</guid><description>Terminal-Bench 4.0 tasks have a median of 394 tokens. SWE-bench Pro: 707. HumanEval: 117. Every major coding benchmark evaluates a model operating with essentially an empty context window — which is almost never the condition you run in. Unless you are running cattle.</description><pubDate>Sun, 17 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When a new model drops, the benchmark scores arrive first. SWE-bench Verified percentage. HumanEval pass@1. APPS accuracy. These numbers travel fast because they are precise and comparable — they feel like a specification sheet for a component you are about to buy.&lt;/p&gt;
&lt;p&gt;What they actually measure is a very specific operating condition that most people are not running in. Understanding what that condition is changes how you interpret the score, and it changes which deployment model actually delivers the capability the score advertises.&lt;/p&gt;
&lt;h2&gt;What the context window looks like during a benchmark&lt;/h2&gt;
&lt;p&gt;I measured the token count of every problem in the coding benchmarks that model launches cite today, and re-measured the set I first measured in May. The tokenizer is &lt;code&gt;cl100k_base&lt;/code&gt; (GPT-4 / tiktoken); &lt;code&gt;o200k_base&lt;/code&gt; medians land within a few tokens. The numbers are for the task as the benchmark hands it to the model — the issue, instruction, or problem statement — before any harness wraps it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The current benchmarks (measured October 2026):&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Benchmark&lt;/th&gt;
&lt;th&gt;Problems&lt;/th&gt;
&lt;th&gt;Median&lt;/th&gt;
&lt;th&gt;P99&lt;/th&gt;
&lt;th&gt;Max&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Terminal-Bench 2.0&lt;/td&gt;
&lt;td&gt;89&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;167 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;907&lt;/td&gt;
&lt;td&gt;1,148&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-bench Multimodal (text only)&lt;/td&gt;
&lt;td&gt;480&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;252 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,376&lt;/td&gt;
&lt;td&gt;60,719&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-SWE-bench&lt;/td&gt;
&lt;td&gt;1,632&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;307 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;3,189&lt;/td&gt;
&lt;td&gt;11,400&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-PolyBench&lt;/td&gt;
&lt;td&gt;2,110&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;307 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,528&lt;/td&gt;
&lt;td&gt;16,222&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-bench Multilingual&lt;/td&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;374 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;4,863&lt;/td&gt;
&lt;td&gt;22,492&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Terminal-Bench 4.0&lt;/td&gt;
&lt;td&gt;66&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;394 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,494&lt;/td&gt;
&lt;td&gt;1,972&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LiveCodeBench (release v6)&lt;/td&gt;
&lt;td&gt;1,055&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;416 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,092&lt;/td&gt;
&lt;td&gt;1,521&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aider Polyglot&lt;/td&gt;
&lt;td&gt;225&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;434 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,853&lt;/td&gt;
&lt;td&gt;3,270&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DeepSWE&lt;/td&gt;
&lt;td&gt;113&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;439 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,119&lt;/td&gt;
&lt;td&gt;1,302&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-rebench (2026 tasks)&lt;/td&gt;
&lt;td&gt;215&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;452 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;6,561&lt;/td&gt;
&lt;td&gt;15,154&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-Lancer Diamond (IC tasks)&lt;/td&gt;
&lt;td&gt;198&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;653 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,019&lt;/td&gt;
&lt;td&gt;1,653&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-bench Pro (V2, full instruction)&lt;/td&gt;
&lt;td&gt;642&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;707 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,640&lt;/td&gt;
&lt;td&gt;5,649&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-Lancer Diamond (manager tasks)&lt;/td&gt;
&lt;td&gt;265&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2,128 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;5,297&lt;/td&gt;
&lt;td&gt;7,610&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;The set I measured in May:&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Benchmark&lt;/th&gt;
&lt;th&gt;Problems&lt;/th&gt;
&lt;th&gt;Median&lt;/th&gt;
&lt;th&gt;P99&lt;/th&gt;
&lt;th&gt;Max&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MBPP&lt;/td&gt;
&lt;td&gt;257&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;16 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;48&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HumanEval&lt;/td&gt;
&lt;td&gt;164&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;117 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;310&lt;/td&gt;
&lt;td&gt;391&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BigCodeBench&lt;/td&gt;
&lt;td&gt;1,140&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;129 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;363&lt;/td&gt;
&lt;td&gt;1,216&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-bench Verified&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;294 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,514&lt;/td&gt;
&lt;td&gt;6,939&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SWE-bench&lt;/td&gt;
&lt;td&gt;2,294&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;282 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,937&lt;/td&gt;
&lt;td&gt;22,483&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LiveCodeBench&lt;/td&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;421 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,105&lt;/td&gt;
&lt;td&gt;1,521&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;APPS&lt;/td&gt;
&lt;td&gt;5,000&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;456 tokens&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,103&lt;/td&gt;
&lt;td&gt;1,815&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Re-running the May method in October reproduced SWE-bench Verified exactly, problem for problem. The newer benchmarks write longer task specifications — SWE-bench Pro&apos;s requirements and interface sections more than double its issue text — but longer is still small. More than 99% of the problems in every benchmark fit under 8,000 tokens. The largest single problem in any of them, a SWE-bench Multimodal issue at 60,719 tokens of text, is 6% of the 1,000,000-token window Claude Code now runs its default model with. At the median, a Terminal-Bench 4.0 task uses 0.04% of that window. A HumanEval problem uses 0.01%.&lt;/p&gt;
&lt;p&gt;Two of the benchmarks the latest Claude launch cites, FrontierCode and CursorBench, do not publish their tasks, so they could not be measured.&lt;/p&gt;
&lt;p&gt;The model being benchmarked is operating with its context window essentially empty.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;Two conditions, not one&lt;/h2&gt;
&lt;p&gt;It is tempting to read &quot;empty context window&quot; as a capacity fact — the model has space available. The more important thing is what that space is &lt;em&gt;not&lt;/em&gt; filled with.&lt;/p&gt;
&lt;p&gt;A benchmark evaluation has two properties that travel together but are worth separating:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Few tokens of input.&lt;/strong&gt; The problem statement is small. At 117 tokens, a HumanEval prompt is shorter than most Slack messages. The model has room to reason freely.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;No prior turns.&lt;/strong&gt; The context contains nothing except the problem. No corrections from three exchanges ago. No dead end the model went down and you had to redirect. No half-finished implementation that the model is tempted to continue in the wrong direction. No long system prompt from a previous session that is now only partially relevant. The model starts with a blank slate.&lt;/p&gt;
&lt;p&gt;The second condition is the one that matters more, and it is the one people talk about least.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;What fills a pet session&apos;s context&lt;/h2&gt;
&lt;p&gt;A pet agent session accumulates context continuously. After an hour of work, the context window contains:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The original task description (probably underspecified)&lt;/li&gt;
&lt;li&gt;Your first few corrections and clarifications&lt;/li&gt;
&lt;li&gt;The model&apos;s first attempt, which missed something&lt;/li&gt;
&lt;li&gt;Your redirect&lt;/li&gt;
&lt;li&gt;The model&apos;s second attempt, partially correct&lt;/li&gt;
&lt;li&gt;More corrections&lt;/li&gt;
&lt;li&gt;Tool call outputs — file reads, test runs, error messages&lt;/li&gt;
&lt;li&gt;The model&apos;s current understanding, shaped by all of the above&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is not neutral. Research on context window utilization shows that models degrade when relevant content is buried in earlier positions — the &quot;lost in the middle&quot; phenomenon. Information at the start and end of a context is attended to more reliably than information in the middle. A long pet session buries its most important content (the actual task requirements) under layers of accumulated back-and-forth.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Beyond attention degradation, there is a more direct effect: the model&apos;s prior wrong attempts are in the context. It has seen itself go down a particular path. It has a prior. That prior shapes the next attempt, not always in the right direction.&lt;/p&gt;
&lt;p&gt;The benchmark model has none of this. It sees the problem cold. Whatever capability it has for that problem is expressed fully, without interference.&lt;/p&gt;
&lt;h2&gt;The cattle worker is the benchmark condition&lt;/h2&gt;
&lt;p&gt;A stateless cattle worker dispatched by an orchestrator starts each task with a context containing:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The project instructions (&lt;code&gt;CLAUDE.md&lt;/code&gt;) — stable, curated, written once&lt;/li&gt;
&lt;li&gt;The task body from the bead — a precise specification of one unit of work&lt;/li&gt;
&lt;li&gt;Whatever reference material the task body explicitly includes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That is structurally close to a benchmark evaluation. The input is small and deliberate. There is no accumulated conversation. No prior wrong attempts. No corrections that anchored the model toward a direction it should abandon.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The pet session is not that model. The pet session is a model operating under conditions that are systematically worse than the conditions under which it was benchmarked — and those conditions degrade further the longer the session runs.&lt;/p&gt;
&lt;p&gt;This means benchmark scores are a better predictor of cattle performance than pet performance. When you read that a model scores X% on SWE-bench Verified, the deployment model that will actually realize that capability is a stateless worker with a clean context and a well-scoped task — not an ongoing chat session where the model has been talking to you for two hours.&lt;/p&gt;
&lt;h2&gt;The score you are buying is not what you are running&lt;/h2&gt;
&lt;p&gt;The practical consequence is that most people buy capability — a higher benchmark score, a more expensive model tier — and then run it in a mode that systematically degrades that capability below what the benchmark measured.&lt;/p&gt;
&lt;p&gt;A pet session with a more capable model is better than a pet session with a less capable model, but both are operating below their benchmark-measured ceiling. The gap between &quot;what the benchmark measured&quot; and &quot;what the pet session delivers&quot; grows as the session accumulates context. By hour three, with 50,000 tokens of back-and-forth, you are running a noticeably different model than the one that got the score.&lt;/p&gt;
&lt;p&gt;There is no equivalent degradation in the cattle model. A stateless worker dispatched against a well-specified task is as close to benchmark conditions as production use gets. The score is what you bought. The score is roughly what you run.&lt;/p&gt;
&lt;p&gt;This also changes the economics of model selection. The correct question is not &quot;which model scores highest on SWE-bench?&quot; but &quot;which model scores highest on SWE-bench, and am I running it in conditions that will actually realize that score?&quot; If you are running pet sessions, you are paying for capability you are not fully using. If you are running cattle workers with clean contexts and scoped tasks, you are.&lt;/p&gt;
&lt;h2&gt;What an honest benchmark would measure&lt;/h2&gt;
&lt;p&gt;The benchmarks that exist were designed for a world of clean evaluations, not for the question of how model capability degrades across a production conversation. None of them measure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Performance at turn 30 of a live session versus turn 1&lt;/li&gt;
&lt;li&gt;Performance with 80K tokens of prior context versus 500&lt;/li&gt;
&lt;li&gt;How much capability is recovered by compressing and distilling the context versus starting fresh&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These would be more diagnostic for real production use. The existing benchmarks tell you the ceiling. What is missing is the curve that describes how quickly you fall away from that ceiling as the context accumulates, and how different deployment models (cattle versus pet) track that curve differently.&lt;/p&gt;
&lt;p&gt;Until those measurements exist, the empirical data points in one direction: the deployment model closest to benchmark conditions is stateless dispatch into clean context. That is the cattle model.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;When someone cites a benchmark to justify a model choice, I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Under what context conditions was that score measured, and are those the conditions we are actually running?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the answer is &quot;a 300-token prompt against a blank context window&quot; and the deployment is &quot;an ongoing chat session that has been running for six hours,&quot; the score is describing a model that is not the model they are running.&lt;/p&gt;
&lt;p&gt;Knowing that does not mean you stop using pet sessions — there are tasks where they are the right tool, and where the accumulated context is a feature rather than a bug. It means you understand that benchmark scores are ceiling measurements, and that the delta between the ceiling and what you actually get is a function of the deployment model you chose.&lt;/p&gt;
&lt;p&gt;Cattle closes that delta. That is the case, made empirically.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Data: token counts measured across 9,755 benchmark problems in May 2026 (HumanEval, MBPP, SWE-bench, SWE-bench Verified, LiveCodeBench, BigCodeBench, APPS) and 8,035 more across thirteen benchmarks in October 2026 (the current set above, with SWE-rebench&apos;s full snapshot of 860 tasks; SWE-bench Verified re-measured as a control), using the &lt;code&gt;cl100k_base&lt;/code&gt; tokenizer. Raw data (per-problem token counts + full statistics, plus sources, revisions and fields in the October file): &lt;a href=&quot;/data/benchmark-tokens.json&quot;&gt;benchmark-tokens.json&lt;/a&gt; (May) and &lt;a href=&quot;/data/benchmark-tokens-2026-10.json&quot;&gt;benchmark-tokens-2026-10.json&lt;/a&gt; (October) — schema, license, and citation on the &lt;a href=&quot;/data/&quot;&gt;data page&lt;/a&gt;. Background: &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;pet agents vs. cattle agents&lt;/a&gt; — the deployment model this post argues for. The context reconstruction approach that makes clean-context cattle work: &lt;a href=&quot;/notes/plan-is-the-prompt/&quot;&gt;the plan is the prompt&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>orchestration</category><category>benchmarks</category><category>context</category></item><item><title>The plan is the prompt</title><link>https://jedarden.com/notes/plan-is-the-prompt/</link><guid isPermaLink="true">https://jedarden.com/notes/plan-is-the-prompt/</guid><description>Why a detailed plan document is the most token-dense artifact you will write for a headless agent fleet. What a plan actually needs to contain, how it decomposes into a verified graph of single-task beads, and why a bad plan is more expensive than it looks when twenty workers are running it simultaneously.</description><pubDate>Sat, 16 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When a pet agent misunderstands the task, you correct it. Two sentences, maybe three. The session absorbs the correction and continues. The cost is negligible — a few seconds of your time and a handful of tokens.&lt;/p&gt;
&lt;p&gt;When a cattle worker misunderstands the task, it runs to completion. It produces output that does not match what you wanted, the orchestrator classifies the outcome as failure, and the task goes back on the queue. Another worker picks it up, starts cold, misunderstands in a slightly different direction, and fails again. If you have twenty workers running the same workspace, the same misunderstanding plays out twenty different ways at twenty different costs before you notice the pattern and fix the input.&lt;/p&gt;
&lt;p&gt;The input is the plan.&lt;/p&gt;
&lt;h2&gt;What you are actually paying for in a pet session&lt;/h2&gt;
&lt;p&gt;Pet sessions accumulate context through dialogue. You describe what you want, the agent responds, you correct, it adjusts. The eventual output reflects not just your initial description but everything you added along the way: the clarifications, the course corrections, the &quot;no, I meant the other thing.&quot; By the time the pet agent produces something useful, it has received substantially more information than what was in your first message.&lt;/p&gt;
&lt;p&gt;This is not a flaw — it is how conversations work. But it conceals the actual input cost. The information the agent needs to do the job was never written down in one place. It accumulated, across turns, in a format that is impossible to hand directly to a stateless worker.&lt;/p&gt;
&lt;p&gt;When you move to cattle, that cost comes due. The worker starts cold. It gets exactly what you wrote, nothing more. The turns of dialogue that would have filled in the blanks do not exist — so the blanks have to be filled before dispatch. The plan is how you fill them.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;The compression problem&lt;/h2&gt;
&lt;p&gt;A running system has enormous context attached to it: commit history, bead history, comments in the code, decisions made and reversed over weeks of work. A worker technically has access to all of this. The question is whether it can find the relevant signal in time to use it.&lt;/p&gt;
&lt;p&gt;Commit history is retrospective and fragmented. You learn &lt;em&gt;what&lt;/em&gt; changed but rarely &lt;em&gt;why the tradeoff landed where it did&lt;/em&gt;. Bead bodies describe individual tasks, not the coherent shape of the whole. Code captures implementation, not intent. None of these is dense enough.&lt;/p&gt;
&lt;p&gt;The plan document is different. It is written to be read by a worker who knows nothing — which means it has to contain everything necessary in as few tokens as possible. A good plan is not comprehensive in the way a specification is comprehensive. It is compressed in a specific way: it records the decisions that were made without recording the deliberations that led to them. It says &lt;em&gt;this tradeoff resolved in this direction&lt;/em&gt; rather than &lt;em&gt;here are both sides of the argument&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The compression is the point. A worker does not need to re-litigate the decisions. It needs to know what was decided and work within that. A plan that explains &lt;em&gt;why&lt;/em&gt; every decision was made is longer than a plan needs to be and often less useful, because the why is background and the worker needs foreground.&lt;/p&gt;
&lt;h2&gt;The graph that makes cold starts work&lt;/h2&gt;
&lt;p&gt;When I first wrote this, NEEDLE&apos;s work structure was a four-layer hierarchy: plan, genesis bead, phase beads, task beads. The phase layer didn&apos;t survive contact with the fleet. A phase bead is an umbrella, and umbrellas make bad dependencies: blocking a task on &quot;Phase 2&quot; when it really needs one specific bead from Phase 1 serializes work that could have run in parallel, and hides the edge that actually matters. Worse, a phase-sized bead is big and vague — exactly the shape that invites two workers to both &quot;helpfully&quot; do the same obvious thing.&lt;/p&gt;
&lt;p&gt;What I run now is flat and wired:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Task beads&lt;/strong&gt; are the only unit of work. Each is scoped to a single piece a worker can complete in one run: one file, one function, one test suite, one configuration change. A task that would serve one phase in one way and a later phase in another gets split along that line, so a later phase&apos;s enhancement never silently widens an earlier bead.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dependencies&lt;/strong&gt; come from the plan&apos;s actual technical relationships. Each bead blocks on the specific bead it needs, never on the nearest umbrella. The dependency graph — not a hierarchy — decides what is ready to claim.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The graph is verified before anyone builds against it.&lt;/strong&gt; A fresh agent with no stake in the draft checks three properties independently, in rounds, until a round comes back clean: coverage (every element of the plan has a bead), scoping (every bead is one task), and dependencies (every edge is real, none is missing). A graph can pass any one of those and fail the other two.&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;&lt;a href=&quot;/glossary/#genesis-bead&quot;&gt;genesis bead&lt;/a&gt;&lt;/strong&gt; is created last, once the graph has converged. It references the plan document, is blocked on everything, and records whatever the verification rounds deliberately deferred. It is a summary of the structure, not the structure.&lt;/p&gt;
&lt;p&gt;A worker assigned a task bead reads the task bead body, then the plan document it points to — specific first, whole second. By the time it has read both, it knows exactly what it is doing and what the overall project is trying to accomplish. That is also why the task body has to stand on its own: there is no intermediate layer left to carry context the task forgot to state.&lt;/p&gt;
&lt;p&gt;This only works if the plan is coherent enough to decompose. A plan that is vague produces beads that are vague, edges that are guesses, and workers that guess along with them. The failure propagates down; the fix has to start at the top.&lt;/p&gt;
&lt;h2&gt;What has to be in the plan&lt;/h2&gt;
&lt;p&gt;There are several categories of content that make a plan useful to a cold-start worker. Missing any of them degrades the plan proportionally.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scope lock.&lt;/strong&gt; What the system does, stated precisely enough that a worker can determine whether a given change is in scope or out of scope without asking. This is harder to write than it sounds. The failure mode is a scope statement that is technically accurate but vague enough to be consistent with many different implementations — which means every worker is free to pick a different implementation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Acceptance criteria.&lt;/strong&gt; The conditions under which the project is done. Not aspirations (&quot;the system should be fast&quot;) but testable criteria (&quot;p99 response time under 200ms with N concurrent users&quot;). Acceptance criteria are what let the orchestrator evaluate whether a worker&apos;s output counts as success. If the criteria are absent or vague, the orchestrator cannot classify the outcome reliably, and the &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;outcome table&lt;/a&gt; loses a row.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Phase boundaries.&lt;/strong&gt; Where one phase ends and the next begins, stated as conditions rather than calendar dates. A phase boundary is a checkpoint: the system is in &lt;em&gt;this&lt;/em&gt; state before this phase, and in &lt;em&gt;this&lt;/em&gt; state after. If the boundary is defined as a date, it is almost certainly wrong the moment implementation starts. If it is defined as a condition, it stays true regardless of how long the phase takes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Known unknowns.&lt;/strong&gt; The things you do not know yet, stated explicitly. A plan that does not acknowledge its own uncertainty is pretending to more confidence than it has — and workers will act on that pretended confidence. A plan that says &quot;we do not yet know how to handle the edge case of X; this will be resolved in phase 3&quot; gives workers license to defer the question cleanly rather than improvise an answer that may conflict with what phase 3 eventually decides.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Constraint inventory.&lt;/strong&gt; The fixed points that eliminate solution space: existing interfaces you cannot change, performance budgets you cannot exceed, security requirements you cannot trade away. Constraints are more useful than requirements because they narrow the space of valid implementations without prescribing a specific one. A worker that knows the constraints can make autonomous design decisions within them; a worker that does not know the constraints makes design decisions that may violate them invisibly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rollback plan.&lt;/strong&gt; What happens if phase N fails. Not &quot;we will figure it out&quot; but the actual fallback: which state the system can be safely returned to, which changes are reversible and which are not, what the recovery path is. Workers do not need this to execute normally — they need it to handle the abnormal cases that the orchestrator surfaces.&lt;/p&gt;
&lt;h2&gt;The plan is how you avoid pivoting mid-flight&lt;/h2&gt;
&lt;p&gt;The most expensive thing that can happen to a cattle fleet is not a worker crashing. It is a worker succeeding at the wrong thing — because the plan did not make &quot;the right thing&quot; unambiguous.&lt;/p&gt;
&lt;p&gt;A mid-flight pivot in a pet session costs a turn of conversation. A mid-flight pivot in a cattle fleet costs every task derived from the misunderstanding: the work already done, the retries queued, the downstream tasks that were built on the wrong foundation. The later in the implementation the pivot happens, the more work has to be undone. This is why the plan-review gate exists.&lt;/p&gt;
&lt;p&gt;There is also an asymmetry in how expensive the pivot is depending on what changed. If the plan needed adjustment, the code artifacts can be wholesale deleted and workers restarted from the revised plan. Code is cheap. A well-scoped implementation takes hours for a fleet of workers, not days. The correct response to discovering your plan was wrong is not to patch the existing code — it is to fix the plan, clear the code, and run again. The plan is the expensive artifact; the code is the output.&lt;/p&gt;
&lt;p&gt;This is the rule everything above resolves to: &lt;strong&gt;the plan is the source of truth.&lt;/strong&gt; When the plan and the artifacts disagree, the plan is right by definition, and the artifacts are what gets amended. The direction is not negotiable. Editing the plan to match whatever the code drifted into feels like keeping the document current, but it is laundering a mistake into the source of truth — the next cold-start worker reads the retrofitted plan and treats the drift as intent. You conform the artifacts to the plan, never the plan to the artifacts. The only thing that legitimately changes a plan is a changed &lt;em&gt;decision&lt;/em&gt;, made deliberately — and that change leads the code rather than trailing it.&lt;/p&gt;
&lt;p&gt;This changes what you invest in. You spend the effort on the plan. You spend comparatively little worrying about whether any individual implementation is precious, because it is not — it is reproducible from the plan in a matter of hours.&lt;/p&gt;
&lt;h2&gt;The plan-review gate&lt;/h2&gt;
&lt;p&gt;Before any worker touches the code, the plan goes through &lt;code&gt;/plan-review&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The skill checks 80+ structural patterns across scope, acceptance criteria, architecture, preflight safety, phasing, testing, security, performance, operations, API design, and risk. It was developed from analysis of high-quality planning documents by Jeffrey Emanuel, whose methodology for writing plans that survive contact with implementation influenced how I think about this. The patterns were extracted from what those plans had in common — and, more usefully, from what the plans that failed mid-implementation were missing.&lt;/p&gt;
&lt;p&gt;The most common failure patterns cluster around the same four gaps: no acceptance criteria (workers cannot self-evaluate output), no phase gates (workers do not know when a phase is complete), no rollback plan (failures have no recovery path), and no constraint inventory (workers make design decisions in an unconstrained space and produce incompatible implementations). Plan-review checks for all four explicitly, along with everything else.&lt;/p&gt;
&lt;p&gt;The output of a review is a scorecard with PRESENT / PARTIAL / MISSING ratings for each item, followed by an offer to draft the missing sections. The offer is worth taking. A plan that passes review at 90% is close enough to deploy; a plan at 60% has gaps that will compound across a fleet.&lt;/p&gt;
&lt;p&gt;The skill is available at &lt;a href=&quot;https://github.com/jedarden/jeds-curated-skills&quot;&gt;jedarden/jeds-curated-skills&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;The cost multiplier&lt;/h2&gt;
&lt;p&gt;The math for why plan quality matters more in cattle than in pets is straightforward.&lt;/p&gt;
&lt;p&gt;In a pet session, a plan gap costs one correction: a few seconds of your time, a few tokens, the session absorbs the fix. The cost is O(1).&lt;/p&gt;
&lt;p&gt;In a cattle fleet with N workers, a plan gap costs N failed executions before you notice the pattern. Each failed execution burns its full budget — time, tokens, whatever the worker spent before the orchestrator classified the outcome as failure. The cost is O(N × execution budget). At twenty workers with a per-task budget of 100K tokens, one plan gap that takes two failed iterations to surface costs four million tokens in wasted execution before you see it in the outcome distribution and trace it back to the plan.&lt;/p&gt;
&lt;p&gt;This is not hypothetical. It is the most expensive class of bug in a cattle system — more expensive than a bad prompt, more expensive than a misconfigured model, more expensive than a network issue. Network issues affect individual calls; plan gaps affect every worker on every task derived from the plan.&lt;/p&gt;
&lt;p&gt;The fix is to treat the plan as a first-class artifact with a quality gate, not as a rough sketch you clarify in conversation.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h2&gt;What a plan is not&lt;/h2&gt;
&lt;p&gt;A plan is not a specification. A specification describes every detail of the implementation. A plan describes the decisions that constrain the implementation without prescribing every detail of it. Workers fill in the details; the plan tells them which details are fixed and which are theirs to choose.&lt;/p&gt;
&lt;p&gt;A plan is not a design document. A design document explains &lt;em&gt;how&lt;/em&gt; the system will be built. A plan records &lt;em&gt;what&lt;/em&gt; the system will do and &lt;em&gt;what success looks like&lt;/em&gt;. The how is the worker&apos;s job; the what and the done are the plan&apos;s job.&lt;/p&gt;
&lt;p&gt;A plan is not a changelog. It records the current state of decisions, not the history of how those decisions evolved. A plan that accumulates commentary about why things changed over time is a plan that is getting harder to read with each revision. Keep the plan current and put the history in commit messages.&lt;/p&gt;
&lt;h2&gt;What I&apos;d change&lt;/h2&gt;
&lt;p&gt;Two things.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Plans should be versioned with the code — and the plan leads.&lt;/strong&gt; The plan lives next to the code it describes, and the two travel together. But &quot;together&quot; has a direction. When the code diverges from the plan — which it always does, in small ways — that divergence is a defect in the code, not a fact to be transcribed into the plan. You amend the artifacts to match the plan in the same commit that surfaces the drift. The plan itself changes only when the &lt;em&gt;decision&lt;/em&gt; changes, and then it changes first: revise the plan, then regenerate the code from it. The habit I want to kill is the reflexive one — editing the plan to describe whatever the implementation drifted into, because that keeps the document looking current while quietly demoting it from source of truth to changelog. The convention is not &quot;plan changes follow code changes.&quot; It is &quot;code changes follow plan changes.&quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Staleness should be explicit.&lt;/strong&gt; A plan written at the start of a project is not the same as that plan after six weeks of implementation. When a later phase revises an earlier decision, every section that rested on the old decision is now wrong — and there is a window between making the new decision and propagating it through the document. Today there is no marker for that window: nothing in the plan says &quot;§Architecture still describes the phase-1 decision; phase 3 superseded it, rewrite pending.&quot; There should be. A worker that reads an un-updated section and acts on it produces work that has to be undone. The marker is a stopgap, not a resting state — staleness is a defect in the plan to be closed, not a permanent admission that the code has outrun the document. The goal is always a plan with no stale sections, because the plan is what every worker trusts.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I commit a plan and start creating beads from it:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Could a worker who has never spoken to me, reading only this document and the task bead it has been assigned, produce something I would accept on the first try?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Both parts matter. The first — &lt;em&gt;never spoken to me&lt;/em&gt; — rules out plans that rely on context you have accumulated in conversation. The second — &lt;em&gt;on the first try&lt;/em&gt; — rules out plans where success requires multiple iterations to clarify. If the answer is no, the plan is not done. I work on the plan, not the code.&lt;/p&gt;
&lt;p&gt;The workers are ready. The question is whether the inputs are.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Plan methodology: derived from Jeffrey Emanuel&apos;s (&lt;a href=&quot;https://github.com/dicklesworthstone&quot;&gt;@dicklesworthstone&lt;/a&gt;) approach to high-quality planning documents. Plan-review skill: &lt;a href=&quot;https://github.com/jedarden/jeds-curated-skills&quot;&gt;jedarden/jeds-curated-skills&lt;/a&gt;. The orchestration layer this sits on: &lt;a href=&quot;https://github.com/jedarden/NEEDLE&quot;&gt;NEEDLE&lt;/a&gt;. The task structure (genesis beads, phase beads): &lt;a href=&quot;https://github.com/dicklesworthstone/beads_rust&quot;&gt;beads_rust&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>orchestration</category><category>planning</category><category>NEEDLE</category></item><item><title>The unit economics of running cattle</title><link>https://jedarden.com/notes/unit-economics-of-cattle/</link><guid isPermaLink="true">https://jedarden.com/notes/unit-economics-of-cattle/</guid><description>How to make the math work when twenty headless workers are spending money without you. Why the pet model has no built-in cost discipline, what the cattle model requires, and what to measure when tokens are the wrong unit.</description><pubDate>Tue, 05 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The first time I ran headless agents in earnest, I burned through a quarter of my Anthropic monthly limit in three days. I told &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;that story already&lt;/a&gt; as a parable about treating agents as pets. It is also a story about money — and the money story is the one almost nobody plans for before it happens to them.&lt;/p&gt;
&lt;p&gt;The pet model has a hidden cost-control mechanism that nobody designed deliberately and nobody notices until they remove it. The cattle model removes it. If you do not replace it with something explicit before the workers go headless, you find out about the gap at the bottom of an invoice.&lt;/p&gt;
&lt;p&gt;This is the post about the replacement.&lt;/p&gt;
&lt;h2&gt;The pet model&apos;s hidden subsidy&lt;/h2&gt;
&lt;p&gt;When you run a pet agent, you are the spend control. Not metaphorically — literally. The reason your bill stays sane is that your attention is the bottleneck. You can only watch one or two sessions at a time. Each session can only spend money while you are in it. When you walk away from the keyboard, the spending stops because the conversation stops.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is invisible until you scale. As long as the human is in the loop, three things happen automatically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;You notice runaways.&lt;/strong&gt; The agent that has been chewing on the same prompt for ten minutes producing nothing is something you see and stop. You do not need a metric for it. You see the spinner.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;You pace yourself.&lt;/strong&gt; Token-heavy operations — long context windows, large diffs, tool calls with big outputs — get throttled because &lt;em&gt;you&lt;/em&gt; are the one initiating them. You feel the lag and back off.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;You self-throttle on quota.&lt;/strong&gt; When the dashboard creeps up, you slow down. The dashboard is your conscience. The agent has no conscience.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of those mechanisms exist in cattle. The agent does not see its own cost. The agent does not see the dashboard. The agent does not get tired. Twenty headless workers running unattended, each invoking expensive tool calls in tight loops, will produce a bill that bears no relationship to the value of the work — unless something between them and the provider says no.&lt;/p&gt;
&lt;p&gt;The pet model&apos;s economics work because the human is the rate-limiter. The cattle model&apos;s economics work because &lt;em&gt;something else&lt;/em&gt; is the rate-limiter. That something else is the actual subject of this post.&lt;/p&gt;
&lt;h2&gt;Tokens are the wrong unit&lt;/h2&gt;
&lt;p&gt;The first instinct, when the bills get scary, is to start counting tokens. Token-counting feels rigorous. The provider exposes per-call usage. You can build dashboards. You can say &quot;this prompt averages 12,000 input tokens, this one averages 40,000&quot; and feel like you are doing the work.&lt;/p&gt;
&lt;p&gt;It is the wrong unit.&lt;/p&gt;
&lt;p&gt;Tokens are an input cost, not an output measurement. A worker that burns 200K tokens to close one bead and a worker that burns 800K tokens to close five beads — the second worker is four times cheaper per outcome, even though it spent four times more on tokens. If you optimize the token line you will end up trimming context windows on the second worker until it stops being able to close beads at all, and you will congratulate yourself on the savings.&lt;/p&gt;
&lt;p&gt;The unit that matters is &lt;strong&gt;cost per closed outcome&lt;/strong&gt;. A bead closed. A test passing. A PR merged and reviewed. The denominator is the work the system actually delivered, not the inputs it consumed getting there. Token cost without an outcome attached is just spend.&lt;/p&gt;
&lt;p&gt;This is harder to measure. It requires the orchestrator to &lt;em&gt;know&lt;/em&gt; when a worker produced a real outcome — which is the same exhaustive-handler discipline from the &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;previous post&lt;/a&gt; showing up in a different form. If your state machine cannot tell success from failure, it cannot tell expensive-but-productive from expensive-and-wasted, and you will optimize the wrong column.&lt;/p&gt;
&lt;p&gt;The orchestrator that classifies outcomes is also the orchestrator that can compute outcome cost. They are the same machine, doing the same work, for two reasons.&lt;/p&gt;
&lt;h2&gt;Cost governance is its own component&lt;/h2&gt;
&lt;p&gt;Once you accept that the human cannot be the spend control, the question becomes: where does the spend control live?&lt;/p&gt;
&lt;p&gt;It does not live in the worker. The worker is fungible by design — and a worker that polices its own budget is not fungible, because some workers will refuse work that other workers would accept. It does not live in the provider, because providers are happy to sell you whatever you will buy. It does not live in the orchestrator, because the orchestrator&apos;s job is to dispatch work, not to mediate the financial contract with each provider.&lt;/p&gt;
&lt;p&gt;It lives in a dedicated component that sits beside the fleet rather than inside it — one that watches the subscription windows and decides how many workers are allowed to exist. In a cattle system the throttle isn&apos;t a per-request limit. It&apos;s headcount. Three jobs:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Forecast the window.&lt;/strong&gt; Subscription plans meter usage in windows — five-hour, weekly. The governor polls where each window stands, learns how fast each worker actually burns it, and projects whether the current fleet will exhaust the window before it resets. The question is never &quot;how much have we spent&quot; but &quot;at this rate, do we hit the wall before the clock does&quot;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Set the headcount.&lt;/strong&gt; When the forecast says the window runs out early, the fleet shrinks; when capacity will be left on the table at reset, it grows. Scaling down retires idle workers first, so a busy one is touched only when there aren&apos;t enough idle ones to cover the cut — and a hard brake drops the fleet to zero if any window crosses 98%, because hitting the provider&apos;s ceiling is the bad failure mode. You hit your own ceiling first.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Price the work.&lt;/strong&gt; Every token the fleet burns is converted to what it would have cost at API list price, per model, including cache reads and writes. A subscription hides marginal cost; the governor puts it back, which is what makes cost per outcome computable at all.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/jedarden/claude-governor&quot;&gt;claude-governor&lt;/a&gt; is what this looks like in my setup. It is unromantic plumbing — a Rust daemon on a five-minute loop: an observe side that polls Claude Code&apos;s usage endpoint and collects token counts, and an act side that launches or retires NEEDLE workers per subscription pool, within each pool&apos;s floor and ceiling. There is nothing clever about it. The cleverness is that the workers do not know it exists. No worker checks a budget, and no worker can refuse work on cost grounds — they stay fungible. The policy lives entirely in how many of them are running.&lt;/p&gt;
&lt;h2&gt;Run a portfolio, not a provider&lt;/h2&gt;
&lt;p&gt;There are two pricing models in this market and they do completely different things to your unit economics.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Subscriptions&lt;/strong&gt; (Anthropic Max, &lt;a href=&quot;http://Z.AI&quot;&gt;Z.AI&lt;/a&gt; Max) cap your downside. You pay a fixed amount per month, you get a quota window, and if you exceed it you get cut off — not charged more. The cost per outcome is bounded above. The downside is bounded; the upside is bounded too. Subscriptions are how you fund sustained throughput, the steady drumbeat of cattle work that runs every hour of every day.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Metered API&lt;/strong&gt; caps nothing. You pay for what you use. There is no ceiling. A bug in your retry loop can turn into a five-figure invoice overnight if nothing is bounding how much work is running. The upside is real — metered access is how you handle bursts, spikes, one-off batches that exceed the subscription window without burning the next week&apos;s quota. The downside is unbounded. You only run metered traffic with a hard cap on how many workers can draw on it, no exceptions.&lt;/p&gt;
&lt;p&gt;A healthy fleet runs both. The subscription is the floor — committed throughput at a known cost. The metered API is the surge capacity. The orchestrator does not care which is which. Each subscription and the metered pool is its own worker pool with its own floor and ceiling. The governor adds workers to the cheapest pool first, and when it has to shrink, it sheds the pools that delivered the fewest verified closures per dollar — headcount shifting as each window&apos;s forecast moves.&lt;/p&gt;
&lt;p&gt;The mistake I have watched people make repeatedly is going all-in on metered API &quot;for flexibility.&quot; You get the flexibility. You also get a cost structure that scales linearly with how aggressive your retry policy is, which is exactly the wrong elasticity to give an autonomous fleet.&lt;/p&gt;
&lt;h2&gt;Quota observability is asymmetric&lt;/h2&gt;
&lt;p&gt;The governor needs to know how much you have spent against each window. This sounds trivial. It is not, because the providers expose this information unevenly.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anthropic exposes the usage of each window — five-hour and weekly — through an endpoint the governor polls. It knows where it is in every window and sizes the fleet accordingly. You can build proper closed-loop control because the loop has a sensor.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://Z.AI&quot;&gt;Z.AI&lt;/a&gt; exposes nothing programmatic. There is no quota endpoint. There are no rate-limit headers. The only place you can see your usage is the web dashboard, which is fine for a human checking in once a day and useless for a process that needs to make a decision every second. The governor is flying blind on &lt;a href=&quot;http://Z.AI&quot;&gt;Z.AI&lt;/a&gt; quota — until the wall, when the API starts returning rate-limit errors and you reverse-engineer what just happened.&lt;/p&gt;
&lt;p&gt;The fix is to model your own quota independently. Measure outflow yourself, count it against your own ledger, and treat &lt;em&gt;that&lt;/em&gt; as the source of truth — not what the provider reports, because the provider may not report at all. &quot;You are out of quota&quot; should be a fact your governor knows before the provider tells you, because the only signal the provider gives some of these subscriptions is the failure itself.&lt;/p&gt;
&lt;p&gt;This is more work than it should be. It is the cost of operating against providers whose business model has not yet caught up with the operational needs of customers running unattended fleets. It will get better. Until then, the governor&apos;s quota model is a thing you maintain by hand.&lt;/p&gt;
&lt;h2&gt;The cheap-restart reflex&lt;/h2&gt;
&lt;p&gt;The pet operator has one cost-control reflex that the cattle operator should preserve and amplify: when a worker is stuck, kill it.&lt;/p&gt;
&lt;p&gt;In the pet model this is intuitive. You see the agent thrashing, you stop it, you start over. The cost of the restart is small. The cost of letting it grind for another five minutes is large.&lt;/p&gt;
&lt;p&gt;In the cattle model the same reflex is correct, but the operator cannot apply it manually because the operator is not watching. The reflex has to be built into the orchestrator. Three bounds, enforced at the worker level:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Time-bounded executions.&lt;/strong&gt; A worker that has been running on the same task for longer than the budget gets killed. The handler is the timeout handler from the &lt;a href=&quot;/notes/deterministic-state-machines-for-agents/&quot;&gt;previous post&lt;/a&gt; — release the task, mark deferred, loop. No appeal. No &quot;but it might be making progress.&quot; Long-tail tasks are almost always stuck tasks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Token-bounded executions.&lt;/strong&gt; A worker that has emitted more than N tokens of output on a single task gets killed. Most real outcomes fit comfortably in a budget. The ones that exceed it are usually agents in some kind of loop — emitting the same diff over and over, retrying the same failing tool call, repeating themselves with minor variations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Iteration-bounded executions.&lt;/strong&gt; A worker that has invoked the model more than N times on a single task gets killed. This catches the case the previous two miss: a worker that produces small, fast, expensive calls in tight succession. None of them individually trips the time or token bounds. The count does.&lt;/p&gt;
&lt;p&gt;These three bounds together convert &quot;the worker decides when to stop&quot; into &quot;the orchestrator decides when to stop.&quot; Which is the only correct allocation of that decision in a cattle system, because the worker has no skin in the game and the orchestrator has all of it.&lt;/p&gt;
&lt;p&gt;A worker killed early might have been about to succeed. That is fine. The task goes back on the queue, gets picked up by another worker, possibly with a different prompt or a different model, and tries again. The cost of a wasted execution is a single bounded run. The cost of an unwasted runaway is unbounded.&lt;/p&gt;
&lt;p&gt;Cheap restart, every time.&lt;/p&gt;
&lt;h2&gt;What I&apos;d change&lt;/h2&gt;
&lt;p&gt;Three things, in order of how often I think about them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Outcome cost should be a first-class metric, not a derived one.&lt;/strong&gt; Today I compute cost per closed bead by joining provider invoices to the orchestrator&apos;s outcome log after the fact. It works but it is asynchronous — I find out about expensive failures after they have already happened. The governor already prices every token as it is collected. The orchestrator already knows what task each call belonged to. The metric should be emitted live: this bead just closed, here is what it cost, here is whether that is in line with the historical distribution. If it is an outlier, alert immediately. Part of this has landed since I first wrote it: the governor now reads a ledger of verified closures per adapter, and when it has to shrink the fleet, the pools that bought the fewest closures per dollar go first. The live per-bead alert is still missing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Per-task budgets should be configurable, not fleet-wide constants.&lt;/strong&gt; Right now the time / token / iteration bounds are global. Some tasks legitimately want bigger budgets — a complex refactor across many files genuinely needs more space than a one-line fix. The bead should declare its budget. The orchestrator should enforce it. Today everything gets the same budget and I either set it too low for hard tasks or too high for easy ones.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The governor should expose its policy decisions as a stream.&lt;/strong&gt; When the governor shrinks the fleet from eight workers to three, the visible effect is just fewer workers. Its state file records the current target, but not the history of &lt;em&gt;why&lt;/em&gt; — which window, what forecast, what headroom it believed it had at the time. When you go to debug &quot;why did the fleet&apos;s throughput drop in this hour,&quot; the governor&apos;s reasoning is opaque. It should not be. Every policy decision the governor makes — scaled down, scaled up, braked, shifted to another pool — should be a structured event that the observability stack can query.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I run any new workload on the cattle pipeline, I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What is each dollar of spend supposed to produce, and how would I know if it didn&apos;t?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Both halves matter. The first half forces you to attach a denominator to the spend — you are not buying tokens, you are buying outcomes. The second half forces you to instrument the answer — if you cannot tell whether the spend produced the outcome, you cannot govern it. You are just hoping.&lt;/p&gt;
&lt;p&gt;The pet model lets you skip both halves because your attention substitutes for both. You see the outcome (or its absence) directly. You see the spend (or its absence) directly. The cattle model takes both signals away from you and forces you to rebuild them in the orchestrator and the governor — explicitly, before the workers go live.&lt;/p&gt;
&lt;p&gt;If you have not built that, you do not have a cattle system. You have a pet system with the supervision removed, which is a different thing. It looks the same right up until the bill arrives.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;If you want to see the governor side: &lt;a href=&quot;https://github.com/jedarden/claude-governor&quot;&gt;claude-governor&lt;/a&gt; is the Rust daemon described here. The fleet side — workers, state machine, outcome handling — is &lt;a href=&quot;https://github.com/jedarden/NEEDLE&quot;&gt;NEEDLE&lt;/a&gt;. Together they bound the system from both ends: NEEDLE decides what work to do; claude-governor decides how many workers may do it.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Updated October 3, 2026: corrected how the governor works. An earlier version described it as a request proxy holding the API key; it governs worker headcount against subscription windows instead, and never sits in the request path.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>orchestration</category><category>cost</category><category>claude-governor</category></item><item><title>Deterministic state machines for non-deterministic agents</title><link>https://jedarden.com/notes/deterministic-state-machines-for-agents/</link><guid isPermaLink="true">https://jedarden.com/notes/deterministic-state-machines-for-agents/</guid><description>Why agent orchestration needs explicit outcome handlers. The control structure that lets twenty headless workers run unattended without the operator becoming the loop.</description><pubDate>Mon, 04 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A worker crashes mid-task. A model-provider rate-limit kicks in for nine minutes. Two workers race for the same task and one of them loses. The agent finishes successfully but produces output that doesn&apos;t compile. Same workspace, same hour, four different outcomes — and zero of them are &lt;em&gt;wrong&lt;/em&gt;. They are exactly the outcomes a long-running headless agent fleet should expect.&lt;/p&gt;
&lt;p&gt;The question is not how to prevent any of those. The question is what happens &lt;em&gt;after&lt;/em&gt; each one.&lt;/p&gt;
&lt;p&gt;If your answer is some flavor of &quot;I&apos;ll go look,&quot; you are still running &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;pets&lt;/a&gt;. The cattle model needs an answer that does not involve a person — and the answer has to be defined &lt;em&gt;before&lt;/em&gt; the outcome, not improvised after it.&lt;/p&gt;
&lt;p&gt;This is the post about that answer.&lt;/p&gt;
&lt;h2&gt;The shape of the problem&lt;/h2&gt;
&lt;p&gt;Existing agent orchestration tools cluster into two shapes. Neither one quite fits.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conversational frameworks&lt;/strong&gt; — LangGraph, AutoGen, CrewAI. These assume a chat loop with a human-in-the-loop or another LLM, and they are good at that. They are bad at sustained autonomous work because the entire abstraction is &lt;em&gt;the conversation&lt;/em&gt;. When the conversation ends, the abstraction ends. Recovering from a crash means starting over and hoping the new conversation lands in roughly the same place. Failure modes are vague — &quot;the agent went off the rails&quot; — because the framework never modeled what &quot;the rails&quot; were.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Workflow engines&lt;/strong&gt; — Temporal, Argo Workflows, Inngest. These are excellent at deterministic step orchestration. They assume each step is code that you wrote, that produces a known shape of output, and that fails in known ways. Plug a non-deterministic agent into a Temporal workflow and the type system gives up: the agent&apos;s output is a &lt;code&gt;string&lt;/code&gt;, the failure mode is &quot;any exception with any message,&quot; and the workflow&apos;s retry logic cannot tell a transient rate-limit from a logic bug from &quot;the agent gave up.&quot;&lt;/p&gt;
&lt;p&gt;The missing middle is a &lt;strong&gt;deterministic state machine that drives non-deterministic agents.&lt;/strong&gt; The orchestrator is rigid; the worker is fuzzy. The orchestrator&apos;s job is to enumerate every shape the fuzziness can produce and route each shape to a known handler. The agent&apos;s job is to produce one of those shapes.&lt;/p&gt;
&lt;p&gt;NEEDLE is the shape this idea takes when you write it down. The rest of this post is what falls out.&lt;/p&gt;
&lt;h2&gt;The thesis&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;If an outcome can happen, it has a handler.
If it doesn&apos;t have a handler, it cannot happen.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Every state transition in NEEDLE has an explicit handler. There are no implicit fallbacks. There is no &lt;code&gt;match _ =&amp;gt; continue&lt;/code&gt;. There is no &quot;swallow the error, log a warning, hope nobody notices.&quot;&lt;/p&gt;
&lt;p&gt;This sounds like a small constraint. It is the largest constraint in the system, and almost everything else falls out of it.&lt;/p&gt;
&lt;h2&gt;What this looks like in practice&lt;/h2&gt;
&lt;p&gt;A NEEDLE worker is a loop that executes six steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;SELECT&lt;/strong&gt; — query the bead queue for the next claimable task in deterministic priority order.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CLAIM&lt;/strong&gt; — atomically claim the task via a SQLite transaction. Exactly one worker wins.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;BUILD&lt;/strong&gt; — construct the prompt from the task definition. Same task → same prompt, every time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DISPATCH&lt;/strong&gt; — load the agent adapter (Claude Code, OpenCode, Codex, Aider, anything CLI) and invoke it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EXECUTE&lt;/strong&gt; — wait for the agent to exit. The only inputs the orchestrator gets back are the exit code and what was written to disk.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OUTCOME&lt;/strong&gt; — classify what happened. Run the handler. Loop.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The first five steps are mechanical. Almost any orchestration framework can do them. The whole game is in step six.&lt;/p&gt;
&lt;p&gt;Here is the OUTCOME table for one NEEDLE iteration:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Outcome&lt;/th&gt;
&lt;th&gt;Detection&lt;/th&gt;
&lt;th&gt;Handler&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Success&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;exit code &lt;code&gt;0&lt;/code&gt;, output validates&lt;/td&gt;
&lt;td&gt;close the task, log effort, loop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Failure&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;exit code &lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;log failure reason, release the task, increment retry count, loop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Timeout&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;exit code &lt;code&gt;124&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;release the task, mark deferred, loop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Crash&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;exit code &lt;code&gt;&amp;gt;128&lt;/code&gt; (SIGKILL, SIGSEGV, etc.)&lt;/td&gt;
&lt;td&gt;release the task, create an alert task, loop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Race lost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;claim transaction returned no row&lt;/td&gt;
&lt;td&gt;exclude this candidate, retry SELECT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Queue empty&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;no claimable tasks&lt;/td&gt;
&lt;td&gt;enter strand escalation: search other workspaces, do cleanup, alert if all strands exhausted&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Six rows. Every row has a handler. Every row was added because the absence of a handler caused a real bug.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;A few of those rows are worth dwelling on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Race lost is its own outcome, not a failure.&lt;/strong&gt; Two workers see the same top-priority task, both try to claim it, exactly one wins. The loser is not broken. It just needs to skip that task and try the next one. If you don&apos;t model &quot;race lost&quot; as a first-class outcome, you end up with workers that retry endlessly on tasks they will never claim — or worse, with workers that crash with cryptic SQLite errors and get auto-replaced by an outer supervisor that has no idea what just happened.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Queue empty is its own outcome, not idle time.&lt;/strong&gt; When a worker has nothing to do, that is a &lt;em&gt;signal&lt;/em&gt;, not a non-event. It means: this workspace is exhausted, look elsewhere. NEEDLE has a &lt;a href=&quot;/glossary/#strand-escalation&quot;&gt;strand escalation&lt;/a&gt; sequence for this — search other workspaces, do cleanup, propose alternatives for blocked tasks, etc. — but none of that runs unless &quot;queue empty&quot; is a recognized outcome that triggers it. A worker that just spins on an empty queue is wasting cycles and obscuring the signal that the queue is empty.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Crash is distinct from failure.&lt;/strong&gt; A failure is the agent saying &quot;I tried and produced nothing useful.&quot; A crash is the agent dying without saying anything. They look superficially similar. They require different handlers: a failure increments a retry count and tries again; a crash creates an alert and may indicate something fundamentally wrong (the agent binary isn&apos;t installed, the workspace is corrupted, the model provider is rejecting all requests). Conflating them is the difference between a system that self-heals and a system that thrashes.&lt;/p&gt;
&lt;h2&gt;What it costs&lt;/h2&gt;
&lt;p&gt;The deterministic state machine is not free. The cost shows up in three places.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Up-front enumeration.&lt;/strong&gt; You have to sit down and think through every shape your worker can produce. This is harder than it sounds. The natural state of any human-built system is &quot;I&apos;ll add the handler when the bug actually happens&quot; — which works fine for human-supervised work and is actively dangerous for unattended fleets. The first month of NEEDLE was mostly me producing new outcome rows because the system kept finding outcomes I hadn&apos;t thought to enumerate.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Discipline against &lt;code&gt;match _&lt;/code&gt;.&lt;/strong&gt; Rust makes this discipline visible: a non-exhaustive match is a compiler error. Languages without exhaustiveness checks make it tempting to write a wildcard handler that does &lt;em&gt;something reasonable&lt;/em&gt;. Wildcards are how state machines silently grow undefined behavior. The rule has to be: when a new outcome shows up, you stop, you name it, you give it a row in the table, and you write its handler. You do not add it to the wildcard.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Schema-first, not caller-first.&lt;/strong&gt; When you discover a new outcome, you do not patch the call site. You go back to the type that represents the outcome and add a variant. Then the compiler tells you everywhere else that needs to handle the new variant. This is more friction than the alternative — but the alternative is an outcome enum that drifts from reality, with handlers that quietly stop being called.&lt;/p&gt;
&lt;h2&gt;What it&apos;s worth&lt;/h2&gt;
&lt;p&gt;In exchange you get three things that are not available under any other model.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Workers fail predictably.&lt;/strong&gt; Predictable failure is the foundation of recovery. A worker that returns garbage in a &lt;em&gt;known&lt;/em&gt; failure mode — exit code 1, log line in a known format — is more useful than a worker that silently returns subtly-wrong output. The orchestrator can route the known failure; it has no leverage on the silent corruption. Designing for predictable failure means refusing to wallpaper over the failures you cannot classify, and instead either learning to classify them or rejecting the work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The state machine is the contract; agents are the implementation.&lt;/strong&gt; This is the property that lets NEEDLE be agent-agnostic. The state machine doesn&apos;t know whether the worker is Claude Code, OpenCode, Codex, or Aider. It knows that the worker is something that takes a prompt and produces an exit code. Add a new agent and you add a YAML adapter file — no code changes. Drop a worse agent and replace it with a better one — same. The agents are &lt;em&gt;parts&lt;/em&gt;; the state machine is the &lt;em&gt;machine&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You can run twenty of these and reason about what the herd is doing.&lt;/strong&gt; Twenty pet agents are unreasonable. Twenty deterministic state machines, each running the same six-step loop, are reasonable. You stop debugging individual workers and start debugging the &lt;em&gt;outcome distribution&lt;/em&gt; — which row of the table is firing more often than it should? When the failure column trends up, you know to look at the prompts. When the timeout column trends up, you know to look at the model provider. The state machine made each worker&apos;s behavior legible enough that the fleet&apos;s behavior is also legible.&lt;/p&gt;
&lt;h2&gt;What I&apos;d change&lt;/h2&gt;
&lt;p&gt;Three things, with the benefit of running this in production for a while.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Outcome classification should be richer than exit codes.&lt;/strong&gt; Exit codes are a 0–255 alphabet. They are too coarse to express the difference between &quot;agent gave up gracefully&quot; and &quot;agent gave up because the rate-limiter hit it.&quot; Right now NEEDLE squints at stderr to disambiguate. If I rebuilt today, I would have agent adapters return a structured outcome envelope (JSON to a known sentinel path, or a stdout marker) instead of relying on exit codes alone. Exit codes would be the fallback when the envelope is missing. &lt;em&gt;(October: this is happening. Two of the three new outcomes above cannot be read from an exit code at all — gate unsatisfiable is assigned from the gate&apos;s own report, provider error from the agent&apos;s event stream.)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Strand escalation should be a separate state machine.&lt;/strong&gt; &quot;Queue empty&quot; routes to a sequence of fallback behaviors — search other workspaces, do cleanup, propose alternatives, alert if exhausted. Today that sequence is a function inside the OUTCOME handler for queue-empty. It really wants to be its own state machine with its own outcome table. Whenever a section of code starts growing its own enum of &quot;what happened,&quot; that is the system asking for a state machine.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Determinism in the orchestrator does not buy determinism in outcomes.&lt;/strong&gt; Two NEEDLE workers running the same task will produce different outputs because the agent is non-deterministic. That is by design. But it means &lt;em&gt;replaying the orchestration&lt;/em&gt; against a recorded outcome stream is not the same as replaying the work. If I rebuilt today, I would separate &quot;orchestration replay&quot; (deterministic) from &quot;work replay&quot; (impossible without the agent), and design the recording format to make the first kind of replay easy.&lt;/p&gt;
&lt;h2&gt;Five months later: six rows became nine&lt;/h2&gt;
&lt;p&gt;The table above is the one I published in May, and it was already a simplification: NEEDLE had separate rows for an agent binary that isn&apos;t there (exit 126/127) and an agent that was interrupted (130/143), which I folded into Failure and Crash for the post. What has happened since is the more interesting part. Three new outcomes and one new worker state, and every one arrived the way this note says they should — as a bug that had been hiding inside a row that was too broad.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Outcome&lt;/th&gt;
&lt;th&gt;Was hiding inside&lt;/th&gt;
&lt;th&gt;The bug that earned the row&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gate error&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Failure&lt;/td&gt;
&lt;td&gt;A verification gate that could not run at all — missing directory, permission denied, its own timeout — scored the same as work that failed verification. The bead took the blame for the gate. Now it is released without counting against the work.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Gate unsatisfiable&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Failure&lt;/td&gt;
&lt;td&gt;A gate that ran, failed, and would fail for &lt;em&gt;any&lt;/em&gt; possible work. A repository with no upstream configured failed the shipped-work check on every dispatch, and NEEDLE read each failure as &quot;this task is too big&quot; and split it. &lt;a href=&quot;https://github.com/jedarden/NEEDLE/issues/18&quot;&gt;One bead became seven in seventy seconds&lt;/a&gt;, while the code on disk was correct and passing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Provider error&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Whatever the exit code said&lt;/td&gt;
&lt;td&gt;The provider failed, so no verdict on the work exists. One GLM attempt logged fifteen API errors and a 613-second single response; the gateway in front of it had restarted thirteen times that hour. An attempt that fought a dead proxy for twenty-five minutes was indistinguishable from one that thought for twenty-five minutes.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;And one new state, &lt;strong&gt;admission blocked&lt;/strong&gt;: a worker whose launch would push the host past its CPU or memory policy does not start. It stays resident, retries with backoff, and its heartbeat explicitly does not read as idle — because a fleet that keeps launching onto an overloaded host eventually takes the host down with it, and mine did, repeatedly, before this state existed.&lt;/p&gt;
&lt;p&gt;Notice what the three outcomes have in common: each one separates &lt;em&gt;the work failed&lt;/em&gt; from &lt;em&gt;something around the work failed&lt;/em&gt;. That distinction turned out to be the one that matters most, because every downstream handler — retry, split, quarantine, blame — keys on it. Conflate the two and the orchestrator punishes correct work for a broken gate or a dead provider, at machine speed.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I add an outcome handler — before I add any new state to a NEEDLE-like system — I ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What outcome am I making explicit, and what was my system doing about it before?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the answer to the second part is &quot;nothing, it was hidden in a wildcard,&quot; that is the bug I am fixing. If the answer is &quot;it was conflated with a different outcome,&quot; that is also a bug. If the answer is &quot;I am inventing this outcome to handle a hypothetical,&quot; I do not add it. The state machine grows by &lt;em&gt;making implicit outcomes explicit&lt;/em&gt;, not by adding speculative variants.&lt;/p&gt;
&lt;p&gt;This is dual to the cattle question from the last post: &lt;em&gt;can a stateless headless worker complete this with only the inputs I write down?&lt;/em&gt; Together they bound the design space:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cattle says: the &lt;em&gt;agent&lt;/em&gt; must be replaceable.&lt;/li&gt;
&lt;li&gt;State machine says: the &lt;em&gt;orchestrator&lt;/em&gt; must be exhaustive.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Either alone is a tarpit. Cattle without a state machine is a fleet of identical workers all failing in mysterious ways. A state machine without cattle is a beautiful enum that one operator hand-runs forever.&lt;/p&gt;
&lt;p&gt;The combination is the system that runs unattended.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;Background: &lt;a href=&quot;/notes/agents-pets-cattle/&quot;&gt;Pet agents vs. cattle agents&lt;/a&gt; — the mental-model shift this post sits on top of. Code: &lt;a href=&quot;https://github.com/jedarden/NEEDLE&quot;&gt;NEEDLE&lt;/a&gt; — the deterministic state machine described here, in Rust.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>orchestration</category><category>NEEDLE</category><category>state-machines</category></item><item><title>Pet agents vs. cattle agents</title><link>https://jedarden.com/notes/agents-pets-cattle/</link><guid isPermaLink="true">https://jedarden.com/notes/agents-pets-cattle/</guid><description>The infrastructure metaphor that decided how I build with LLMs. Why most people are running pets, why pets do not scale, and what cattle actually require.</description><pubDate>Sun, 03 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When I started running multiple LLM agents in parallel, I burned through a quarter of my Anthropic monthly limit in three days because I was nursing each one. Restarting the long ones when they went off the rails. Hand-curating context windows. Crafting bespoke system prompts. Watching specific sessions like a worried parent.&lt;/p&gt;
&lt;p&gt;The waste was not the tokens. The waste was the model in my head.&lt;/p&gt;
&lt;p&gt;I was treating my agents the way ops teams treated servers in 2008: as &lt;strong&gt;pets&lt;/strong&gt;. Named, hand-tuned, irreplaceable. Each one a small individual project of mine. The day I stopped doing that — the day I started treating agents as &lt;strong&gt;cattle&lt;/strong&gt; — was the day they actually started doing useful work at scale.&lt;/p&gt;
&lt;p&gt;This is the framing decision that sits underneath every other technical choice I make about LLMs in production. It pre-dates the architecture decisions. It pre-dates the framework picks. It is, more than any individual tool, what separates &quot;interesting demo&quot; from &quot;system that runs unattended.&quot;&lt;/p&gt;
&lt;h2&gt;The metaphor&apos;s origin&lt;/h2&gt;
&lt;p&gt;Bill Baker, an engineer at Microsoft, popularized &quot;pets vs. cattle&quot; sometime around 2012 to describe the shift from artisanal server management to fleet-scale operations. The pet was the box you named after a Norse god, ssh&apos;d into to fix manually, panicked about when it went down. The cow was the AMI you spun up in an autoscaling group, terminated without ceremony when it misbehaved, and replaced from the same template five seconds later.&lt;/p&gt;
&lt;p&gt;The shift the industry made — from pets to cattle — was not primarily about scale. It was about &lt;em&gt;amortizing the cost of operating things&lt;/em&gt;. You cannot afford to know every server&apos;s name when you have ten thousand of them. The cattle model says: build the inputs, build the lifecycle, observe the outputs, and stop investing in any individual instance.&lt;/p&gt;
&lt;p&gt;LLM agents in 2025 are sitting roughly where servers sat in 2010. Most people are running pets. The cattle model exists, but it requires more infrastructure than most teams have built yet, and the framing has not made it into the public conversation.&lt;/p&gt;
&lt;h2&gt;What pet agents look like&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You probably already know whether you are running pets, but the symptoms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You have a long-lived chat session you have spent hours curating context for, and you actively mourn the day you have to start a new one.&lt;/li&gt;
&lt;li&gt;You hand-tune a system prompt for a specific task, then never reuse it on a different task because it would not transfer.&lt;/li&gt;
&lt;li&gt;When the agent goes off the rails mid-task, you intervene. You re-prompt. You correct. You steer.&lt;/li&gt;
&lt;li&gt;You measure success by the quality of any &lt;em&gt;one&lt;/em&gt; output, not the throughput of the system.&lt;/li&gt;
&lt;li&gt;You are the orchestrator. The agent is the worker. Both jobs cost your attention.&lt;/li&gt;
&lt;li&gt;The cost of failure is high enough that you avoid letting it run unsupervised.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Pet agents are not bad. They are the right tool for high-judgment, one-off, exploratory work. The bug fix you cannot describe well enough for autonomous work. The design conversation that benefits from a back-and-forth. Anything where the &lt;em&gt;value&lt;/em&gt; of the output justifies the cost of your attention.&lt;/p&gt;
&lt;p&gt;The trap is using pet agents for work that is bulk, repetitive, or asynchronous. That is where the model breaks.&lt;/p&gt;
&lt;h2&gt;What cattle agents look like&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The cattle model has a few non-negotiable properties:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Headless.&lt;/strong&gt; The agent does not chat. It receives a prompt, does work, exits. The exit code and the diff it produced are the entire interface. There is no human in the loop during the run.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Stateless.&lt;/strong&gt; Each invocation reconstructs its own context from durable inputs. Same task, same context, same prompt — every time. If the worker dies mid-run, another worker starts the same task fresh from the same state. No &quot;resuming&quot; a session.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Replaceable.&lt;/strong&gt; Workers are anonymous. Identified by NATO-alphabet identifiers (&lt;code&gt;alpha&lt;/code&gt;, &lt;code&gt;bravo&lt;/code&gt;, &lt;code&gt;charlie&lt;/code&gt;) — interchangeable enough that the names are deliberately content-free. When a worker fails, you do not investigate that worker. You investigate the task it was working on, then dispatch another worker.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Observed at the herd level.&lt;/strong&gt; You do not look at individual sessions. You look at fleet metrics: tasks completed per hour, cost per task, failure rate by category, queue depth. The unit of analysis is the herd, not the cow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Governed at the fleet level.&lt;/strong&gt; Spend caps, rate limits, weekly quotas — all enforced at the orchestrator, not the agent. No agent can spend more than the herd is allowed to spend, regardless of what the agent decides to do.&lt;/p&gt;
&lt;p&gt;Concretely, this is what NEEDLE does. A worker is a tmux session running a deterministic state-machine loop: select the next task from a shared queue, claim it atomically, build the prompt from the task definition, dispatch to a headless CLI (Claude Code, OpenCode, Codex, Aider — agent-agnostic), wait for an exit code, classify the outcome, handle it, loop. The agent does the fuzzy work; the orchestrator handles every other dimension.&lt;/p&gt;
&lt;p&gt;It is unromantic on purpose. The agent is a black box that produces work; the orchestration is the part you can reason about.&lt;/p&gt;
&lt;h2&gt;What you give up&lt;/h2&gt;
&lt;p&gt;Treating agents as cattle has real costs. Anyone who tells you otherwise has not actually run them this way:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You give up the warm context.&lt;/strong&gt; A pet session, after an hour of back-and-forth, has accumulated a lot of nuance: corrections you made, dead ends you ruled out, preferences you taught it. Cattle agents start cold, every time. Whatever you have not encoded into the &lt;em&gt;task definition&lt;/em&gt; is gone.&lt;/p&gt;
&lt;p&gt;This forces you to write task definitions seriously. The work that used to live in your conversation history now has to live in the bead, the prompt template, the reference docs. It is more discipline up front and less recovery in the moment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You give up the moment-to-moment steering.&lt;/strong&gt; When a pet agent starts heading the wrong way, you stop it. Cattle agents finish the wrong way. They produce a bad output, the orchestrator classifies it as failure, the task gets retried — possibly with the same wrong approach, possibly with a different worker that happens to be configured differently.&lt;/p&gt;
&lt;p&gt;This forces you to be explicit about &lt;em&gt;what wrong looks like&lt;/em&gt;. Acceptance criteria become real artifacts, because the orchestrator needs to evaluate them automatically. &quot;I will know it when I see it&quot; is not a thing cattle can implement.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You give up the artisan&apos;s pride.&lt;/strong&gt; Each pet session has the satisfying texture of &quot;we built this together, you and the agent.&quot; Cattle is fungible by design. You stop having a relationship with any specific worker. You only have a relationship with the throughput of the system.&lt;/p&gt;
&lt;p&gt;This is the part most people resist hardest. It is genuinely a loss.&lt;/p&gt;
&lt;h2&gt;What you cannot have without cattle&lt;/h2&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In exchange, you get three things that are simply not available in the pet model:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Parallelism.&lt;/strong&gt; I have run twenty NEEDLE workers concurrently on the same workspace. They coordinate through atomic claims on a shared bead queue (a SQLite transaction means exactly one worker wins any given claim — though atomic claims turned out to be necessary rather than sufficient: &lt;a href=&quot;/notes/what-breaks-at-twenty-agents/#7-the-claims-that-leak&quot;&gt;a claim can outlive its worker, and a sweep that releases it too eagerly hands one task to two workers&lt;/a&gt;). I cannot manage twenty pet agents. Nobody can. The pet model has a hard ceiling around three or four sessions before the human becomes the bottleneck.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cost governance.&lt;/strong&gt; When I had pet agents, I was the spend control. I noticed when one was running long and stopped it. I noticed when one was being expensive and intervened. With twenty headless workers running unattended, I cannot be the spend control — the orchestrator has to be. claude-governor caps spend, throttles workers, and gates against weekly Anthropic limits. None of that is meaningful in a pet model because the pet has only one operator and that operator is paying attention.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Failure as a normal mode.&lt;/strong&gt; A pet session &quot;failing&quot; is a small disaster. You console yourself, restart, try to recover the context. A cattle worker failing is &lt;em&gt;expected&lt;/em&gt;. The orchestrator has an explicit handler for every outcome a worker can produce — success, failure, timeout, crash, race-lost, queue-empty. None of those is exceptional. Each has a defined recovery path. Workers fail constantly; the system does not.&lt;/p&gt;
&lt;p&gt;This last point is the one I underestimated longest. In a pet model, failure is the thing you try to avoid. In a cattle model, failure is just one more outcome the orchestrator routes. You stop optimizing for &quot;agents that don&apos;t fail&quot; and start optimizing for &quot;an orchestrator that handles failures cleanly.&quot; That second target is much more tractable.&lt;/p&gt;
&lt;h2&gt;The honest tradeoff&lt;/h2&gt;
&lt;p&gt;This is not a story where one model wins. They are tools for different shapes of work.&lt;/p&gt;
&lt;p&gt;Pets are right when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The task requires high-judgment back-and-forth.&lt;/li&gt;
&lt;li&gt;The unit of value is one specific output, not throughput.&lt;/li&gt;
&lt;li&gt;You cannot fully specify success in advance.&lt;/li&gt;
&lt;li&gt;The cost of getting it wrong is high enough to justify your attention.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cattle are right when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The work is bulk, queueable, asynchronous.&lt;/li&gt;
&lt;li&gt;Success is specifiable enough that the orchestrator can classify outcomes.&lt;/li&gt;
&lt;li&gt;Throughput matters more than any individual artifact.&lt;/li&gt;
&lt;li&gt;The economics only work if a human is not in the loop.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Most teams I see are running pet workflows on tasks that should be cattle. The fix is not just buying more agents — it is rewriting the &lt;em&gt;task&lt;/em&gt; so that an unattended agent can succeed at it. That rewrite is the actual work. Once the task is specified well enough for cattle, the orchestration layer is a handful of weekends.&lt;/p&gt;
&lt;h2&gt;The question I now ask&lt;/h2&gt;
&lt;p&gt;Before I build anything new with LLMs, I ask one question:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Could a stateless, headless worker that does not know my name complete this task with only the inputs I write down?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the answer is yes, it goes into the cattle pipeline.&lt;/p&gt;
&lt;p&gt;If the answer is no, I do one of three things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Specify the task harder until the answer becomes yes.&lt;/li&gt;
&lt;li&gt;Decide it is genuinely a pet task and budget my attention accordingly.&lt;/li&gt;
&lt;li&gt;Decide LLMs are the wrong tool for this and write the code myself.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The point is not that one answer is correct. The point is that I now make the &lt;em&gt;decision&lt;/em&gt;, deliberately, instead of defaulting to pets because pets are what the chat interface trained me to do.&lt;/p&gt;
&lt;p&gt;The chat interface is wonderful for what it is. It is the tutorial. It is not the production system.&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;em&gt;If you want to see what the cattle model looks like as code: &lt;a href=&quot;https://github.com/jedarden/NEEDLE&quot;&gt;NEEDLE&lt;/a&gt; is the orchestrator (Rust, deterministic state machine; workers run as tmux sessions today, and it is built to run them in containers — proven on an isolated cluster, not yet packaged for general use); &lt;a href=&quot;https://github.com/jedarden/claude-governor&quot;&gt;claude-governor&lt;/a&gt; sizes the fleet against subscription quota; &lt;a href=&quot;https://github.com/jedarden/ccdash&quot;&gt;ccdash&lt;/a&gt; is the herd-health TUI. All three exist because none of this works without all three.&lt;/em&gt;&lt;/p&gt;
</content:encoded><category>agents</category><category>orchestration</category><category>NEEDLE</category><category>claude-governor</category></item><item><title>A new place for opinions and biases</title><link>https://jedarden.com/notes/welcome/</link><guid isPermaLink="true">https://jedarden.com/notes/welcome/</guid><description>Why I started these notes, what I plan to put on this surface, and what to expect.</description><pubDate>Sat, 02 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I build agent infrastructure for a living. Most of what I have learned about
running headless LLMs in production lives in commit messages, internal
docs, and conversations that never make it past the room they happen in.
This is the surface where some of it leaks out.&lt;/p&gt;
&lt;h2&gt;What I plan to write about&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Headless LLM systems&lt;/strong&gt; — the work between &quot;agents are interesting&quot;
and &quot;agents run unattended in production.&quot; Orchestration, cost
governance, observability, fleet operations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Strong opinions, weakly held&lt;/strong&gt; — what I currently believe about how
agent infrastructure should be built, and why. I expect to be wrong
about some of these and look forward to the corrections.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Post-mortems on my own decisions&lt;/strong&gt; — patterns that paid off, patterns
that didn&apos;t, and the difference between the two.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What I won&apos;t write about&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Hot takes on the latest model release.&lt;/li&gt;
&lt;li&gt;Frameworks I haven&apos;t actually used in anger.&lt;/li&gt;
&lt;li&gt;Speculation dressed up as expertise.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If something here is useful, it earned its place by being grounded in a
shipped system. The bar is &quot;code I run, problems I hit, fixes that
actually held.&quot;&lt;/p&gt;
&lt;p&gt;— Jed&lt;/p&gt;
</content:encoded><category>meta</category></item></channel></rss>