Skip to the harness
Foundry

Claude Code · the machinery around the model

The harness that runs this foundry.

The model does the reasoning. Everything else — hooks, guards, routing rules, recorders — decides what it may do, how work gets dispatched, and what survives the session. Drawn below as the machine hall it behaves like.

Audited by its own machinery
79 / 100↑ from 73
Independent adversarial re-score, not self-asserted. Honest gaps below — see what's still weak.
01 · intakethe ask arrives02 · guardshooks deny thecatastrophic03 · routingmode · tier · effort04 · furnaces — model tiersplanner · executor · chorefable/opus · sonnet · haiku05 · castingcommits · prs06 · recordssession logsmemorylessons return — skills · guards · rulesthe harness — machine hallgoverned engineering lineabhijit bansal · foundrydwg fy-05a2026-07-13n
intake the askguards deny the catastrophicrouting mode · tier · effortfurnaces fable/opus · sonnet · haikucasting commitsrecords session logsreturn pipe lessons become rules

01 · The switchyard

Same yard, different trains.

Every task is routed twice: an orchestration mode picks the shape of the work, then each dispatch sets two knobs — model tier and reasoning effort. Pick a scenario; watch the line light up.


Workflow — plan → approval → phases land serially/fix BUG-004 — “barcode lookup silently overwrites the name”
solosingle-file fix · conversational turnsingle agentone bounded delegationworkflowfan-out · pipelines · aggregationagent teamlong-lived roles · cross-talksecond role — reviewertask inthe askshippedcommits + PRdocs: checkpointsession logphase-boundary gatescompilegreentestswhole CubbyTestsreviewno CRIT/HIGHpush gate ▲block-oncelog ▲docs: checkpoint■ hard · ▲ reminderthe furnaces — every dispatch sets two knobs: tier + effortfable / opusplannerxhighsonnetexecutorhighhaikuchorelowplan deskpropose → WAITwriting-plansfable/opus · xhighTDD · phases serialsonnet · med–highdigests · checklistshaiku · lowphase boundary, in order: compile → whole CubbyTests → reviewer → push → docs: checkpoint
plan authored at planner tier · fable/opus · xhigh — then WAITS for approval
implementation is TDD at executor · sonnet · med–high
digests, checklists, sweeps at chore · haiku · low
every phase: compile → whole CubbyTests → reviewer → push → docs: checkpoint

The rule underneath: pick the cheapest mode that fits, escalate effort one step before tier, and never dispatch with both knobs implicit — an unset knob silently inherits the orchestrator's expensive defaults. Calibration point: one 26-agent review left on inherited defaults cost ~1.8M tokens; the same shape on the matrix runs at a fraction.

02 · The conveyor

Hooks the model can't reason around.

Five lifecycle events, each with shell scripts the runtime executes — not the model. Conventions become mechanisms at the exact moment they could be violated.


SessionStartonce, at opensession auto-namerultracode directivesession-context injectcaveman · instinctsUserPromptSubmiteach turncaveman re-assertinstinct observerpaused 07-12PreToolUsethe chokepointbash-guarddenycartoon rewrite−70%guard-test-scopedenyguard-push-gateremindguard-generated (W|E)denyPostToolUseafter each callformat-fileno-opStopend of turnstop-log-guardper tip/goal gateuntil metthe tool runsnext tool callhard — blocks every timeblock-once — reminds, then passesinject / passive
The honest line: three guards are genuinely hard — bash-guard, test-scope, generated-files (it fails closed). The two checkpoint gates are block-once reminders: they stop the first push, and pass the second identical one. That gap is named in the audit, not smoothed over.

03 · The ledger — shipped this week

Two loops, opposite cost profiles.

Six new slash commands turn "found a bug" into a committed ledger row in seconds — and keep all research out of capture. Resolution is the expensive loop, run with full wave ceremony. The rows below are the real backlog, logged from one device pass.


capture loop — cheap, instant, chore-tier/issue · /feature · /task"found a bug on X""we should build Y"no research, no readssecondsdocs/tracker/TRACKER.mdthe ledgerBUG-004barcode overwrites nameopen · medBUG-005favorite star unclearopen · lowFEAT-003edit an item’s cover photoopen · medFEAT-008voice queries over labelsopen · medTASK-002deploy CloudKit prod schemaopen · critTASK-004device checklist A–Hopen · high27 open on this branch · s32–s33 · 2026-07-13/backloggrouped, filtered viewresolve loop — full ceremony, AGENTS.md throughout/fix BUG-0041 · group a wavecluster by screen/arearecommend /goal first2 · plan, then WAITwriting-plans · plannerstatus → planned3 · TDD + reviewfailing test firstswift-reviewer per phase4 · gates + shipcompile · tests · reviewpush · docs: checkpoint5 · device-verifychecklist on real devicestatus → verified6 · archivearchive/2026-07.mdscreenshots swept⏸ user approval/tracker-learnattempts ≥ 2 → patterns reportsuggest-only — drafts nothingrepeat fixes feed skills · AGENTS.md amendments · hooks
Capture — chore tier, no research

/issue /feature /task — dedup against the ledger, assign an ID, append, commit. A screenshot token grabs the live simulator frame. Reporting a bug never turns into an uninvited debugging session.

Resolve — full ceremony

/fix BUG-004 groups a wave, recommends a /goal, authors a plan at planner tier, then stops for approval. Only after the yes: TDD, per-phase review, gates, device-verify, archive.

Learn — suggest-only

/tracker-learn mines items that took ≥2 attempts and asks why. It emits a prose report naming a target — a skill, an AGENTS.md amendment, a hook — and drafts nothing. The user decides what becomes machinery.

04 · The paper

One source of truth. Literally one.

CLAUDE.md is eight lines — an @import shim. Everything binding lives in AGENTS.md, where every rule traces to a named incident, commit hash, or measured token count.


cubby/CLAUDE.mdverbatim · all 8 lines
# CLAUDE.md

@AGENTS.md

The import above loads AGENTS.md — Cubby's canonical
conventions, the single source of truth across tools
(Claude Code, Cursor, Codex, …) — into every Claude Code
session. Do not duplicate rules here; amend AGENTS.md instead.

Two copies of a rule is how rules rot. The shim guarantees there's only ever one.

cubby/AGENTS.md — the register51 KB · 305 lines
Part 1 — Cubby engineeringLocked stack decisions
Roadmap amendments
Persistence rules
Protocol boundaries
Scan-quality rules (12)
Deep-link contract
Swift 6 concurrency playbook
Enforcement map
Testing · Build status
Part 2 — portable processAgent behavior
Orchestration modes
Wave workflow
Model routing & plans
Effort & dispatch cost
Session logs
Compaction protocol

Amendment rule: a decision that constrains future sessions must fold back into this file — a decision living only in a session log is session-local by definition.

"Current tier mapping (edit me, not the rules): planner/orchestrator = Fable/Opus · executor = Sonnet · chore = Haiku."

— the one line to edit when the lineup changes

"Challenge by default, then commit. Push back with substance — yours or the user's — before the call locks. Once made, execute; don't re-litigate."

— agent behavior, evidenced by sessions 0025/0027

"Never dispatch with both knobs implicit — an unset knob silently inherits the orchestrator's expensive values."

— effort & dispatch cost, after a measured 1.8M-token waste

There's more here than the outline. The page source greets any agent pointed at it with a fuller digest of the register — or open the console and type AGENTS().

05 · The arsenal

What's actually on the racks.

The enabled surface, not the installed one — and the distinction matters: ~360 skills are installed; curation is the open problem the audit keeps naming.


Plugins

13 on · 4 retired 07-12
superpowersios-devecccartooncavemancontext7visual-explainercore-workflowcommit-commandsclaude-md-managementskill-creatorplugin-devswift-lsp

cartoon wraps noisy build output into TOON (~70% fewer input tokens); caveman strips output filler (~65%). Compression is what makes the exhaustive default affordable. Retired as safe-defaults: security-guidance, claude-code-setup, ralph-loop, frontend-design.

Skills that earn their keep

114 enabled · ~360 installed
Process — run first, always

brainstorming · writing-plans · test-driven-development · systematic-debugging · verification-before-completion

Mined from real Cubby incidents (~51)

avfoundation-capture-delivery-watchdog · swift6-mainactor-compile-fixes · xcodegen-test-targets · release-inapp-vs-asc-whatsnew-surfaces

Project-local

session-log · tracker new

Precedence when several match: project-mined > AGENTS.md playbook > global rules > generic catalog. Declared this month; before that, first-match won.

Slash commands

the daily levers
Tracker new this week
/issue/feature/task/backlog/fix/tracker-learn
Session & quality
/goal/code-review/release testflight/compact
Learning
/learn/evolve/promote/instinct-status

/goal arms a Stop hook that blocks the session from ending until the stated condition holds. /compact is user-typed only — the agent's ceiling is suggesting a safe compaction point.

06 · The audit

79/100, and what that number hides.

Six agents read the actual config; an independent planner-tier pass scored it and refuted two of its own draft findings. Up from 73 — driven by real repo-scoped enforcement — and stale by its own rules until the next re-score.


Dimension scores — independent re-score, 2026-07-12
Workflow & orchestration17 / 20
strongest layer — still prose-enforced
Hooks & enforcement16 / 18
bash-guard hardened, 20/20 fixtures live
Recorders, memory & checkpoints12 / 17
instinct pile uncurated and growing
Skills ecosystem10 / 15
precedence declared; sprawl unchanged
Safety, cost & token control11 / 15
allowlist narrowing deferred by choice
Documentation13 / 15
every rule traces to an incident
Still weak — on the record
  • 272 banked instincts, uncurated — the observer that minted them is paused after ~92 failed runs; pruning found zero safe deletions.
  • ~360 installed skills across four populations that were never designed together; Swift 6 concurrency alone has 5–6 overlapping sources.
  • The push and stop-log gates verify that a checkpoint ritual happened, not that tests ran or a review was real.
  • The permission allowlist still auto-approves a few destructive shapes; narrowing it was deliberately deferred.
Full method + scorecard: cubby/docs/harness/EVALUATION.md · architecture: cubby/docs/harness/ARCHITECTURE.md (private repo — not published here)
governed workworkflow + tiers + adversarial verifysession logs + memoryresume pointers · decisionsone fact per fileinstincts272 banked · 0 byte-dupescuration still openobserver pausedskills · guards · rulesios-dev mined lessonsAGENTS.md amendmentsevery lesson becomes machinerythe next session starts smarter than the last

Open workshop

Steal what's useful. Help me get better.

This is a working setup, not a finished product — the audit above is the proof it isn't done. If you run a harness of your own, I'd genuinely like to compare notes.

Mail feedback ↗LinkedIn ↗

Foundry · Abhijit Bansal · exploration 05 — the harnessfigures drawn from the live config · 2026-07-13