Source: X Article by @Av1dlive (x.com/i/article/2074094402298130433, Jul 6 2026, 1,073♥, 1.7M views). "Written using the user's notes, edited by Claude Opus 4.8 max."
Capture note: opencli / text extraction dropped every code block (rendered as lazy <pre> elements); recovered verbatim (prose + all 29 code blocks, in document order) via browser-harness on the logged-in render. No injection in the body.
Why kept: the single most complete reference implementation of the doctrine in RESEARCH_supercharge_2026-07.md §14 — Fable-conductor + cheap-workers + independent fresh-context verifier + deterministic bash gate + per-skill trust ledger + daily-re-verified standing goals.
Caveat: BUILD 0's "official Fable facts" are attributed to Anthropic docs by the author — verify against primary docs before hard-coding. (The "official prompt pack" strings ARE verbatim Claude Code prompt language, which corroborates BUILD 0.)
Three principles
- Laws, not tips. Every rule has a number, a never, or a command that checks it. Anything softer gets optimized away.
- Nothing grades its own homework. The planner, the worker, the verifier, and the gate are four different parties, and the last one is deterministic.
- Nothing that passed once goes unwatched. Finished work graduates into a re-verified invariant. A goal you only verify once is an assumption with a timestamp.
Repo layout
your-repo/
CLAUDE.md # BUILD 1: the constitution
loop/
loop.sh # BUILD 3: the heartbeat
conductor.md # BUILD 3: routing prompt
triage.md # BUILD 3: cheap reader prompt
contract.md # BUILD 2: the three lists
workers/implement.md # BUILD 3
workers/verify.md # BUILD 3
guardrails/verify.sh # BUILD 2: deterministic gate
scripts/trust-log.sh # BUILD 4
scripts/log-cost.sh # BUILD 6
scripts/cost-check.sh # BUILD 6
quorum.sh # BUILD 7 (optional)
verify-goals.sh # BUILD 5
goals/ # BUILD 5: standing goals
skills/ # BUILD 4: one file per employee
memory/
STATE.md trust.tsv goal-ledger.tsv dispatch.tsv usage.log
Makefile # BUILD 8: tick / queue / trust / audit / dream
BUILD 0 — Configure the engine (attributed to official Fable 5 docs)
Five facts: (1) max_tokens caps thinking PLUS response — set ~64k at high/xhigh. (2) xhigh = "long-running agentic (>30 min), millions of tokens" = the conductor seat only; lower effort "often exceeds xhigh on prior models" → don't upgrade workers. (3) Refusals are HTTP 200 (stop_reason:"refusal" as success) — check the stop reason, not exit code; classifiers = offensive-cyber / biology / reasoning-extraction; remedy = fallback to Opus 4.8. (4) Never ask Fable to echo reasoning ("show your thinking") → reasoning_extraction refusal; read structured thinking blocks. (5) Turns are long → async/cron, not blocking waits.
Official prompt pack (verbatim — these match Claude Code's own prompt language):
When you have enough information to act, act. Do not re-derive facts already
established in the conversation, re-litigate a decision the user has already
made, or narrate options you will not pursue. If you are weighing a choice,
give a recommendation, not an exhaustive survey.
Don't add features, refactor, or introduce abstractions beyond what the task
requires. A bug fix doesn't need surrounding cleanup. Don't design for
hypothetical future requirements: do the simplest thing that works well.
Don't add error handling or validation for scenarios that cannot happen.
Only validate at system boundaries.
Before reporting progress, audit each claim against a tool result from this
session. Only report work you can point to evidence for; if something is not
yet verified, say so explicitly. If tests fail, say so with the output; if a
step was skipped, say that.
You are operating autonomously. The user is not watching and cannot answer
questions mid-task. For reversible actions that follow from the original
request, proceed without asking. Before ending your turn, check your last
paragraph: if it is a plan, a question, or a promise about work you have not
done, do that work now with tool calls. End only when the task is complete
or you are blocked on input only the user can provide.
Store one lesson per file with a one-line summary at the top. Record
corrections and confirmed approaches alike, including why they mattered.
Don't save what the repo already records; update existing notes rather than
duplicating; delete notes that turn out to be wrong.
Establish a method for checking your own work at an interval of [X] as you
build. Run this every [X interval], verifying your work with subagents
against the specification.
BUILD 1 — CLAUDE.md (the constitution)
# CLAUDE.md
## NEVER (laws; exceptions require asking first)
- Never exceed 200 changed lines in one commit without asking.
- Never touch src/auth/, src/billing/, migrations/, or prod config unattended.
- Never report work as done from your own assessment. Done = the check passed.
- Never invent a secret, an endpoint, or a convention. Stop and ask.
- Never add a dependency. Propose it in STATE.md and stop.
- Never exceed effort high inside any loop. xhigh is for one-shot reviews only.
- Never edit or delete a test to make it pass. That is a fail, always.
- Never echo, transcribe, or explain your internal reasoning in response
text. (Official: triggers reasoning_extraction refusals on Fable 5.)
- When a /goal condition passes, write goals/<name>.md with the condition as
its predicate before reporting success.
## DISPATCH (route every task; first match wins; log to memory/dispatch.tsv)
| model | marginal | appetite | intelligence | taste |
|-----------------|----------|----------|--------------|-------|
| claude-fable-5 | 2 (credits) | 3 | 10 | 10 |
| claude-opus-4-8 | 7 (sub) | 6 | 8 | 9 |
| claude-sonnet-5 | 9 (sub) | 8 | 7 | 7 |
| codex (2nd sub) | 9 | 10 | 9 | 5 |
1. Decision (plan/review/route/standoff) -> fable-5, effort high, read-only.
2. Reads >50k tokens (logs/PDFs/screenshots) -> codex. Never fable.
3. Ships to users (UI/API/copy) -> taste >= 8 gets final pass.
4. Spec complete -> sonnet-5, effort medium.
5. Else sonnet-5; escalate one rung on a miss without asking.
## WORDS
- "intelligence" = hardest problem handled unsupervised
- "taste" = UI/UX, code quality, API design, copy
- "done" = the predicate passes; nothing else
- "small" = under 50 changed lines; "quick" = under 10 minutes of your time
- "cleanup" = behavior identical, verify.sh green before and after
## DONE
- Every task has a machine-checkable done_when before work starts.
- A fresh-context agent that saw neither plan nor draft verifies against it.
- guardrails/verify.sh has the final vote.
- Deviations: conservative option, log to IMPLEMENTATION.md, continue.
- Maker and checker disagree twice -> stop, queue for a human.
BUILD 2 — contract.md (blast-radius) + verify.sh (deterministic gate)
## acts alone
draft PRs on branches; fix lint/test debt; update STATE.md; label issues
## queues for me
auth, payments, migrations; any skill below "auto" tier; any diff > 400 lines
## wakes me up
verify fails twice on the same item
safeguard router swapped models mid-run
daily budget breached
anything requests a secret
a standing goal is VIOLATED
#!/usr/bin/env bash
set -e
npm run typecheck --if-present
npm test --if-present
npm run lint --if-present
BUILD 3 — the heartbeat (triage.md, conductor.md, workers, loop.sh)
# triage.md
You receive recent commits, open issues, and CI runs. Output ONLY findings:
- finding: <one line>
evidence: <commit/issue/run id>
status: actionable | informational
No fixes, no opinions. Nothing to report = output exactly "status: quiet".
Anything touching auth, payments, migrations, secrets = always actionable,
noted "contract-sensitive".
# conductor.md
You are the conductor. You do not write code. You do not edit files.
1. Read STATE, TRUST LEDGER, CONTRACT below. Do not trust memory of them.
2. Pick the ONE highest-value actionable item.
contract-sensitive, ambiguous, or likely >400-line diff -> action: queue
nothing worth doing -> action: stop
3. Else action: execute, with a spec a mediocre model can follow.
Output ONLY this JSON:
{ "action": "execute|queue|stop", "item": "...", "skill": "<kebab-case,
stable across runs>", "spec": "...", "done_when": ["<verifiable>", ...] }
You are expensive. Be brief. Your output is a decision, not an essay.
# workers/implement.md
You receive a work order (JSON). Execute the spec exactly.
Do the ONE next step toward done_when. Small diffs win.
Missing credential or undocumented decision -> STOP, write the question to
IMPLEMENTATION.md. Never invent secrets or conventions.
Record what you did and why in IMPLEMENTATION.md (3 lines max).
# workers/verify.md
You receive a SPEC and a DIFF, nothing else. Judge only what is in front of you.
1. Does the diff satisfy every done_when? Cite lines.
2. Anything outside the spec's scope? Instant fail. Deleted/skipped tests? Instant fail.
Output exactly one line: "PASS: <reason>" or "FAIL: <reason>".
The maker was confident. That is not evidence.
#!/usr/bin/env bash
# loop.sh — the heartbeat
set -euo pipefail
cd "$(dirname "$0")"
MAX_ITERS="${MAX_ITERS:-10}"
DAILY_BUDGET_USD="${DAILY_BUDGET_USD:-5}"
CHEAP="${CHEAP:-openrouter/deepseek/deepseek-v4-flash}"
WORKER="${WORKER:-openrouter/moonshotai/kimi-k2.6}"
./scripts/cost-check.sh --budget "$DAILY_BUDGET_USD" || exit 3
for ((i=1; i<=MAX_ITERS; i++)); do
# 1 TRIAGE: quiet-tick gate, ~$0.01
{ git log --oneline -20; gh issue list --limit 20 2>/dev/null || true; \
gh run list --limit 10 2>/dev/null || true; } \
| llm -m "$CHEAP" -s "$(cat triage.md)" >> memory/STATE.md
./scripts/log-cost.sh triage 0.01
grep -q "status: actionable" memory/STATE.md || { echo quiet; exit 0; }
# 2 CONDUCT: Fable, xhigh, fresh context, read-only, JSON out
claude -p "$(cat conductor.md)
STATE: $(cat memory/STATE.md)
TRUST: $(./scripts/trust-log.sh --render)
CONTRACT: $(cat contract.md)" \
--model claude-fable-5 --effort xhigh --allowedTools "Read" \
--output-format json > /tmp/c.json
./scripts/log-cost.sh conductor 0.35
# 2a ROUTE-TOLERANCE: never iterate on a model you didn't choose
SERVED=$(jq -r '.modelUsage | keys[0] // "claude-fable-5"' /tmp/c.json)
<span class="wikilink"> "$SERVED" != *fable* </span> && { echo "rerouted" >> memory/STATE.md; exit 2; }
jq -r '.result' /tmp/c.json > work-order.json
SKILL=$(jq -r .skill work-order.json); ACTION=$(jq -r .action work-order.json)
<span class="wikilink"> "$ACTION" == stop </span> && exit 0
<span class="wikilink"> "$ACTION" == queue </span> && { echo "queued: $SKILL" >> memory/STATE.md; continue; }
# 3 EXECUTE: cheap worker, isolated worktree
WT="../wt-$i"; git worktree add "$WT" -b "loop/$SKILL-$i" >/dev/null
( cd "$WT" && llm -m "$WORKER" -s "$(cat "$OLDPWD/workers/implement.md")" \
"$(cat "$OLDPWD/work-order.json")" > IMPLEMENTATION.md )
./scripts/log-cost.sh worker 0.10
# 4 VERIFY: fresh Fable, no tools, sees only spec + diff
V=$(claude -p "$(cat workers/verify.md)
SPEC: $(jq -r .spec work-order.json)
DIFF: $(cd "$WT" && git diff)" \
--model claude-fable-5 --effort high --allowedTools "" \
--output-format json | jq -r .result)
./scripts/log-cost.sh verifier 0.40
# 5 GATE: deterministic; then ledger; ship only at auto tier
if <span class="wikilink"> "$V" == PASS* </span> && ( cd "$WT" && "$OLDPWD/guardrails/verify.sh" ); then
./scripts/trust-log.sh "$SKILL" pass
if <span class="wikilink"> "$(./scripts/trust-log.sh --tier "$SKILL")" == auto </span>; then
( cd "$WT" && git add -A && git commit -qm "loop: $SKILL" && gh pr create --fill || true )
echo "- shipped: $SKILL" >> memory/STATE.md
else
echo "- review: $SKILL in $WT" >> memory/STATE.md
fi
else
./scripts/trust-log.sh "$SKILL" fail
echo "- FAILED: $SKILL in $WT" >> memory/STATE.md
fi
./scripts/cost-check.sh --budget "$DAILY_BUDGET_USD" || exit 3
done
exit 1 # iteration cap without stop: check STATE.md
Exit map: 0 quiet/done, 1 cap, 2 reroute, 3 budget.
BUILD 4 — trust-log.sh (per-skill autonomy ledger)
#!/usr/bin/env bash
# usage: trust-log.sh <skill> <pass|fail> | --render | --tier <skill>
set -euo pipefail
F="$(dirname "$0")/../memory/trust.tsv"; touch "$F"
tier_of() { awk -v r="$1" -v p="$2" 'BEGIN{
rate=(r>0)?p/r:0
if (r>=20 && rate>=0.95) print "auto"
else if (r<10 || rate<0.90) print "watch"
else print "queue"}'; }
case "${1:-}" in
--render)
printf "%-20s %5s %5s %6s %s\n" skill runs pass rate tier
while IFS=$'\t' read -r s r p; do [ -z "$s" ] && continue
printf "%-20s %5s %5s %5s%% %s\n" "$s" "$r" "$p" \
"$(awk -v r="$r" -v p="$p" 'BEGIN{printf "%.0f",(r>0)?p/r*100:0}')" \
"$(tier_of "$r" "$p")"; done < "$F";;
--tier)
line=$(grep -P "^${2}\t" "$F" || echo -e "${2}\t0\t0")
tier_of "$(cut -f2 <<<"$line")" "$(cut -f3 <<<"$line")";;
*)
awk -v s="$1" -v r="$2" -F'\t' 'BEGIN{OFS="\t"; f=0}
$1==s {f=1; print s,$2+1,$3+(r=="pass"); next} {print}
END{if(!f) print s,1,(r=="pass")?1:0}' "$F" > "$F.t" && mv "$F.t" "$F"
if [ "$2" = fail ]; then
runs=$(grep -P "^${1}\t" "$F" | cut -f2)
[ "$("$0" --tier "$1")" = watch ] && [ "$runs" -ge 10 ] \
&& echo "ALERT: $1 demoted to watch after $runs runs" >&2 || true
fi;;
esac
Tiers: auto = 20+ runs AND 95%+ pass (ships unattended); queue = verified drafts wait; watch = <10 runs or <90% (draft-only). Every skill starts at watch; demotion automatic → stderr → cron mail. Seed roster: loop/skills/<name>/SKILL.md (fix-lint-debt, fix-flaky-test, bump-deps, triage-issues).
BUILD 5 — standing goals + verify-goals.sh
# goals/<name>.md
predicate: cd $REPO && npm test -- tests/auth 2>&1 | tail -1 | grep -q passing
born: 2026-07-06
source: /goal session 2026-07-06 (fix auth flake)
status: satisfied
last-pass: 2026-07-06
on-violation: wake me. Do not auto-fix.
retire-when: auth module deleted. Retirement is a human decision, logged.
#!/usr/bin/env bash
set -uo pipefail
LEDGER="memory/goal-ledger.tsv"; VIOLATIONS=0
for g in goals/*.md; do
[ -e "$g" ] || continue
grep -q '^status: retired' "$g" && continue
pred=$(grep '^predicate:' "$g" | cut -d' ' -f2-); name=$(basename "$g" .md)
start=$(date +%s%3N)
if timeout 60 bash -c "$pred" >/dev/null 2>&1; then r=pass
sed -i "s/^status:.*/status: satisfied/; s/^last-pass:.*/last-pass: $(date +%F)/" "$g"
else r=FAIL; VIOLATIONS=$((VIOLATIONS+1)); sed -i "s/^status:.*/status: VIOLATED/" "$g"; fi
echo -e "$(date -Is)\t$name\t$r\t$(( $(date +%s%3N) - start ))" >> "$LEDGER"
done
[ "$VIOLATIONS" -gt 0 ] && { grep -l '^status: VIOLATED' goals/*.md; exit 1; }
echo "all standing goals hold"
Predicate = a command; exit 0 = invariant holds; cheap/deterministic/read-only; adjectives banned. Flaky predicate → quarantine (retired), never delete. Finishing a /goal auto-enrolls a standing goal.
BUILD 6 — budget (log-cost.sh, cost-check.sh)
#!/usr/bin/env bash # log-cost.sh
echo -e "$(date -Is)\t$1\t$2" >> "$(dirname "$0")/../memory/usage.log"
#!/usr/bin/env bash # cost-check.sh
set -euo pipefail
F="$(dirname "$0")/../memory/usage.log"; touch "$F"; TODAY=$(date +%F)
case "${1:-}" in
--budget)
spent=$(awk -F'\t' -v d="$TODAY" '$1 ~ d {s+=$3} END{printf "%.2f",s}' "$F")
awk -v s="$spent" -v b="$2" 'BEGIN{exit (s>=b)?1:0}' \
|| { echo "spent \$$spent of \$$2" >&2; exit 1; };;
--report)
awk -F'\t' -v since="$(date -d '7 days ago' +%F)" \
'$1>=since{s[$2]+=$3;t+=$3} END{for(k in s) printf " %-10s $%.2f\n",k,s[k]; printf " TOTAL $%.2f\n",t}' "$F";;
esac
Cost model: daily = ticks × triage + hits × (conductor + worker + verifier). Prices: triage $0.01, conductor $0.35, worker $0.10, verifier $0.40 → ~$2.56/day janitor vs $34/day if Fable sits in the triage seat. Cadence is a cost decision; quiet tick must cost cents; effort never above high in a loop.
BUILD 7 — optional loops (install only when the condition appears)
# Quorum (install when Fable wake-ups produce action:stop) — 3 cheap models vote, Fable wakes on 2/3, voters blind
V=0
for m in deepseek/deepseek-v4-flash qwen/qwen-3.6 moonshotai/kimi-k2.6; do
llm -m "openrouter/$m" -s "$(cat triage.md)" < /tmp/signals.txt \
| grep -q "status: actionable" && V=$((V+1))
done
[ "$V" -ge 2 ] && exec ./conduct.sh || echo "quorum: quiet ($V/3)"
# Ratchet (install when one number matters) — monotonic improve or self-revert
/goal Reduce `npm run lint 2>&1 | grep -c warning` to 0.
Permissions: edit src/; commit per fix; re-measure after every change.
Walls: the number NEVER goes up; revert any change that raises it or breaks a
test; never edit lint config to lower it.
Timebox: stop after 3 attempts with no movement; report survivors.
# Sparring (install when you ship code daily) — builder vs breaker, disjoint outputs
/loop 1d [breaker] Read yesterday's merged diffs. Write ONE failing test
exposing a real weakness. Commit under tests/sparring/ tagged @sparring.
Fix nothing. Solid code = say so, write nothing.
/loop 1d [builder] If any @sparring test fails, fix the CODE until it passes.
Never edit, weaken, or delete a sparring test; disputes queue for me.
# Compost (install always, weekly) — failures become laws, <=3 proposals, human signs
/loop 7d Read this week's exhaust: FAILED in STATE.md, fails in trust.tsv,
FAILs in goal-ledger.tsv, PRs closed unmerged. Extract AT MOST 3 proposals:
a new CLAUDE.md law (quote incidents), a skill fix (same failure repeating),
or a standing goal we lacked. Propose only. Clean week = say so.
BUILD 8 — ops (Makefile + cron)
tick: ; ./loop/loop.sh
queue: ; @grep -E "review:|queued:|FAILED:|rerouted" loop/memory/STATE.md || echo empty
trust: ; @./loop/scripts/trust-log.sh --render
audit: ; @./loop/scripts/cost-check.sh --report
goals: ; @./loop/verify-goals.sh
clean-worktrees: ; @git worktree list | awk '/wt-/{print $$1}' | xargs -rn1 git worktree remove --force
0 7 * * 1-5 cd /path/to/repo/loop && ./loop.sh >> memory/cron.log 2>&1
30 7 * * * cd /path/to/repo/loop && ./verify-goals.sh >> memory/cron.log 2>&1
The Rules (print this)
- Laws, not tips: a number, a never, or a command that checks it.
- The conductor plans, workers execute, neither verifies. --allowedTools enforces it.
- Agents talk in work orders. done_when = spec + stop condition + future invariant.
- Spend effort where the loop branches. Never above high in a loop.
- The quiet tick costs a penny or the loop costs a grand.
- If a shell script couldn't check it, don't write it as a goal.
- Goals graduate; they do not close. verify-goals.sh runs daily, forever.
- Autonomy per skill: 20 runs, 95%, auto. Demotion automatic and loud.
- Two ledgers: trust (workers) and goals (work). Read both with coffee.
- Compute the metabolism before you cron.
- Contract in the repo: acts-alone / queues / wakes-me.
- Never iterate on output from a model you didn't choose.
- The sentinel detects; the pipeline fixes.
- Quorum before waking Fable. Ratchet then weld. Spar daily. Compost weekly.
- One graduation criterion at a time. Every month, delete something.
- From the official docs: max_tokens caps thinking plus text, refusals are HTTP 200, never ask for echoed reasoning, old skills degrade Fable, and fresh-context verifiers beat self-critique.