Today (December 1, 2026) I opened Herdr and counted 13 coding agents. Claude Code and Codex, spread over about 10 projects: client work, research and my own tools. Only one was busy, helping me with this article. The other twelve were waiting for their next task.
Keeping that many agents useful didn’t come from better prompts. It came from a setup.a
So here’s the plan. First, I put Andrej Karpathy (he co-founded OpenAI and coined “vibe coding”), Boris Cherny (he created Claude Code), Kent Beck (he created Extreme Programming and popularised TDD) and Mitchell Hashimoto (he co-founded HashiCorp and created Terraform and Ghostty) side by side and look at how each of them works with agents. Then I show you the setup I built from their ideas, with real files you can copy: a 29-line rules file, a verify script, a Stop hook and a strict way to run several agents at once.
When I started coding with AI agents, one question kept coming back:
“Why does the same agent build something great one day, and a mess the next?”
Sometimes Claude Code would build a feature cleanly. Other times it would rewrite half of the project, invent an abstraction nobody asked for, and tell me “all tests pass” without running them.
At first I thought the answer was a better prompt. It wasn’t.
The answer was structure. Same thing I learned with C and Go: a project without structure doesn’t scale. And agents are no different.
So I went to look at how the best people do it. I kept what made sense, threw away what didn’t, and built my own kit. I call it agent-kit. It’s one folder in my GitHub directory, and every coding agent I use reads from it.
Part 1. How the Best Engineers Work With Agents
Andrej Karpathy: the slider and the leash
Karpathy gave us “vibe coding” in February 2025: you prompt, you accept, you “forget that the code even exists”. Fun for a weekend. Not fun when you have to fix it on Monday.
In his YC talk “Software Is Changing (Again)” he described an autonomy slider: tab-completion on one end, a full agent on the other, and you move it, task by task. The hard part isn’t writing code, it’s checking it. An agent produces a diff much faster than you can read it. So keep changes small and keep the AI on a leash.
In February 2026 he wrote that, in his view, coding agents “basically didn’t work before December [2025] and basically work since”. But a month earlier he had listed what they still get wrong:
They make assumptions for you and just run with them.
They overcomplicate: extra layers, big APIs, error handling for things that can’t happen.
They touch code they weren’t asked to touch, and don’t clean up after themselves.
I’ve seen every one of these. More than once.
Boris Cherny: what the creator of Claude Code actually does
In January 2026 he shared his setup. It’s simpler than I expected:
Five Claudes in parallel in numbered terminal tabs, plus 5-10 more sessions on the web.
Plan mode first. He starts most sessions in plan mode and only lets Claude write code when the plan is good.
One CLAUDE.md for the whole team, in git. When Claude gets something wrong, they add a line.
Subagents for repeated work, like a code-simplifier and a verify-app agent.
A hook that formats code after every edit.
And the big one: give Claude a way to verify its own work. In his experience, that gives 2-3x the quality of the final result. No secret prompts.
Kent Beck: tests keep the genie honest
Kent Beck calls AI an “unpredictable genie”. You get what you asked for, just not always the way you meant it. His fix is test-driven development (TDD): write a failing test first. A failing test is a very precise wish.
He also warns that agents will delete or weaken a test just to make it pass. So you have to say it out loud: fix the code, not the test.
Mitchell Hashimoto: fix the setup, not the output
This one changed my thinking the most. Mitchell Hashimoto (HashiCorp, Ghostty) calls it “harness engineering”: when an agent makes a mistake, you build something so it never makes that mistake again. Not “fix the code and move on”. Fix the environment: a line in AGENTS.md, a script, a check.
He also splits vague work into separate planning and execution sessions. And he runs one agent at a time, by choice.
Others point the same way. Simon Willison calls it “agentic engineering”: you still own what you ship. Addy Osmani treats the agent like a fast but unreliable junior developer. Matt Pocock’s grill-me skill makes the agent interview you first.
Side by side
A blank cell means I didn’t find it in the sources above, not that they disagree.
Practice
Karpathy
Cherny
Beck
Hashimoto
Plan before code
most sessions start in plan mode
separate planning sessions for vague tasks
Verification
checking is the bottleneck
give Claude a way to verify
TDD, never weaken tests
fast tools that say “wrong”
Small steps
small changes, AI on a leash
a test as a precise wish
clear tasks, not one mega session
Mistakes become fixes
add a line to CLAUDE.md
harness engineering
Parallel agents
5 local + 5-10 web
one at a time, by choice
Don’t guess or overbuild
his list of agent mistakes
Nothing here is new. It’s the same engineering discipline we always needed, applied to a teammate that writes code faster than you can review it.
Part 2. How I Set It Up: agent-kit
The kit is one folder: my global rules, a set of skills (pipeline, tdd, review-diff, ship, learn, herdr-team and a few more), four subagents, three hooks and a project template. An install.sh links it into each tool:
Piece
Linked into
global/AGENTS.md
~/.claude/CLAUDE.md, ~/.codex/AGENTS.md, ~/.gemini/GEMINI.md
skills/*
~/.claude/skills/, ~/.agents/skills/ (Codex, Gemini CLI)
hooks
merged into each tool’s settings, without overwriting mine
Why one folder? I change a rule once, and Claude, Codex and Gemini all get it. And since everything I add costs context, every piece has to earn its place.
Step 1: A short rules file
This is the most important file, and it’s tiny: 29 lines. It’s loaded at the start of every session and stays in context the whole time. Here’s the core, straight from the repo:
## Working style
– Be concise. Explain important architectural decisions; skip the obvious.
– State assumptions. Ask only when ambiguity affects correctness; otherwise take the conservative option and say so.
– Change only what was asked. Match local style. Mention unrelated issues, don’t fix them.
– Before writing code: does it need to exist? Is it already in the codebase? Does the stdlib or platform cover it? Only then write the minimum.
– No speculative abstractions, options, or error handling for impossible cases. Never edit code you haven’t read.
– Ask before destructive or hard-to-reverse actions.
## Verify
– Run the project’s checks (`scripts/verify.sh` if present) before saying done, and show the result.
– Fix the code, not the test. Never skip, delete or weaken a failing test.
Notice where these lines come from:
“State assumptions”, “change only what was asked”, “no speculative abstractions” are Karpathy’s complaints, turned into rules.
“Does it need to exist? … stdlib?” is a small decision ladder. JetBrains tested a skill built on this idea. With the rules injected into the prompt, cost went down by about 10%. In a separate test, the bare skill activated itself 0 times out of 10. So I made it a rule. Rules are always loaded. Skills load only if the agent decides to use them.
“Fix the code, not the test” is Kent Beck.
My test for every line: “Would removing this cause a mistake?” If not, I delete it. Long rules files get skimmed, by agents and by people.
Step 2: One command to check the work
Every project gets a short AGENTS.md (what the app does, a map of folders, the commands, and a “Gotchas” list that only grows after a real mistake). CLAUDE.md is just @AGENTS.md, so all agents read the same file. (If you want the full picture of these memory files, this guide to CLAUDE.md, AGENTS.md and friends covers them well.)
But the file that matters most is scripts/verify.sh: lint, types and unit tests, with a target of under a minute. The template guesses the stack from the files it finds. Here’s an excerpt:
fail=0
ran=0
run() { ran=1; echo “→ $*”; “$@” || fail=1; }
if [ -f pyproject.toml ] || [ -f requirements.txt ]; then
py=””
[ -f uv.lock ] && py=”uv run”
if grep -qs ‘ruff’ pyproject.toml && { [ -n “$py” ] || command -v ruff >/dev/null; }; then run $py ruff check .; fi
if [ -d tests ] || [ -d test ]; then run $py pytest -q -x; fi
fi
[ -f go.mod ] && { run go vet ./…; run go test ./…; }
[ -f Cargo.toml ] && run cargo test -q
[ “$ran” = 1 ] || echo “verify.sh: no checks detected – edit scripts/verify.sh for this project” >&2
exit $fail
The full file also handles Node (npm, pnpm, yarn, bun), Swift and Flutter.
Careful: this is a starting point. When it finds nothing, it prints a warning and still exits 0, so “green” means nothing there. Make it run your real checks, and if you rely on green, make “no checks” an error.
The point is one command that every agent knows to run. Boris’s “give Claude a way to verify its work”, as a file.
Step 3: A pipeline where I approve three things
For a real feature, I type /pipeline add password reset, and the lead agent goes through nine phases:

#
Phase
Output
Who approves
1
Intake
questions, each with a suggested answer
2
Spec
docs/specs/.md: goal, acceptance criteria, how to verify
me
3
Plan
docs/plans/.md: tasks, files each task owns, size
me
4
Build
a branch, TDD, one worktree per parallel group
5
Test
verify.sh + test runner + verify-app for UI/API
6
Validate
/simplify, then code review (max 2 fix rounds)
7
Docs
README, changelog, a decision record if needed
8
Commit/PR
Conventional Commits, PR with test evidence
me
9
Learn
mistakes become a rule, a hook or a note
A few choices on purpose:
Intake works like grill-me. The agent reads the code first and only asks me about decisions, with a suggested answer for each.
The plan is where my attention goes. Each task lists exactly which files it owns, so two agents never edit the same file.
Small changes skip all of this. One or two files go straight to tdd, then ship. (For a different take on a full Claude Code flow, see Navigating Claude Code: The Full Workflow.)
Max two review rounds. Then it comes back to me. Agents that loop forever just burn money.
Not every phase needs the smartest model. Lead, spec, plan, build and review use the top tier. Boilerplate goes to a mid tier. Searches, test runs and logs go to a cheap subagent that returns a short summary, so the lead’s context stays clean. Risky changes get a second opinion from another provider’s model, because it finds different bugs. Tiers live in docs/agents.md, so a new model is a one-line change.
Step 4: Hooks, the rules the agent doesn’t get to skip
A rule in a markdown file is a request. A hook is code that runs every time its event fires.
I have three, and they’re wired a bit differently per tool:
Hook
Claude Code
Codex
Gemini CLI
guard.sh (block dangerous actions)
PreToolUse on Bash, Edit, Write, MultiEdit, NotebookEdit
PreToolUse on Bash, apply_patch
BeforeTool on run_shell_command, write_file, replace
format.sh (project’s own formatter)
PostToolUse on Edit, Write, MultiEdit
PostToolUse on apply_patch
not wired
verify-on-stop.sh
Stop
Stop
not wired
guard.sh blocks things like recursive rm of /, ~ or ., force pushes, git reset –hard, and edits to .env, lockfiles and .git/. It’s a pattern check on those events, not a sandbox, so I keep each tool’s own permission prompts on too. format.sh is Boris’s hook.
verify-on-stop.sh is my favourite. When the agent tries to finish, it runs scripts/verify.sh. If that fails, the hook sends the errors back and the agent keeps working. Here’s the whole script:
#!/usr/bin/env bash
set -u
command -v jq >/dev/null 2>&1 || exit 0
input=$(cat)
cwd=$(jq -r ‘.cwd // empty’ <<<“$input”); [ -n “$cwd” ] || cwd=$PWD
root=$(git -C “$cwd” rev-parse –show-toplevel 2>/dev/null) || exit 0
[ -x “$root/scripts/verify.sh” ] || exit 0
cd “$root” || exit 0
changed=$({ git diff –name-only; git diff –cached –name-only; git ls-files –others –exclude-standard; } 2>/dev/null |
grep -vE ‘^docs/|\.md$’ || true)
[ -n “$changed” ] || exit 0
hash=$({ git diff; git diff –cached; git ls-files -z –others –exclude-standard | xargs -0 git hash-object –; } 2>/dev/null | shasum | cut -c1-40)
state=”${TMPDIR:-/tmp}/agent-kit-verify/$(printf ‘%s’ “$root” | shasum | cut -c1-12)”
mkdir -p “$state”
[ “$(cat “$state/pass” 2>/dev/null)” = “$hash” ] && exit 0
if [ “$(cat “$state/fail” 2>/dev/null)” = “$hash” ]; then exit 0; fi
fails=$(cat “$state/count” 2>/dev/null || echo 0)
if out=$(scripts/verify.sh 2>&1); then
echo “$hash” >”$state/pass”; echo 0 >”$state/count”
exit 0
fi
echo “$hash” >”$state/fail”
[ “$fails” -ge 3 ] && { echo 0 >”$state/count”; exit 0; }
echo $((fails + 1)) >”$state/count”
{
echo “scripts/verify.sh failed. Fix the code (not the tests), then finish. Last 60 lines:”
tail -n 60 <<<“$out”
} >&2
exit 2
exit 2 plus a message on stderr is how Claude Code and Codex understand “blocked, here’s why”. The agent gets the last 60 lines of errors and goes back to work.
Notice the hash. The hook fingerprints the current changes, which makes it a bounded retry, not a wall:
No change since the last green run? It skips the checks.
The agent stops again without changing anything? It lets it go. Usually the agent is stuck or asking me something.
Three blocks in a row? It lets the agent stop, so it can’t loop forever.
Only docs changed, no git repo, or no executable scripts/verify.sh? It does nothing.
So a failing check can still get through. The hook makes “done” without green tests rarer; it doesn’t replace CI, which is still my real gate. But I rarely have to ask “did you run the tests?” anymore.
Step 5: Running a team of agents with Herdr
Boris runs five Claudes in tabs. With more than a few open, the hard part is knowing which one is waiting for you.
That’s what Herdr solves for me. It’s a terminal multiplexer made for coding agents. Like tmux, but it knows what each agent is doing: working, blocked (waiting for me), idle or done (GitHub). It’s where those 13 agents live.
Agents can control Herdr too. My lead agent starts a worker with herdr agent start, sends it a task with herdr agent prompt, and waits with herdr agent wait. No copy-paste between tabs.
More agents ≠ more output. If agents chat freely, you mostly get confusion and a big bill. So my herdr-team skill keeps it strict:

One lead, many workers. Only the lead starts agents, sends tasks and talks to me. Workers never message each other.
Each worker gets its own git worktree: a separate checkout on its own branch, sharing one repository. My wt script creates it, copies the local .env files, installs dependencies, and writes a free port into a .worktree file. If the dev server reads that port, two servers don’t collide.
Tasks point to files, they don’t paste them. A task is five short lines: [from:lead] TASK , the plan section, the files the worker owns and its branch, a “done when” (usually: scripts/verify.sh is green), and where to write a short report.
The lead reads one line back. Every worker ends with STATUS: done|blocked|failed, the report path and a few words. The lead opens the report only if needed and never reads the full conversation.
Reviews cross providers. Codex reviews what Claude built.
Workers don’t need to know any of this. One line in my global rules says that a message starting with [from:] comes from another agent: do that task only and end with the STATUS: line.
No Herdr? The same messages work headless (claude -p, codex exec) or as subagents in one session.
Step 6: Learn from every mistake
This is the step most setups skip.
After every pipeline run, /learn looks at what went wrong or took more than one try, and turns it into the cheapest fix that sticks:
a hook, if it must always hold;
a line in the project’s AGENTS.md, if it’s project-specific;
a note in docs/solutions/, for one-off problems;
a change to agent-kit, if every project needs it.
That’s Hashimoto’s harness engineering and Boris’s “add it to CLAUDE.md”, as a step that always runs.
What I Didn’t Add (and Why)
No big skill packs. They overlap with my pipeline, and two systems with different rules confuse the agent.
No “be short” skill. In one test on fresh one-off runs, such a skill cut output tokens by 38% but raised cost by 11%, because loading the skill costs tokens too. “Be concise” in my rules costs one line.
No extra global MCP servers (MCP servers are plugins that give the agent extra tools). CLIs like gh, supabase and vercel cost nothing until the agent calls them.
No extra planner, explorer or security agents. Claude Code already has plan mode, Explore and /security-review.
Skill names and descriptions sit in context so the agent can pick one, and Claude Code gives that list a budget of about 1% of the context window by default. Past that, descriptions get cut short. More tools are not free. If a rule or a hook can do the job, use that.
How to Set This Up Yourself
You don’t need my repo to start. Here’s a first step you can do today with Claude Code.
You need git and jq. Save the Stop hook from Step 4 as ~/agent-kit/hooks/verify-on-stop.sh (or anywhere, just fix the path below), and add a scripts/verify.sh to your project that runs your real checks. Make both executable with chmod +x. Then register the Stop hook in ~/.claude/settings.json (all projects) or .claude/settings.json (one project):
{
“hooks”: {
“Stop”: [
{
“hooks”: [
{ “type”: “command”, “command”: “$HOME/agent-kit/hooks/verify-on-stop.sh”, “timeout”: 600 }
]
}
]
}
}
To see it work, break one test on purpose and ask the agent to make a small code change. When it tries to finish, it should get the verify output back and keep going. In Codex the same hook goes into ~/.codex/hooks.json, and you may need to approve it once with /hooks.
After that, this is the order I’d go in:
A short global rules file (≤40 lines). Start with Karpathy’s list of mistakes.
A guard hook for rm -rf, force pushes and .env edits, with the tool’s permission prompts still on.
Plan first for anything bigger than two files, and actually read the plan.
Noisy work to cheap subagents: tests, searches, logs.
Parallel only after all this works. One worktree per agent, one lead, one STATUS line back.
After every mistake, ask: what rule, hook or note would have stopped this? Add exactly that.
Final Thoughts
When I started, I thought working with agents was about writing better prompts.
I don’t think that anymore. For me it’s closer to onboarding a new teammate. You give them a short list of rules. A script that checks their work. A plan you actually read before they start. And hooks that push back when the checks fail, with CI having the final word.
Karpathy’s slider is still in your hand. A good setup just lets you push it a bit further without losing track of what you ship.
In part 2 I’ll go deeper into the part that helped me the most: verification. How the Stop hook behaves in real projects, where it gets in the way, and how I use Codex to review Claude’s code.
Got your own setup? Think I’m missing something? Tell me in the comments. I’m still learning this, like everyone else.
Sources
Andrej Karpathy, the “vibe coding” post, February 2025
Andrej Karpathy, Software Is Changing (Again), YC AI Startup School, June 2025
Andrej Karpathy on coding agents since December and on the mistakes LLMs make when coding, 2026
Boris Cherny, how I use Claude Code, January 2026
Simon Willison, Agentic Engineering Patterns
Addy Osmani, Agentic Engineering
The Pragmatic Engineer, TDD, AI agents and coding with Kent Beck
Mitchell Hashimoto, My AI Adoption Journey
Matt Pocock, skills (grill-me)
JetBrains, testing the ponytail skill
agentcraft, testing the caveman skill
Claude Code docs, skill descriptions are cut short
Herdr (GitHub)