{"id":"2076705482904101136","url":"https://x.com/Av1dlive/status/2076705482904101136","text":"","author":{"name":"Avid","username":"Av1dlive","avatarUrl":"https://pbs.twimg.com/profile_images/2010392290590912512/x7vtAe5W_200x200.jpg"},"createdAt":"Mon Jul 13 16:29:05 +0000 2026","engagement":{"replies":40,"retweets":36,"likes":253,"views":422647},"article":{"title":"AI Agent Stack everyone must use with GPT 5.6 + Fable 5 (Builder's Guide)","previewText":"Fable 5 + GPT-5.6: The A - Z Build of an Agent Stack That Ships While You Sleep\n\nThis is the complete build, in order, with a checkpoint after every piece.\nBookmark these 12 builds before you forget.","coverImageUrl":"https://pbs.twimg.com/media/HNHtyw7aoAAaCcj.jpg","content":"Fable 5 + GPT-5.6: The A - Z Build of an Agent Stack That Ships While You Sleep\n\nThis is the complete build, in order, with a checkpoint after every piece.\n\nBookmark these 12 builds before you forget.\n\n# Introduction\n\nYou have the two most capable models ever made generally available, and you are still using one of them at a time, by hand.\n\nThree things changed in the last month.\n\n- Claude Fable 5 plans across stages, dispatches its own subagents, and verifies its own output. $10 per million tokens in, $50 out.\n\n- GPT-5.6 shipped July 9 as three permanent tiers. Sol at $5 and $30, Terra at half of Sol, Luna at $1 and $6. OpenAI now sells the routing decision as the product.\n\n- Fable 5 spent 19 days of June suspended under an export order. Availability is now a thing that happens to you.\n\nRun casually, these models are an expensive way to generate impressive wrong things.\n\nRun inside a system, they are the closest thing to an employee you can rent. Anthropic's enterprise numbers put Claude Code at about $13 per developer per active day. OpenAI puts Codex at $100 to $200 a month.\n\nThis guide builds that system in twelve builds: the actual files, in order, each tested before publishing, with a checkpoint after each so you know a piece works before you stack the next one on it.\n\nIt is for anyone with a repo, a terminal, and access to either CLI. The examples are code-flavored because loops grew up around code, but the router, the advisor, and the gate work on invoices and reports the same way.\n\nRead it in order, doing the checks. Each build takes 10 to 20 minutes, about two hours in total. The 30 days at the end are the schedule during which the system earns the right to run without you.\n\nThree principles predict every design decision below:\n\n1. Route at boundaries. Effort before model. A mid-session model swap burns a cache discount worth 90 percent. Raising thinking effort on the same model costs nothing extra in plumbing.\n\n1. Nothing grades its own homework. Writer, router, advisor, and reviewer are different parties, from different lineages where possible, and the final vote is a bash script.\n\n1. Done is a fact about the environment. A passing suite, a ticked task file, a verdict line. Never the model's opinion of itself.\n\n# The map, and why the usual one is wrong\n\nLoop engineering is agentic workflow with an explicit stopping condition and retry logic. The harness decides when work is finished, instead of leaving \"am I done\" to the model.\n\nThe standard picture is swyx's Loopcraft stack: five loops nested inside each other, execution inside task inside product inside system inside oversight, each with its own exit. It is the best one anybody has drawn.\n\nI used it for weeks. Then I tried to build against it, and it broke in four places.\n\n1) Problem one: the loops do not nest.\n\nNesting means one turn of the outer loop equals one complete run of the inner loop. That is not what happens. The system loop does not wait for the product loop to finish. It runs on Sunday whether or not anything shipped.\n\nYou can interrupt a token stream by hand without unwinding four layers. It is a picture of containment drawn over a system that does handoffs.\n\n2) Problem two: a loop drawn as endless is a bill.\n\nThe original draws the product loop that way. In practice it ends on a budget, on a checkpoint, or on somebody losing patience.\n\nCalling that \"none by design\" hides the exact place where money leaks out of an agent system: a loop that nobody told how to quit.\n\n3) Problem three: there is no abort.\n\nEvery layer has a happy ending and no unhappy one. Real loops need both: how it closes when it works, and how it stops when it cannot.\n\nEvery runaway bill I have seen was a loop with a defined exit and an undefined abort.\n\n4) Problem four: verification is missing, and it is the whole game.\n\nVerification is the contract between layers. When a lower loop hands an upper loop a report instead of a fact, the upper loop closes on a lie.\n\nThat single gap is why a loop can hit its stopping condition and still be wrong.\n\nThis is the version I build against.\n\n# The Evidence Ladder\n\nSix rungs, two exits each, and one rule: control flows down as goals, evidence flows up as facts, and no rung may close on a report from the rung below it.\n\n![](https://pbs.twimg.com/media/HNG48SwaEAEp2b1.jpg)\n\nFive laws fall out of the shape.\n\nEvery rung has an abort, or it is a bill. If you cannot name how a loop ends badly, you have built a subscription. This is why ralph.sh carries two caps and the swarm carries a cycle cap.\n\nEvidence flows up and control flows down. A rung closes on a fact produced below it, never on a summary written below it.\n\nThe factory gate is this law in SQL. Two reviewers said green. The gate still refused, because nobody had produced a passing test row.\n\nA verdict is an opinion. A row is evidence.\n\nCost per turn climbs about tenfold per rung.\n\nA bug that escapes rung 2 costs ten times more to catch at rung 3, and a hundred times more at rung 4.\n\nThat is the entire argument for putting your best verification as low on the ladder as it will go, which is why the gate is a bash script and not a meeting.\n\nTimescale belongs to the model, not to the rung.\n\nRung 2 took minutes in 2024, takes hours in 2026, and will take days soon. Design against the exit condition, never against the clock. This is where the old picture ages fastest.\n\nOnly rung 5 has no exit condition, and that is what human means.\n\nYou live there. The ladder exists to earn one sentence: a loop can hit its stopping condition and still be wrong.\n\nTests pass, the gate goes green, both reviewers sign, and the last commit is still a mistake. Every rung below you exists to make that check smaller. None of them can take it from you.\n\n# Prerequisites\n\n# What you are building\n\n# BUILD 0: Configure the Engines\n\nSet these before writing any file of your own. Every number below was verified against the official pricing pages the week of publication.\n\n## The bench: every seat, July 2026\n\nThe roster the system hires from.\n\nPrices live in one skill file, .claude/skills/model-bench/SKILL.md, loaded on demand before any routing or cost question. No other file hardcodes a number.\n\nPrices moved three times in the six weeks before this was written. A price in an article is wrong by publication. A price in a skill file is one edit.\n\n![](https://pbs.twimg.com/media/HNG6ff1bUAEgsne.jpg)\n\nThe split that decides everything downstream:\n\n- Fable 5 leads hard software work. 80 percent on SWE-Bench Pro against Sol's 64.6, and it edges Sol on overall intelligence.\n\n- Sol leads terminal and agent work. 88.8 percent on Terminal-Bench 2.1, and it tops the coding-agent index at roughly a third of Fable's cost per task.\n\nThat split is why this system is bi-vendor. Fable judges and plans, Sol reviews and drives terminals, and neither one does the bulk typing.\n\n![](https://pbs.twimg.com/media/HNG5FQdagAAkD9n.jpg)\n\nTwo seats people misread.\n\nOpus 4.8 is not the old flagship gathering dust. It is the automatic fallback under Fable and the recommended default for complex agentic coding. Your system inherits it whether you plan for it or not.\n\nSonnet 5 at introductory pricing is the best value on the board. Close to Opus 4.8 in capability at a fraction of Fable's input price, which is why it is the default executor everywhere in this build. That rate expires August 31, and the skill file already knows it.\n\nThat skill file is the only file in the system that contains a number:\n\nSeven facts that change how you build:\n\n1. Cached input is 90 percent off at both labs. One timestamp in your system prompt burns it on every call. Stable prefix, append-only history, always. Agents read roughly 100 tokens for every 1 they write, so this discount is most of your bill.\n\n1. Cache writes cost extra but pay back fast. Anthropic's 5-minute write bills 1.25x and breaks even after a single read. GPT-5.6 is OpenAI's first family with explicit cache breakpoints and priced writes. Architect around the cache the way a systems programmer architects around a memory hierarchy.\n\n1. The newest Anthropic tokenizer makes roughly 30 percent more tokens for the same text. Effective price sits above sticker. Budget on effective.\n\n1. A safety refusal from Fable 5 is not an error. The call succeeds and the work lands on Opus 4.8, by design, in under 5 percent of sessions. Read what happened, not the exit code alone, and configure the fallback chain before you need it.\n\n1. Do not default to the middle tier. Independent testing found some Luna or Sol setting always beat Terra on the cost-quality frontier. Test Terra against Luna on your own traffic before paying for it.\n\n1. Batch APIs halve anything that can wait overnight, and the discount stacks with caching: repeated prefixes in batched work run near 95 percent off. The overnight burner in BUILD 7 exists to exploit it.\n\n1. Availability is an operational risk, not a hypothetical. Fable 5 lost 19 days in June. Every model reference here has a fallback: fable-5 falls to opus, sol falls to terra, and every fallback gets logged.\n\n## The second meter: a seat is not an API key\n\nEvery number above is priced in dollars per million tokens. That is the right currency if you pay per call.\n\nIt is the wrong one if you run this on a $200 Codex Pro seat or a Claude Max seat.\n\nOn a seat the meter is a five-hour window and a weekly window, evaluated together, and one request counts against both.\n\nYou can be flush on the week and still locked out for four hours, because a single message ate the short one.\n\nSame doctrine. Different currency. Three settings decide how much of a window one message can take:\n\n![](https://pbs.twimg.com/media/HNG6jtvaUAAr4G-.jpg)\n\nFast mode is the expensive one, because it multiplies a number that just got bigger.\n\nGPT-5.6 runs far longer per message than 5.5 did. Mostly a gift. It also makes burn unpredictable.\n\n- Theo reports burning over $200,000 of tokens on Sol\n\n- He has watched one 5.6 message take 15 percent of a five-hour window\n\n- At the multiplier, that is 40 percent of the window in a single message\n\nSpeed is not free. What it charges you for is the tokens you were going to burn anyway. Re-read the multiplier on the speed docs before you trust it: it is published per model, and it moves.\n\nUltra is the subtler trap, because the interface files it where the effort levels live and it is not one of them.\n\n- Max is depth. One model, one problem, more time on a single chain of reasoning.\n\n- Ultra is width. The work fans out to four agents, then gets synthesized.\n\n- Different axes. Ultra is not \"more than max.\"\n\nPointed at a task that does not truly split, ultra buys four agents duplicating one investigation.\n\nIt is worth roughly 3.1 points on Terminal-Bench 2.1, 88.8 to 91.9, for a fleet's worth of burn. Off until the boundaries between the sub-problems are real.\n\n## Why Sol and Terra are both correct defaults\n\nA field report runs Sol for nearly everything. The bench above makes Terra the Codex daily driver. Both are right, and the meter is the reason.\n\n- The rate card says Sol's output costs twice Terra's\n\n- The seat says you already paid\n\n- So the only live question is how many turns it takes to reach green\n\n- A stronger model at a lower effort usually needs fewer\n\nRate is not cost. Cost is rate times turns-to-green, and the second term is the one that moves.\n\nWhich is BUILD 4's law arriving from the other direction: upgrade the seat before you touch the dial. On a seat that reads as Sol at high on the $200 tier, Sol at low below it. Measure before you believe either.\n\nSet the Codex tiers now:\n\nCHECK 0: both CLIs authenticate, and your test command exits 0 on the current repo.\n\n# BUILD 1: The Constitutions\n\nThese models follow laws and optimize around tips, so every line needs a number, a never, or a command that checks it.\n\nCreate CLAUDE.md:\n\nCreate AGENTS.md at the repo root, the same laws in Codex's dialect. Keep it near 100 lines, a table of contents, not an encyclopedia:\n\nOne doctrine must live on both sides, or whichever harness has the laxer habits wins every time you switch tools.\n\nCHECK 1: for every line, ask whether the model could comply 80 percent and claim success. If yes, rewrite it with a number or a never. wc -l CLAUDE.md under 60.\n\n# BUILD 2: The Gate\n\nA bash script must hold the final vote before anything else exists, because every later build assumes it.\n\nCreate gate/verify.sh for your stack:\n\nCreate gate/eval_gate.py, the seatbelt for every future routing or prompt change. It runs 50 to 500 held-out cases through the current config and the proposed one, with deterministic checks only:\n\nThen make the gate unskippable as a skill, .claude/skills/ship-gate/SKILL.md:\n\nThe gate uses deterministic checks only, because it must never inherit the who-verifies-the-verifier problem. A routing change without an eval gate is a cost experiment you are running on your customers.\n\nCHECK 2: ./gate/verify.sh exits 0 today, and eval_gate.py prints SHIP on its demo. If verify.sh fails now, fix it before anything else. The system stands on this script.\n\n# BUILD 3: The Heartbeat\n\nThe model brings intelligence. The loop brings discipline.\n\n- Fresh context per iteration kills context rot\n\n- The repo carries all memory\n\n- Two caps turn a runaway agent into a ten dollar lesson\n\nThis is the exact shape behind Anthropic's 16-loop run that built a 100,000-line C compiler for about $20,000, with no orchestrator model anywhere.\n\nCreate loop/PROMPT.md:\n\nCreate loop/ralph.sh:\n\nSwap the claude line for codex exec and the identical loop drives GPT-5.6.\n\nThe exit map is deliberate: 0 done or quiet, 2 circuit breaker, 3 budget. Every alarm in BUILD 12 keys off these.\n\nThe cost line reads the session's own JSON cost report, so the cap is enforced by the harness against real spend, not an estimate.\n\nCount the stops in that prompt. Every branch ends in one, and that is the design, not a tic.\n\nThis generation runs much longer per message than the last one did. Mostly a gift. Occasionally a bill, because a model that no longer needs encouragement to continue will carry a task four steps past the point where you wanted to look at it.\n\nThe loop solves that structurally: one task per tick, hard stop at the end.\n\nInteractively you have to say it out loud. Two prompts do the work:\n\n- \"write the plan, then stop and show me before you build any of it\"\n\n- once the plan is good: \"build it, test it, open the PR, handle the first round of review comments, then stop\"\n\nA model that runs long is only dangerous when nobody told it where the edge was.\n\nLong tasks fail the way context fails, so iterations stay short and the environment does the remembering. Fable 5 and the Codex models now compact their own context mid-run, so resist adding clever memory plumbing; the right amount shrinks every quarter.\n\nCHECK 3: two tiny real tasks in TASKS.md, one hand-run tick at BUDGET_USD=2. Confirm one commit, one ticked task, one log line, and that the loop exits instead of starting a second task.\n\n# BUILD 4: The Router That Earns Its Job (model, then effort)\n\nThe most rigorous routing benchmark of 2026, LLMRouterBench, found many routers, including commercial ones, fail to reliably beat picking the best single model. So the router is guilty until proven innocent on your own traffic.\n\nThe decision rule, before any code. Add a router only when both of these are true:\n\n- The cheap and frontier tiers show roughly a five-fold capability-per-dollar gap on your traffic\n\n- The eval set from BUILD 2 exists to police it\n\nIf one well-chosen model beats your router on those evals, delete the router and bank the simplicity.\n\nOnce it clears the bar, router/router.py runs three layers, cheapest decision first. Note that the tiers name seats, never prices: the rates come from the bench skill at runtime, so a price change never touches your router.\n\nThe middle layer scores difficulty on markers you can read: why, debug, race, deadlock, refactor, security, plus code in the prompt, a prior failed attempt, and more than one subsystem touched.\n\nZero or one point goes cheap. Two goes mid. Three or more goes frontier. The cascade's verifier is deterministic and escalates exactly once.\n\nWire the same decisions into the harness so they fire without being invoked, .claude/skills/model-router/SKILL.md. Note that the skill does not restate the rules, it reads them, the same single-source-of-truth trick the bench uses for prices:\n\nThe decision order mirrors cost: a free check first, a scored guess second, a paid experiment last.\n\nThe money is the traffic split, not the cleverness.\n\n- Send 70 percent of work to a tier a tenth the price and the bill drops about two thirds\n\n- Production reports cluster between 40 and 85 percent saved, and the spread is almost entirely the split\n\n- Savings compound only after most traffic goes cheap\n\nWhich is why the cheap share in progress.log is the one number this system makes you watch.\n\n## Effort is the second dial\n\nEffort is routing one level down: the same skill, applied to how long the model thinks instead of which model runs.\n\nEvery tool buries the dial on a different default. High in Claude Code. Medium in Codex. Hidden in most apps. So people leave one setting on for everything, and either overpay or underthink.\n\n![](https://pbs.twimg.com/media/HNG6pRfbkAAL8ZQ.jpg)\n\nDefault to high and treat max as a last resort, not a flex.\n\n- Anthropic's own effort docs put the sweet spot at high, and warn that max tips into overthinking\n\n- One public benchmark of 26 coding tasks found high roughly tripled the quality of low\n\n- The same benchmark found xhigh cost more than twice as much for a gain that rarely earned itself back\n\nThe model matters at least as much as the dial. Fable 5 on lower effort often beats older models running at xhigh, so reach for the better model before the higher setting.\n\nTwo settings get mistaken for higher rungs of this ladder. Neither is on it.\n\n- Max is depth. One model, one problem, more time.\n\n- Ultra is width. One task fanned out to four parallel agents, then synthesized.\n\nDifferent axes. Ultra is not \"more than max,\" and pointing it at a task that does not truly split buys four agents duplicating one investigation.\n\nThe ladder does not port across versions. The same word buys a different amount of thinking on a new model than it did on the old one.\n\nMoving a familiar task to a new seat, start one rung below the setting you trust. Climb only if the output asks.\n\nOne trap belongs to swarms specifically.\n\nSubagents inherit the parent's model and the parent's effort. A fleet spawned from a max-effort conductor is a max-effort fleet, and it drains a window in a single message.\n\nPin them down in their own frontmatter, and know which harness you are in when you do, because the pin is only as good as the spawner that reads it.\n\n- Claude side. The frontmatter below is the control.\n\n- Codex side. 5.6 spawns children at the parent's own model and reasoning level, and it spawns eagerly. The parent's dial is the fleet's dial.\n\nOn the Codex side the only real controls are the setting you opened the session with, and a line in AGENTS.md that says do not spawn unless asked. Verify which one you have before trusting either:\n\nSet it per tool: /effort in Claude Code and the Codex TUI, a flag like codex -e high, a line in config, or the effort field on the API.\n\nModel routing decides who thinks. Effort routing decides how long, and the second dial is cheaper to turn because nothing else in the setup changes and the cache stays warm. Spend effort where the loop branches. Everywhere else it is a tax.\n\nTrack the one number weekly:\n\n## ROUTING.md, the policy both harnesses read\n\nEverything above condenses into one file at the repo root.\n\nCHECK 4: router.py runs offline and prints a decision, a reason, and the split. Your notes hold the 5x gap measurement, or a dated note saying the router is not yet justified.\n\n# BUILD 5: The Advisor Inversion\n\nThe classic pattern puts the smart model in charge and burns frontier tokens on bulk execution. Invert it.\n\nAnthropic's advisor results: Haiku with an Opus-class advisor more than doubled its score on a hard browsing benchmark, 41.2 against 19.7 alone, at 85 percent lower cost per task than the mid tier.\n\nExecution is bulk. Advice is grams.\n\nThe harness decides when the driver is stuck, never the driver, .claude/skills/stuck-protocol/SKILL.md:\n\nThe expert seat, .claude/agents/fable-expert.md:\n\nAnd the same lane in reverse for Codex sessions, ~/.codex/prompts/fable-advice.md:\n\nSmall models are overconfident, so the harness watches behavior instead of asking.\n\nThe brief stays tiny, because the expert's value is clean context and a long brief poisons it.\n\nEach consultation runs a few hundred tokens of guidance. That is why the economics collapse: execution millions ride the $1 tier, and judgment arrives by the gram at $50 per million.\n\nCognition published the failure first. The ceiling is set by the driver, not the advisor, and the pattern only paid off after their driver improved a generation.\n\nThe open problem is a driver noticing it is stuck. Which is why the signals above are behavioral, and why they live in the harness.\n\nCHECK 5: advisor_loop.py passes its assertions: the driver fails twice the same way, one consult fires, the task completes, consults stay under the cap.\n\n# BUILD 6: The Two-Lane Bench\n\nNothing grades its own homework is a law, and this build enforces it across vendors.\n\nSame weights in a foreign harness drop hard. One 2026 measurement showed 20.2 percent native versus 7.7 percent third-party.\n\nSo each reviewer runs in its own home. Claude reviews in Claude Code. Sol reviews through the Codex CLI.\n\nThe in-house judge, .claude/agents/fresh-eyes-reviewer.md:\n\nThe cross-vendor judge, .claude/agents/sol-reviewer.md, is plumbing that runs one command and relays the verdict verbatim. Sol is the reviewer; this file gets it into its own harness:\n\nFor CI, loop/two_lane.sh drives the whole exchange, three rounds max:\n\nInside Claude Code you can skip the script entirely.\n\nOpenAI ships an official Codex plugin for Claude Code, live since March 2026 and at roughly twenty thousand GitHub stars within nine weeks. That is the market telling you cross-vendor review went mainstream. Install once:\n\nThree moves inside any Claude session:\n\n- /codex:review for a standard pass\n\n- adversarial mode, which attacks your design decisions on purpose\n\n- background handoff to Codex\n\nUse adversarial on anything load-bearing. Use handoff when the work is terminal-heavy, where Sol is strongest.\n\nA growing number of builders now run GPT-5.6 Sol inside Claude Code, through the proxy from BUILD 7, and prefer it to Codex for daily work.\n\nIt demonstrates the thesis: rent the weights, own the harness.\n\nThe catch is the native-harness law, since Sol in Claude Code runs outside its home. Confirm it on your own eval set. If your evals say the foreign harness wins, your evals outrank the benchmark.\n\nThree properties make the reviewer worth having:\n\n- Clean context. It arrives with none of the writer's history.\n\n- Different lineage. It does not share the writer's blind spots.\n\n- Native harness. It judges at full strength.\n\nA softened verdict is a broken verifier, so the relay is verbatim. A third FAIL pages a human instead of taking a fourth swing.\n\nCHECK 6: run two_lane.sh, or /codex:review on your last commit. A VERDICT lands in a .review file, and a FAIL routes back to the writer lane.\n\n# BUILD 7: Optional Fan-Outs (install when the condition appears)\n\nScout swarm. Install when research or codebase archaeology eats more than 30 minutes of your day. Spawn three in parallel on separate slices:\n\nReads fan out because parallel readers compound. The word cap exists because every report lands in a context window the parent pays for.\n\nWrites never fan out. A 2026 equal-budget study found single agents match multi-agent setups on reasoning when tokens are held constant. This lane is for reading only.\n\nOvernight burner. Install when TASKS.md holds ten or more small verifiable items. The overnight-burner skill sets up the files, confirms both caps, verifies the test command runs, then launches ralph.sh. Morning interface: git log, progress.log, tick marks.\n\nPlan split. Install when planning tokens dominate a session's bill. One setting in Claude Code runs an Opus-class model for the plan and Sonnet for execution. Plan on the frontier by the gram, execute in bulk.\n\nTrio bench. Install when a gnarly change deserves three perspectives. Two roles read and one writes, and the fourth pane is a trap. The plumbing sits below.\n\n## The plumbing for mixed fleets\n\nTwo open-source pieces turn a two-vendor setup into an any-vendor one. Install them only when a condition calls for a third provider.\n\nclaude-model-switch (open source, Rust, runs on localhost:4000). A local proxy between Claude Code and any Anthropic- or OpenAI-compatible endpoint.\n\n- Remaps Claude Code's three internal tiers (haiku, sonnet, opus) to whatever models your provider offers\n\n- Switches providers without restarting, via config reload\n\n- Ships as a Claude Code plugin with slash commands\n\nThe trio preset is BUILD 7's bench made physical: three tmux panes, each role on a different provider, each addressable (orchestrate send coder \"implement milestone 1\"), with mid-session role reassignment if a provider degrades.\n\nCLIProxyAPI (open source). The same trick, pointed the other direction.\n\nIt wraps the OAuth logins of ChatGPT Codex, Claude Code, Gemini, and Grok as OpenAI-, Claude-, and Gemini-compatible API endpoints.\n\nTranslation: subscription seats you already pay for become routable API targets for scripts like ralph.sh and two_lane.sh, with no separate API keys. Community forks extend it to Factory and Amp, and wrappers like ccs add multi-account switching.\n\nThe law that governs both, from BUILD 6's data: a remapped model runs in a foreign harness.\n\nRemap the reader and reviewer lanes freely. They are cheap and verifiable.\n\nKeep the lane that writes code on a model native to its harness, until your own eval set proves otherwise.\n\nCHECK 7: every installed fan-out has its trigger condition written next to it. Installing any of this speculatively is how stacks bloat.\n\n# BUILD 8: The Factory (completion becomes a database fact)\n\nEverything so far proves work in the moment. The gate, the verdict, and the eval set all fire during the run.\n\nOnce more than one agent touches a project across more than one session, you need proof that survives the run: who worked what, in what order, and whether the last review cycle cleared.\n\n![](https://pbs.twimg.com/media/HNG6w5UbkAApg5G.jpg)\n\nThe pattern comes from the pi-factory demo (github.com/xpriment626/pi-factory). The load-bearing idea is one sentence\n\nA thread is a trace. A row is evidence. The gate reads rows.\n\nprogress.log is a diary. The blackboard is a ledger. SQLite is the ledger because it is queryable after everyone stops talking.\n\nCreate factory/factory_gate.py. It holds four tables (tickets, briefs, evidence, verdicts), a record command each agent calls as it works, and the completion gate. The gate's failure conditions map to the work itself:\n\nThat list encodes the whole doctrine.\n\n- Order is enforced. A brief that postdates the first code evidence is a violation, which makes plan-before-build a checkable fact instead of a habit.\n\n- Both judge seats must be green on the same latest cycle. One stale approval cannot carry a newer diff.\n\n- Completion with zero passing test rows is impossible, no matter how confident the transcript sounds.\n\nCreate factory/factory.sh, which wires the seats you already built into the run order and records rows between every step:\n\nNothing new gets hired.\n\nFable cuts tickets and writes the brief, read-only. The BUILD 3 loop implements. Claude and Sol each return a verdict from their own harness. The cycle repeats up to three times until both go green.\n\nThe factory is the org chart for employees you already have.\n\nA real run, not a mockup. The second gate call is the entire argument for this build:\n\nBoth reviewers said green. The architect confirmed the layout matched the brief. The reviewer confirmed the scope was clean.\n\nAnd the gate still refused, with one line: no passing test command evidence. Nobody had run the tests.\n\nA verdict is an opinion. Two opinions are still not a fact. One evidence test pass row later, the same gate returns COMPLETE and exits 0.\n\nModels argue for their work convincingly, and a transcript captures the argument rather than the truth. Rows cannot be argued with.\n\nWhen the gate refuses, it names the exact missing artifact. That turns \"the run failed\" into \"produce a passing test row.\" A task, not a mystery.\n\nInstall condition: more than one writer session per day, review cycles that span days, or a need to prove after the fact what happened. For a solo repo with one nightly loop, BUILD 3 is enough and this is bloat.\n\nCHECK 8: reproduce the screenshot. Record everything except a test row, and the gate must refuse with exactly one reason. Add the row and it returns COMPLETE. A gate that passes without it is a transcript reader.\n\n# BUILD 9: The Swarm (Fable plans, the fleet executes, Fable scores)\n\nOne driver with an advisor covers a task. A goal that splits into four independent pieces wants four workers.\n\nBut a fleet only holds its direction if one model plans every goal and scores every result. That is the whole reason this build exists, and the reason swarms usually fail without it.\n\nRung 3 made literal. Fable writes the goals, the fleet executes them, Fable scores each result against its own check, and the next cycle re-plans only the misses.\n\nIts abort is the cycle cap. When the cap trips with misses outstanding, that is a spec problem going to a human, not a reason to run a fourth cycle.\n\nCreate swarm/swarm.sh. Three settings carry the doctrine:\n\nThose three lines are explicit because the default is not.\n\nA fleet that inherits picks up the conductor's model and the conductor's effort both. A Fable-at-high conductor spawning four Fable-at-high workers to do mechanical work is the most expensive possible way to do the cheapest possible thing.\n\nSet them. Never let them default.\n\nCross-harness fan-out is legal, and it is not the exception to ROUTING.md's first law that it looks like.\n\n- A Fable conductor that shells out to codex exec runs Sol inside Codex, natively. That is the law obeyed, not bent.\n\n- What breaks the law is a Claude-side subagent wearing a GPT model string, or the reverse.\n\nThe harness travels with the worker, not with the conductor.\n\nThe conductor writes goals, never code, and each goal carries its own check command, so done stays a fact:\n\nThen dispatch, score, and replan:\n\nSeat by seat:\n\n- Sonnet 5 for coding execution\n\n- Haiku or Luna for pure mechanical work\n\n- An open-weight worker like Kimi when the job is repetitive and the weights are free\n\n- Sol when the work is terminal-heavy\n\n- Opus 4.8 in the worker seat, only when a subagent needs to reason\n\nReserve Fable for the two jobs no cheap model can do: writing the goals, and grading them.\n\nA fleet is a cost strategy, never an intelligence strategy.\n\nMulti-agent runs burn 3 to 10 times the tokens for equivalent work, and a 2026 equal-budget study found single agents match them on reasoning when tokens are held constant.\n\nA swarm earns its keep only when the goals are independent and mostly mechanical. Writes stay single-threaded per worktree, merges happen serially, and a human takes the last commit.\n\nCHECK 9: run the swarm on a goal that splits three ways. A broken goal must come back FAIL in results.tsv and get replanned in cycle 2, never declared done.\n\n# BUILD 10: Rung 4 (nothing that passed once goes unwatched)\n\nEverything so far verifies work while it is being made. Nothing so far notices when finished work stops being true six weeks later. A goal you verify once is an assumption with a timestamp.\n\nRung 4 has two halves, and its abort matters as much as its exit: if no proposal clears the gate this week, the system does not change, and that is a success.\n\nHalf one, standing goals. Every finished thing graduates into an invariant with a predicate, re-verified daily, forever. Create one file per finished thing in goals/:\n\nThen system/verify_goals.py runs the lot and exits 1 if any invariant broke, naming the goal, the date it last held, and the policy you set:\n\nPredicate rules are strict on purpose: a shell command, exit 0 means the invariant holds, cheap and read-only.\n\nAdjectives are banned. If a shell cannot check it, a model cannot either.\n\nNon-code goals work the same way. test -s reports/$(date +%Y-%m)-review.md is a fine standing goal for a monthly report.\n\nHalf two, compost. Once a week, read the exhaust the system already produced: BLOCKED tasks, failed gate runs, refused factory gates, reverted PRs, violated goals.\n\nThen propose at most three changes. A new law for the constitution. A fix to a skill that keeps failing the same way. Or a standing goal you were missing.\n\nPropose only. You sign.\n\nThis rung closes only when the evals and the judges say the system got better. Which means the system needs a memory of its own failures to improve against.\n\nThe compost run is what turns a script into an institution.\n\nThe standing goals are what make finishing safe. The sentinel detects, the normal pipeline fixes, and nothing rots in silence.\n\nCHECK 10: verify_goals.py demo names the broken invariant with its last-pass date and leaves the healthy one alone. Then write one real standing goal for the last thing you finished.\n\n# BUILD 11: Rung 5 (your seat, and why it never empties)\n\nRung 5 has your name on it for a mechanical reason, not a sentimental one.\n\nA loop can hit its stopping condition and still be wrong. Tests pass, the gate goes green, both reviewers sign, and the last commit is still a mistake.\n\nEvery build below this one exists to shrink that risk. None of them erases it.\n\nYour standing duties, all cheap:\n\n- Read the queue with coffee: BLOCKED tasks, GATE REFUSED lines, VIOLATED goals, the cheap-tier share. Ten minutes.\n\n- Check the last commit before it merges. Not every diff, the last one, the one the system was most confident about.\n\n- Sign or reject the three compost proposals. That is the only way laws enter the constitution.\n\nThree plays run on a cadence rather than on demand, because they cost real money and pay in direction rather than diffs:\n\nPlay one, the project feedback loop, monthly.\n\nPoint Fable at what you already shipped, read-only, and have it write a detailed improvement plan. Then hand execution of that plan to Opus 4.8 or Sol.\n\nThe expensive model does the part that compounds, judgment about what to change, and never the part that does not, typing.\n\nPlay two, the behavior analysis, monthly.\n\nFeed it your own session and project history across both harnesses, and ask it to map how you build and where you stall.\n\nThis is the only report in the system whose subject is you. It is usually the one that changes the most.\n\nPlay three, the second-brain audit, quarterly. Point it at your notes, docs, and backlog, and ask what your own thinking says is worth building next and what is worth deleting. Treat the output as a proposal, exactly like compost.\n\nThe rungs below optimize execution, and execution is the cheap part now. Direction is the scarce input, and direction is what a frontier model is worth paying for. Buy judgment by the gram, execution by the ton, and keep the last signature.\n\nCHECK 11: run play one on your own repo. If the plan names nothing you already knew was fragile, your context files are too thin, which is a BUILD 1 problem.\n\n# BUILD 12: Ops\n\nAgents burn 10 to 100 times the tokens of a chat call, and input dominates at roughly 100 to 1.\n\nStack the four levers from BUILD 0 (split, cache, batch, compaction) and teams report landing 70 to 90 percent below their unoptimized baseline.\n\nFor sanity: $13 per developer per active day is the Claude Code enterprise average, and 90 percent of users stay under $30.\n\nOne line of discipline instead of a new subsystem: a task class may auto-merge only after 20 logged runs at a 95 percent pass rate, and a single drop below 90 percent revokes it loudly.\n\nWeekly spend, from the per-tick costs ralph.sh already logs:\n\nCompute the metabolism before you cron. Daily cost is ticks times average tick cost.\n\nThe seat that handles the quiet no-work tick decides the bill. Cents on the cheap tier, dollars on a frontier model at high effort, for the identical \"nothing to do\" answer.\n\n## Running inside your limits\n\nThese models burn tokens fast, and how you run them decides how much of a day's work lands before you hit a wall.\n\nFirst, know which wall.\n\n- On an API key, the wall is the bill. progress.log already watches it.\n\n- On a subscription seat, the wall is a five-hour window and a weekly window judged together. Neither one appears anywhere in the log above.\n\nWatch the meter you are actually on: the usage panel in Codex settings, /usage on the Claude side, or a monitor like ccusage or codexbar parked in the corner of the screen.\n\nA limit you never read is a limit you discover by hitting it, with four hours left on the clock and nothing to run.\n\nSix levers, cheapest first. Most act at rungs 0 through 2, where the tokens burn:\n\n1. Trim CLAUDE.md and AGENTS.md to the essentials. Every single prompt reads them, plus every skill and tool you have enabled. Turn off what you are not using; an unused MCP server is a tax on every message.\n\n1. Drop the effort when you do not need the top of the ladder. Default medium or high. Save max for problems that need it. And confirm fast mode is off while you are in there, because it multiplies whatever you land on.\n\n1. Give the model clear stop points. These models run long by design. Have them finish the plan and check in before executing, which is plan mode doing its real job.\n\n1. Keep subagents on lower effort. They inherit the parent's model and its dial both, and a swarm at max empties a window in one message. The cheap fix is a law in both constitutions: do not spawn unless asked.\n\n1. Keep the expensive model off the bulk. Whether Fable sits on top as a low-token conductor or on call as an advisor, it earns its price at decision points, never while typing the thousandth line.\n\n1. Read what one message costs, then tune the five above against that number. This is the only lever that tells you which of the other five is your problem.\n\nTogether these levers set how long you can run the best models before the limit stops you.\n\nCron, when Week 2 starts:\n\nThe runbook. Each alarm, and what to do about it:\n\n![](https://pbs.twimg.com/media/HNG9O08agAAxWvb.jpg)\n\nThe 30-day schedule. Do not skip graduations; each unlocks the next.\n\n![](https://pbs.twimg.com/media/HNG9Re7bMAAiYp7.jpg)\n\n# The Command Deck\n\nEvery loop here is reachable from a keystroke. Slash commands live in ~/.codex/prompts/ on the Codex side, where the filename becomes the command, and in .claude/skills/ on the Claude side. The CLI clips are the headless versions that cron and CI run.\n\n## Codex slash commands\n\n![](https://pbs.twimg.com/media/HNGZ5u8agAEMtxe.jpg)\n\n/plan-stop and /effort pay for themselves fastest. Both spend a few hundred tokens to stop you spending a few hundred thousand.\n\nThese models run long, so the checkpoint you want comes before the spend. /plan-stop returns the plan, the done-when commands, the blast radius, the cost, and the one question it would ask a human. Then it stops.\n\nDrop both files in ~/.codex/prompts/, where the filename becomes the command.\n\neffort.md becomes /effort, the routing dial made explicit:\n\nA live answer looks like this, and it costs a few hundred tokens to avoid a few hundred thousand:\n\nplan-stop.md becomes /plan-stop, the checkpoint before the spend:\n\nfable-advice.md and review-hostile.md become /fable-advice and /review-hostile. Both are the Codex-side mirrors of files you already wrote: the advisor brief from BUILD 5, and the hostile-reviewer contract from BUILD 6. Same rules, same caps, pointed the other way across the vendor line.\n\ncompost.md becomes /compost, rung 4's weekly institution-builder:\n\n## CLI clips\n\nKeep these in a scratch file. They are the entire system reachable from a terminal:\n\nThe full policy lives in ROUTING.md from BUILD 4, which both harnesses read.\n\n# The Rules (print this)\n\n1. Laws, not tips: a number, a never, or a command that checks it.\n\n1. The model is rented. The loop is yours. You live on rung 5.\n\n1. A loop with no abort is a bill. Two caps on every one: iterations and dollars.\n\n1. Evidence flows up, control flows down. No rung closes on a report from below it.\n\n1. A loop can stop and still be wrong. Check the last commit before it merges.\n\n1. Route at boundaries. Effort before model. The cache votes against switching.\n\n1. Default to high. Max is depth, ultra is width, fast mode is a 2.5x tax, and subagents inherit the parent's seat and dial both.\n\n1. The router is guilty until it beats the best single model on your evals.\n\n1. Savings are the traffic split. Watch the cheap share, not the rate card.\n\n1. Execution is bulk, advice is grams. Cap the consults at three.\n\n1. Nothing grades its own homework. Fresh context, other lineage, native harness.\n\n1. A thread is a trace. A row is evidence. The gate reads rows.\n\n1. Never edit a test to pass it. Never merge past a BLOCKED gate.\n\n1. A goal you verify once is an assumption with a timestamp.\n\n1. One graduation at a time. Every month, delete something.\n\n# Closing\n\nThirty days from now, if you did the checks:\n\n- A loop ships boring work unattended, behind a deterministic gate\n\n- A cheap driver phones a frontier expert only when it stalls\n\n- Every meaningful diff gets judged by a model that did not write it\n\n- One number in progress.log tells you whether the economics compound\n\nThe models were never the hard part. A system that stays honest when you stop watching is the hard part, and it is why rung 5 still has your name on it.\n\nStart tonight with the twenty minutes that proves it. BUILD 2's verify.sh. One hand-run tick of BUILD 3. One review from the other lineage on your last commit.\n\nThe first time a reviewer that shares no context with the writer finds a real bug in work you were sure was done, you will not need convincing about the rest.\n\nBuild the gate tonight. Reply with what it caught on the first run.\n\n# Disclaimer\n\nWritten from the author's research notes and verified sources, with drafting and fact-checking assistance from Claude. All prices and model behaviors were checked against official pricing and documentation pages in the week of publication; they change, so verify before budgeting.\n\nThis article was written by the author's notes as mentioned in the aforementioned paragraph and edited with Claude Opus 4.7. \n\nIf you want to add any other corrections, please add it in the comments."}}