This is f*cking insane. An engineer on Anthropic's Claude Code team just admitted the setup most people built this year is now making Claude worse:
"At Anthropic we run dozens of sessions at once, for hours, and they verify their own work. We've basically become managers of agents
We went from 2,500 changes a day in May to more than 30,000 a day in September"
In just 17 minutes, she shows what to delete from your CLAUDE.md, why auto mode blocked 89% of dangerous commands when humans caught 14%, and how one orchestrator runs 8 sessions for you
Prompts → Agents → Harness → Orchestrator → 30,000 Changes A Day
The model does the steering now and auto mode does the approving
Hooks, tests and CI do the checking, so you just start the first session and review what comes out
Most people still approve every command by hand, Anthropic's own team stopped doing that in August
Worth more than 99% of paid Claude Code tutorials
Save it before you touch your CLAUDE.md again
Then read my step-by-step graph engineering course below while it's still early ↓
This is f*cking insane. An engineer on Anthropic's Claude Code team just admitted the setup most people built this year is now making Claude worse:
"At Anthropic we run dozens of sessions at once, for hours, and they verify their own work. We've basically become managers of agents
We went from 2,500 changes a day in May to more than 30,000 a day in September"
In just 17 minutes, she shows what to delete from your CLAUDE.md, why auto mode blocked 89% of dangerous commands when humans caught 14%, and how one orchestrator runs 8 sessions for you
Prompts → Agents → Harness → Orchestrator → 30,000 Changes A Day
The model does the steering now and auto mode does the approving
Hooks, tests and CI do the checking, so you just start the first session and review what comes out
Most people still approve every command by hand, Anthropic's own team stopped doing that in August
Worth more than 99% of paid Claude Code tutorials
Save it before you touch your CLAUDE.md again
Then read my step-by-step graph engineering course below while it's still early ↓
This is f*cking insane. Anthropic hired this ex-Google engineer at $600K-$1.5M a year
Because his AI agents ship code that nobody has to babysit
In this 42-minute workshop, he builds a whole app live and doesn't write a single line of it himself
Prompts → Agent Skills → Harness → Graphs → Agents That Ship While You Sleep
step 1 → Refine the idea - you type one vague sentence, the agent asks 5 questions and comes back with 3 product directions
step 2 → Lock the spec - success metrics, stack and open questions are settled before a single file exists
step 3 → Slice the work - every task gets its own pass criteria and a fence around the files it's allowed to edit
step 4 → Build test-first - each slice goes red to green, so the agent can't quietly break what already worked
step 5 → Verify and review - it opens the app in a browser, hunts for leaked keys and security holes, then deletes its own extra code
He calls this "agentic engineering" and gave all 20+ skills away for free
The human reviews the result, not every step
Worth more than most $2,000 agentic engineering courses
Save it before your next sprint planning
Then read my free course on running 20 agents through a process like this overnight below ↓
This is f*cking insane. Elon Musk, the richest man alive, just said the internet already belongs to AI agents:
"Agentic traffic already exceeds human traffic online. In 5 years it'll be 1,000x more, and I think even that is underestimating it
AI doubles the productivity of every white-collar worker. Then 20 to 30 million robots, each doing the work of 5 people, match the output of the entire US"
His endgame: superintelligence pays everyone a universal high income
In under 5 minutes, he breaks down why the next economy runs on agents, not office hours
Human Traffic → Agent Traffic → Agent Graphs → Robot Workforce → Universal High Income
Agent traffic means software that searches, compares and buys for you while nobody clicks a thing
Put those agents in a graph and one person runs thousands of them overnight
Everyone is still clicking through the internet by hand, almost nobody has agents doing it for them
Worth more than a $15K MBA module on the future of work
Save and watch it today
Then read how I run 20 agents as one graph while I sleep in the article below ↓
Companies pay $300K+ a year for engineers who can run AI agents without babysitting them
Last week 20 Claude Code agents shipped 143 changes while I slept. I approved 6 merges
Here is graph engineering in Claude Code, file by file. Free ↓
2
27
655
This is f*cking insane. Manus co-founder Tao Zhang, the man whose agent startup Meta tried to buy for $2B:
"In 8 months we changed how we hire. AI is already good at doing things, so we don't need more people who are only good at doing things
Engineers don't take coding exams here anymore. They get 4 hours and an agent, and the best ones now ship like a team of 8"
In 2 minutes, he lays out why Manus deleted every job title inside the company, and why its PMs now ship code while its designers write it
Job Titles → Coding Exams → AI Co-Workers → Agent Graphs → One Person, Every Role
A coding exam tests what you can do alone
A 4-hour session tests what you can ship with a graph of 20 agents behind you
Easily worth more than a $1,500 interview bootcamp
Save this for the day your company drops job titles
Then read my free course on running 20 Claude Code agents overnight below ↓
Companies pay $300K+ a year for engineers who can run AI agents without babysitting them
Last week 20 Claude Code agents shipped 143 changes while I slept. I approved 6 merges
Here is graph engineering in Claude Code, file by file. Free ↓
4
29
536
This is f*cking insane. Mistral CEO Arthur Mensch, the man running Europe's $21B answer to OpenAI:
"Every company now runs on 2 or 3 AI providers. They use the data your systems produce to build better systems, and then they go after your business
That's the end game, and it's already priced in"
In this 49-minute interview, he explains why renting all your AI from one lab is the fastest way to train your own competitor, and why open models already beat them in many domains
Prompts → Agents → Your Data → Their Models → Your Competitor
The man building Europe's only frontier lab is telling you exactly who the big labs come for next
95% of companies will hand their best data to the labs, the 5% who own their stack will be the ones still standing
Worth more than any $5,000 AI strategy course
Bookmark it and send it to someone who still pastes client data into ChatGPT
Then read how to run your own graph of agents overnight in the graph engineering guide below ↓
Companies pay $300K+ a year for engineers who can run AI agents without babysitting them
Last week 20 Claude Code agents shipped 143 changes while I slept. I approved 6 merges
Here is graph engineering in Claude Code, file by file. Free ↓
3
31
629
This is f*cking insane. OpenAI CEO Sam Altman, on stage in Abu Dhabi:
"At the start of this year, AI wasn't as smart as our smartest scientists. Now it's smarter than them
It couldn't do most white-collar jobs. Now it can do most of them, and we're all still not dreaming big enough"
In 10 minutes, he explains why one person now burns 500 billion tokens a month, when six years ago the top user at OpenAI used 100,000
Chat → Agents → Loops → Graphs → 500 Billion Tokens a Month
You don't burn that many tokens typing prompts
You burn them with a graph of agents that keeps working all night while you sleep
This talk is worth more than most $1,000 AI product bootcamps
Bookmark it, then watch it with the sound on
Then read how to build that overnight agent graph, file by file, in the article below ↓
This is f*cking insane. Mira Murati, former CTO of OpenAI:
"Every model today is turn-based. You speak, it answers, then it goes away to think, and while it thinks it can't see or hear a thing
The next generation never stops listening. Audio, text and video stream in nonstop, and they reply in 20-millisecond chunks"
In only 2 minutes, she explains why typing into a chatbot is about to feel as old as a fax machine
Typing → Chatbot → Agents → Graphs → AI That Works Beside You Live
A turn-based model waits until you stop typing, then goes silent until it's done thinking
An interaction model watches and listens to what you do, and can jump in the second you head the wrong way
Anyone can write a prompt, almost no one is ready for an AI that is always paying attention
Worth more than most $2,000 AI courses
Bookmark it and watch it before everyone catches up
Then read how graph engineering runs 20 agents overnight in the article below ↓
Companies pay $300K+ a year for engineers who can run AI agents without babysitting them
Last week 20 Claude Code agents shipped 143 changes while I slept. I approved 6 merges
Here is graph engineering in Claude Code, file by file. Free ↓
1
25
803
Companies pay $300K+ a year for engineers who can run AI agents without babysitting them
Last week 20 Claude Code agents shipped 143 changes while I slept. I approved 6 merges
Here is graph engineering in Claude Code, file by file. Free ↓
This is f*cking insane. Anthropic hired this engineer at $400K-$1M a year
Because he knows how to build harnesses that don't break
99% of people still duct-tape agents together and blame the model when they fall apart
In this short workshop, he shows exactly how to build one from scratch
Prompts → Agents → Harness → Loops → Graphs
step 1 → the harness runs the loop, the context and the sandbox - you stop babysitting the agent
step 2 → brain and hands split apart - 60% faster to the first token
step 3 → it runs server-side - a crash just resumes from the log
step 4 → a failure costs nothing - it retries and replays instead of starting over
step 5 → last night's logs turn into new skills - it wakes up smarter every morning
Anthropic calls this "dreaming"
Most engineers spend weeks hand-rolling this
You can copy it tonight
Save it and watch it before your next long run
Then read how to build agents that never make the same mistake twice in the article below ↓
1
30
950
This is f*cking insane. An Anthropic engineer on the Claude Code team:
"If you're sitting there watching Claude write code, you've become the QA tester. That's not what you're paid to do"
In 37 minutes, he explains how to take your keyboard out of the hot path completely
The key shift is /loop. You tell Claude to wake up every 10 minutes and keep an eye on your PRs, and it does exactly that while you're nowhere near your laptop
Routines do the same thing in the cloud, so the work keeps going even with your machine shut
He finishes with remote control: any session, on any device, run from your phone
Watch it today, then save the full /loop setup guide below
1
31
783
CLAUDE SAID "FIXED". THE F*CKING TESTS SAID NO
Every AI fix looks done until the bug comes back next week
So I stopped trusting "fixed" and built a squad that has to prove it
The bug: checkout charged customers twice when the payment retried
Opus 5.5 plans, Haiku 5.5 scouts, Sonnet 5.5 builds, Fable 5.1 judges, and a Stop hook decides when the bug is actually dead
You drop 3 files into .claude/agents/ and launch:
claude --model opus
here's how it went:
→ Opus 5.5 planned it: repro test first, then root cause, then the fix
→ Haiku 5.5 scouts mapped 188 files and found 2 charge paths with no idempotency key
→ Sonnet 5.5 wrote the fix and said "fixed"
→ the Stop hook ran the tests: 31/32, a retry still made 2 charges. Exit 2, not done
→ Fable 5.1 found the root cause: the key used Date.now(), so every retry got a new key
→ Sonnet patched it to the order id, tests went 32/32, Fable signed off
Without the hook, that "fixed" would have gone to prod
The rules that made it work:
→ no fix without a failing repro test first
→ same test fails twice? Fable is called in: root cause, or are we just patching the symptom?
→ Claude can say "fixed", only exit 0 makes it true
Opus plans · Haiku scouts · Sonnet builds · Fable judges
the full tree
> .claude/agents/scout.md → model: haiku · tools: Read, Grep, Glob
> .claude/agents/builder.md → model: sonnet · writes the repro test, then the fix
> .claude/agents/judge.md → model: claude-fable-5-1 · read-only root-cause reviewer
> .claude/settings.json → Stop hook → scripts/verify.sh (exit 2 = not fixed)
> Opus 5.5 main session only sees summaries, never raw transcripts
paste this prompt into Claude Code ↓
"Set up a bug-fix squad in this repo:
1. Create .claude/agents/scout.md (model: haiku, tools: Read, Grep, Glob) to find every code path involved in a bug
2. Create .claude/agents/builder.md (model: sonnet) that writes a failing repro test FIRST, then the fix, then runs the tests
3. Create .claude/agents/judge.md (model: claude-fable-5-1, read-only tools) for root-cause review: fixing the cause or the symptom?
4. Write scripts/verify.sh (tests + lint, print the reason and exit 2 on failure) and register it as a Stop hook in .claude/settings.json
5. Add to CLAUDE.md: no fix without a red test first, scanning goes to scout, edits go to builder, call judge after the same failure twice and before saying fixed
Show every change as a diff first. No edits until I say go"
↳ code.claude.com/docs/en/hook…
bookmark it, this is the one you`ll actually use
7
66
2,140
YOUR OPUS 5.5 IS DOING F*CKING INTERN WORK
Almost nobody runs Claude Code like this, and every piece of it is already in the docs
The idea: Opus 5.5 never touches the grunt work. Haiku 5.5 scouts, Sonnet 5.5 builds, Fable 5.1 judges, and a Stop hook decides when the job is actually done
Your main session stays lean while a whole squad works under it: every subagent burns its own context window, Opus only reads the summaries
You drop 3 files into .claude/agents/ and launch:
claude --model opus
here's who does what:
→ Opus 5.5 is the planner: breaks the task down, hands it out, reads one-paragraph reports instead of 40 raw files
→ Haiku 5.5 is the scout: read-only, Read/Grep/Glob only, maps the repo fast and cheap so Opus never has to
→ Sonnet 5.5 is the builder: writes the code in its own context, runs the tests, sends a diff back
→ Fable 5.1 is the judge: cold review of every diff, hunts the bug everyone else was too close to see
→ scripts/verify.sh is the law: Claude can say "done", only exit 0 makes it true
Fable gets pulled in at exactly three moments:
→ before the plan locks: what breaks if this assumption is wrong?
→ when the same test fails twice: root cause, or are we patching the symptom again?
→ before "done": cold review of the final diff, zero context, zero mercy
Opus plans · Haiku scouts · Sonnet builds · Fable judges
the full tree
> .claude/agents/scout.md → model: haiku · tools: Read, Grep, Glob
> .claude/agents/builder.md → model: sonnet · full edit access
> .claude/agents/judge.md → model: claude-fable-5-1 · read-only reviewer
> .claude/settings.json → Stop hook → scripts/verify.sh (exit 2 = not done)
> Opus 5.5 main session only sees summaries, never raw transcripts
paste this prompt into Claude Code ↓
"Set up a model squad in this repo:
1. Create .claude/agents/scout.md (model: haiku, tools: Read, Grep, Glob) for read-only repo mapping
2. Create .claude/agents/builder.md (model: sonnet) for implementation and running tests
3. Create .claude/agents/judge.md (model: claude-fable-5-1, read-only tools) for adversarial diff review
4. Write scripts/verify.sh (tests + lint, print the reason and exit 2 on failure) and register it as a Stop hook in .claude/settings.json
5. Add to CLAUDE.md: scanning goes to scout, edits go to builder, call judge before locking a plan, after the same failure twice, and before saying done
Show every change as a diff first. No edits until I say go"
↳ code.claude.com/docs/en/sub-…
bookmark this, your Opus context will thank you
STOP F*CKING UPGRADING MODELS
Someone cut open 11 coding agents and found the same 7 organs in every one. Yours probably has 3
Dario Amodei just filed $ANT with $16.3B in revenue in 6 months, and the paper everyone in AI is quietly reading right now says the money isn't in the model
Wavestone AI Lab read the source of Claude Code, Codex CLI, Gemini CLI, OpenHands, Aider, Mistral Vibe, OpenCode, Hermes, Pi, OpenClaw and Mini-SWE-Agent. ~4M lines of Python, TypeScript and Rust
agent = model + harness. the model is one call in the middle of a loop, everything around it is the harness
so I pointed Claude Code at my own repo:
claude --model opus
score: 0/7. 3 minimal, 4 missing. it fixed them one by one
here's each organ and what I added:
→ agent loop: from manual chats to BACKLOG.md + /loop, one task per run
→ llm routing: from Opus on everything to a model per subagent
→ tools: from every tool with no limits to an allow-list per agent in settings.json
→ memory: from a 412-line CLAUDE.md to short rules in CLAUDE.md + state in NOTES.md
→ safety: from nothing to a PreToolUse guard that says no (exit 2)
→ orchestration: from one agent to scout · builder · judge in .claude/agents/
→ extensibility: from nothing to .claude/skills/ + 1 MCP server
what the paper found inside all 11:
→ 0/11 import LangChain, LangGraph or AutoGen
→ 0/11 search code with vector embeddings. it's ripgrep and tree-sitter
→ SKILL.md is in 9/11, MCP in 8/11. skills quietly won
→ Codex's hook events are nearly identical to Claude Code's: PreToolUse, PostToolUse, PermissionRequest. a de facto standard
the moment it paid off: Fable 5.1 caught the memory patch failing verify twice and said "stop, split the file: rules in CLAUDE.md, state in NOTES.md". and the new guard blocked git push --force main on its first test
same Opus 5.5, same 20 tasks:
0/7 harness → 7/20
7/7 harness → 19/20
the model is one call · the harness is 7 organs
the full tree
> CLAUDE.md → short hard rules, nothing else
> NOTES.md → state the agent updates between runs
> BACKLOG.md → one task per /loop run
> .claude/settings.json → permissions allow-list, PreToolUse guard, Stop verify
> scripts/guard.sh → blocks force-push, .env writes, rm -rf (exit 2)
> .claude/agents/ → scout (haiku, read-only) · builder (sonnet) · judge (claude-fable-5-1, read-only)
> .claude/skills/ → one skill per repeatable job
paste this prompt into Claude Code ↓
"Audit this repo's harness against the 7 subsystems of a coding agent: agent loop, LLM routing, tools, memory & context, safety & permissions, orchestration, extensibility.
1. For each one show what exists now (CLAUDE.md, .claude/settings.json, hooks, .claude/agents/, .claude/skills/, MCP config) and rate it missing / minimal / solid
2. Fix the weakest first, one organ per step: smallest change that makes it solid
3. After every step run scripts/verify.sh (create it if missing: tests + lint, exit 2 on failure) and don't move on until it passes
4. Call the judge subagent before locking the plan, after the same failure twice, and before the final diff
Show every change as a diff first. No edits until I say go"
↳ code.claude.com/docs/en/hook…
bookmark it, this is the one you`ll actually use
Harness engineering is the $300k skill nobody is teaching you.
214 hooks fired last night. 3 of them stopped a disaster. That's the $200 you're not losing.
Same Opus 5.5, same backlog:
no harness → 3/9 tasks done, one force-push to main, a $200 bill of retries.
harness → 9/9 merged overnight, 0 clicks from me.
The model is the engine. The harness is the car.
The harness is everything around the model that it can't skip: rules it must follow, guards it can't get past, checks it can't fake.
Here's mine, all native Claude Code ↓
→ CLAUDE.md: 14 hard rules. How to test, what never to touch, when to stop and ask.
→ PreToolUse hook: the guard. Blocks force-push, .env writes and rm -rf before they run (exit 2 = denied).
→ PostToolUse hook: fmt, lint and typecheck after every single edit. The model sees errors instantly, not at the end.
→ Stop hook: verify.sh. No green tests, no "done".
→ Subagents: Haiku 5.5 scouts, Sonnet 5.5 builds in worktrees, Opus 5.5 only reads summaries.
→ Fable 5.1 as the judge: wakes up on 3 triggers only. Before the plan, after the same failure twice, before merge.
What it caught last night while I slept:
→ git push --force main: blocked.
→ write .env.production: blocked.
→ rm -rf migrations/: blocked.
→ Same test failing twice. Fable: "Stop patching, the root cause is a missing idempotency key."
7am:
→ 9 PRs merged.
→ 214 hooks fired.
→ 3 bad calls blocked.
→ 0 human clicks.
Every one of those 3 blocks is a prod incident you'd pay for. That's what a harness is worth.
The full tree:
> CLAUDE.md → 14 rules, short and absolute.
> .claude/settings.json → PreToolUse guard, PostToolUse lint, Stop verify.
> scripts/guard.sh → denylist for Bash and Write (exit 2 blocks the call).
> scripts/verify.sh → tests and lint (exit 2 = not done).
> .claude/agents/scout.md → model: haiku, tools: Read, Grep, Glob.
> .claude/agents/builder.md → model: sonnet, one task per worktree.
> .claude/agents/judge.md → model: claude-fable-5-1, read-only.
Paste this prompt into Claude Code ↓
"Build a harness for this repo:
1. Write CLAUDE.md with short hard rules: how to run tests, files never to touch, never push to main, one task at a time, stop and ask when unsure.
2. Write scripts/guard.sh and register it as a PreToolUse hook for Bash and Write. Block force-push, writes to .env*, and rm -rf outside build dirs. Print the reason and exit 2.
3. Register a PostToolUse hook on Edit and Write that runs the formatter, linter and typecheck on the changed file and reports errors back.
4. Write scripts/verify.sh (full tests and lint, print the reason and exit 2 on failure) and register it as a Stop hook.
5. Create .claude/agents/scout.md (model: haiku, tools: Read, Grep, Glob), builder.md (model: sonnet, one task per git worktree) and judge.md (model: claude-fable-5-1, read-only). In CLAUDE.md, say when to call each one: judge before locking a plan, after the same failure twice, and before every merge.
Show every change as a diff first. No edits until I say go."
Then, before bed: /loop clear BACKLOG.md, one task per run.
↳ code.claude.com/docs/en/hook…
↳ code.claude.com/docs/en/sub-…
Bookmark this. The next model upgrade won't save you. The harness will.
7
39
1,444
YOUR OPUS 5.5 IS DOING F*CKING INTERN WORK
Almost nobody runs Claude Code like this, and every piece of it is already in the docs
The idea: Opus 5.5 never touches the grunt work. Haiku 5.5 scouts, Sonnet 5.5 builds, Fable 5.1 judges, and a Stop hook decides when the job is actually done
Your main session stays lean while a whole squad works under it: every subagent burns its own context window, Opus only reads the summaries
You drop 3 files into .claude/agents/ and launch:
claude --model opus
here's who does what:
→ Opus 5.5 is the planner: breaks the task down, hands it out, reads one-paragraph reports instead of 40 raw files
→ Haiku 5.5 is the scout: read-only, Read/Grep/Glob only, maps the repo fast and cheap so Opus never has to
→ Sonnet 5.5 is the builder: writes the code in its own context, runs the tests, sends a diff back
→ Fable 5.1 is the judge: cold review of every diff, hunts the bug everyone else was too close to see
→ scripts/verify.sh is the law: Claude can say "done", only exit 0 makes it true
Fable gets pulled in at exactly three moments:
→ before the plan locks: what breaks if this assumption is wrong?
→ when the same test fails twice: root cause, or are we patching the symptom again?
→ before "done": cold review of the final diff, zero context, zero mercy
Opus plans · Haiku scouts · Sonnet builds · Fable judges
the full tree
> .claude/agents/scout.md → model: haiku · tools: Read, Grep, Glob
> .claude/agents/builder.md → model: sonnet · full edit access
> .claude/agents/judge.md → model: claude-fable-5-1 · read-only reviewer
> .claude/settings.json → Stop hook → scripts/verify.sh (exit 2 = not done)
> Opus 5.5 main session only sees summaries, never raw transcripts
paste this prompt into Claude Code ↓
"Set up a model squad in this repo:
1. Create .claude/agents/scout.md (model: haiku, tools: Read, Grep, Glob) for read-only repo mapping
2. Create .claude/agents/builder.md (model: sonnet) for implementation and running tests
3. Create .claude/agents/judge.md (model: claude-fable-5-1, read-only tools) for adversarial diff review
4. Write scripts/verify.sh (tests + lint, print the reason and exit 2 on failure) and register it as a Stop hook in .claude/settings.json
5. Add to CLAUDE.md: scanning goes to scout, edits go to builder, call judge before locking a plan, after the same failure twice, and before saying done
Show every change as a diff first. No edits until I say go"
↳ code.claude.com/docs/en/sub-…
bookmark this, your Opus context will thank you
Boris Cherny, the guy who literally created Claude Code, called this his single most important tip: "give Claude a way to verify its work". his number for what that feedback loop does: 2-3x the quality of the final result
2-3x. not a new model. not a 4,000-word prompt. a shell script that runs after every edit
and most of you still let Claude write 400 lines blind, then find out what broke in CI 20 minutes and one context window later
The model writes. The harness writes back.
Your CLAUDE.md says "always run the type checker"
Claude reads it, runs it twice, and on edit #9 it just... doesn't
An instruction is a hope. A hook is a reflex
So catch the bug on the exact line that wrote it, not 3 tool calls later in a red pipeline
You just wire one PostToolUse hook:
.claude/settings.json → PostToolUse → check.sh
here's the split:
→ Edit lands: the file is on disk, and the model is sure it's fine
→ check.sh fires: tsc, eslint, vitest related, only on the file that just changed
→ exit 0 stays silent, exit 2 pipes stderr straight back into Claude's context
→ Claude reads the exact error, line number included, and fixes it in the same turn
what happened in this run:
→ "add rate limiting to /api/login, then ship it"
→ Edit(login.ts) → tsc TS2345 at :42 → exit 2 → caught
→ reads stderr → req.ip ?? "unknown" → 3/3 checks pass → kept
→ Edit(limiter.ts) → eslint no-floating-promises → exit 2 → caught again
→ redis.incr was never awaited → fixed → 3/3 pass → pushed
→ 4 edits · 2 caught in-turn · 0 reached CI · zero "can you fix the build" messages
a bug caught in the same turn costs 3 seconds
the same bug in CI costs 20 minutes and your focus
in prod it costs your whole f*cking weekend
Mitchell Hashimoto, the HashiCorp founder, named the whole discipline: "engineer the harness". every time the agent makes a mistake, you build something so it can never make that mistake again
one hook, three checks, one exit code. that's the smallest harness that actually talks back
the full tree
> PostToolUse runs after every Edit|Write, so no edit escapes the check
> check.sh scopes to the changed file, so the loop stays at seconds, not minutes
> exit 2 + stderr turns every error into the next instruction, not a dead end
> Claude fixes it while the context is still hot, not three tasks later
> the checks live outside the model, so "I forgot" stops being possible
paste this prompt into Claude Code ↓
"Add a feedback loop to this repo:
1. Write .claude/hooks/check.sh: read the PostToolUse JSON from stdin, take tool_input.file_path, skip anything that isn't .ts/.tsx
2. Run three checks on that file only: tsc --noEmit, eslint --max-warnings 0, vitest related --run
3. On any failure, print the check name, file:line and the raw error to stderr, then exit 2. Otherwise exit 0 and stay silent
4. Register it in .claude/settings.json under PostToolUse with matcher Edit|Write
5. Test it: introduce one type error and one floating promise in a scratch file, show me the hook catching both, then revert. Show every change as a diff first. No edits until I say go"
↳ code.claude.com/docs/en/hook…
bookmark this, stop finding Claude's bugs in CI when one exit code catches them on the line that wrote them
holy sh*t. Official Anthropic tip for Claude Code: stop letting Opus 5.5 grade its own "done", while a 10-line Stop hook decides
put a judge on every "done" with a Stop hook
claude # Stop → scripts/verify.sh · ledger → failures.yaml
Opus 5.5 builds the feature and proposes "done" when it thinks the work is finished
scripts/verify.sh runs the real checks every single time Claude tries to stop
failures.yaml remembers every mistake Claude ever made, and the ratchet clicks one notch tighter at three critical moments:
→ when "done" has no proof: the tests pass, but is staging still running the old schema?
→ when the same failure comes back: which of the 8 failure classes is it, and which rung of the ladder can hold it?
→ before a guard counts: replay the original failure. if the guard doesn't fire, it's a hope with a filename
A prompt asks. A check notices. A gate refuses
6 steps. 8 failure classes. 1 ledger. 1 exit code
CI runs the identical pattern one layer down: a red pipeline blocks the merge no matter how confident the PR description sounds. the Stop hook moves that same gate inside the session, before Claude ever gets to say "done"
The model proposes "done". Only the script grants it.
- the full ratchet setup
> CAPTURE: the failed run leaves evidence, not a vibe
> CLASSIFY: name it. BLIND, FLOODED, CLUMSY, AMNESIAC, OVERCONFIDENT, STUCK, RECKLESS or DRIFTING
> LOCATE: push the fix down the half-life ladder. a prompt line lasts days, a gate lasts until deleted
> ENCODE: write the guard as a check or a hook, not one more "IMPORTANT:" line
> PROVE: replay the original failure and watch the guard fire
> LOG: one entry in failures.yaml, so the next session inherits the lesson
paste this prompt into Claude Code below:
"Set up a failure ratchet in this repo:
1. Create scripts/verify.sh, the one command that decides "done":
> Read the hook input from stdin. If stop_hook_active is true, exit 0 so it never loops forever
> Run the test suite plus the project-specific checks (schema version, build, lint)
> On failure, print what failed and how to fix it to stderr, then exit 2
2. Register it as a Stop hook in .claude/settings.json:
> "Stop": [{ "hooks": [{ "type": "command", "command": "bash scripts/verify.sh" }] }]
3. Create failures.yaml as the ledger:
> One entry per failure: id, symptom, class (one of the 8), rung, guard, proof, recurrences
> Seed it with the last 3 failures you can find in git log or my notes
4. For each seeded failure:
> Pick the lowest rung that can hold it: a check or a gate beats a prompt line or CLAUDE.md
> Write the guard, then replay the original failure and show me the guard firing
5. Add one line to CLAUDE.md: "done" is decided by scripts/verify.sh, not by you
Show every configuration diff first. Do not apply edits until confirmed"
↳ code.claude.com/docs/en/hook…
bookmark this, stop adding "IMPORTANT:" lines to your prompt when one Stop hook decides "done"
10
28
853
Dario Amodei, CEO of Anthropic, said it straight while explaining how Claude Code came out: "you need an interface, you need a harness to use them"
OpenAI hit the same wall building an agent-first codebase with Codex: "the environment was underspecified"
Most Claude Code setups still skip the one part of the harness that actually enforces anything
The model recommends. The harness authorizes.
Your CLAUDE.md says "never force push"
Claude reads it, follows it usually, and one long session later it doesn't
A rule in prose is a suggestion. A rule in a hook is a law
So encode every rule twice: guidance the model understands, a check it can't talk its way past
You just wire one PreToolUse hook:
.claude/settings.json → PreToolUse → guard.sh
here's the split:
→ CLAUDE.md explains the why: loaded at session start, followed usually, enforced never
→ guard.sh enforces the how: runs before every Bash call, outside the model
→ exit 0 runs the command, exit 2 blocks it before it ever touches git
→ stderr goes straight back to Claude, so it reads why and reroutes on its own
what happened in this run:
→ "ship the hotfix, main is behind"
→ Claude tries git push --force → law 01 match → exit 2 → blocked
→ reads stderr → git pull --rebase && git push → 3/3 laws pass → pushed
→ tries git commit --no-verify → law 03 match → blocked again
→ 3 tool calls · 2 blocked · 1 passed · main safe · zero human clicks
the harness remembers, so the model doesn't have to
next incident → law 04 in guard.sh, not a new adjective in CLAUDE.md
Anthropic's own harness rule: "find the simplest solution possible, and only increase complexity when needed"
one hook, three laws, one exit code. that's the smallest harness that closes the loop
the full tree
> CLAUDE.md holds the why, so Claude reroutes instead of retrying the same command
> guard.sh holds the law, so one bad turn can't touch main
> exit 2 + stderr turns every block into a reroute, not a dead end
> safe path needs no human, the hook decides before git ever sees it
> permissions live outside the model
paste this prompt into Claude Code ↓
"Add a harness layer to this repo:
1. Write .claude/hooks/guard.sh: read the PreToolUse JSON from stdin and check tool_input.command against three laws: force push (--force, -f, or a +refspec like origin +main; allow --force-with-lease), rm -rf on / or ~, --no-verify
2. On a match, print which law fired and the safe alternative to stderr, then exit 2. Otherwise exit 0
3. Register it in .claude/settings.json under PreToolUse with matcher Bash
4. Add the same three rules to CLAUDE.md with one line on why each exists
5. Test it by piping sample JSON into guard.sh for each law plus one safe command. Show every change as a diff first. No edits until I say go"
↳ code.claude.com/docs/en/hook…
bookmark this, stop adding adjectives to CLAUDE.md when one exit code does the job




