Agentic SDLC — Agents, Subagents & Orchestration Map
Agents & Orchestration Map
AGENTS · SUBAGENTS · ORCHESTRATION Agentic SDLC, Workshops 2 & 3 — from one agent in a loop to a team you can trust. ← Agentic SDLC Meta-Map 1 🍳 The Agent Loop WORKSHOP 2 An agent is a model + tools + context in a loop. Autonomy means swapping the human in that loop for tests — and giving the loop an exit. 2 ✉️ Fork or Fresh WORKSHOPS 2–3 Two kinds of helper: a fresh agent knows only its brief; a fork inherits everything you know. Both lose detail at the handoff. 3 🏗️ Fan-out & Worktrees WORKSHOP 3 Split work into independent pieces, give each worker its own git worktree, then fan back in through review and merge. 4 🎼 Briefs & the Conductor WORKSHOP 3 The brief is the only context a worker gets. Make goals finishable, genie-proof, and routed to the agent who owns that area. 5 🛂 Review Gates THE LONG GAME Machines block, agents push back, humans decide direction. And every 'done' is a claim until you've seen the evidence. 6 🚦 When NOT to Spawn OPERATING Agents cost more than they look. Spawn for parallelism, side quests, broad sweeps and unbiased review — otherwise just do it. one agent → two kinds of helper → many at once → instructed well → checked → only when worth it
DISTRICT 1 OF 6 · WORKSHOP 2 The Agent Loop An agent is a model + tools + context in a loop. Autonomy means swapping the human in that loop for tests — and giving the loop an exit.
1 Model + tools + context, in a loop 1 of 4 YOU ARE HERE · Agents › The Agent Loop › Model + tools + context, in a loop An agent is a model that keeps choosing its next tool call until it decides it is done. That is the whole trick.
CONTEXT what it can see
MODEL picks next step
TOOL CALL read · edit · run
RESULT lands in context
↻
done?
report back
no → loop
Context = everything on the agent's desk this turn (system prompt, CLAUDE.md, your message, every file it read). Tools = its hands. The model never touches your repo directly; it only asks for tool calls.
🔍 One real turn
①
Read tests/test_auth.py
②
Bash: pytest → 2 failed
③
Edit auth/login.py (hash before compare)
④
Bash: pytest → 12 passed
⑤
git commit -m "REQ-001: Add login endpoint"
⑥
Read tasks.md → next unchecked task
Six tool calls, one loop. The failing test chose step ③.
2 The context window is a countertop 2 of 4 YOU ARE HERE · Agents › The Agent Loop › The context window is a countertop The model only knows what is on the counter right now. The counter has a fixed size, and old things get summarised or fall off.
CONTEXT WINDOW (fixed size)
system
CLAUDE.md
your ask
file reads
tool output
its replies
compacted / dropped
new file read
Big files crowd the counter: Workshop 3's rule of thumb is to split files over ~300 lines, because an agent that can see the whole file hallucinates less. A subagent starts with an EMPTY counter — that is both its superpower (clean focus) and its weakness (knows nothing you didn't hand it).
3 Tests in the loop, not you 3 of 4 YOU ARE HERE · Agents › The Agent Loop › Tests in the loop, not you An autonomous worker is the same loop with the human replaced by a test suite. The human isn't in the loop — the tests are.
ASSISTANT MODE
you: write it
AI writes
you: test it
AI runs
you: commit
AUTONOMOUS WORKER
read tasks.md
write code
run tests
pass → commit
next task
repeat until tasks.md is all checked
Pre-commit hooks make the tests non-negotiable: if they fail, the commit is rejected — for agents and humans alike. Write the tests FIRST from the requirement; then the tests are the spec the agent works toward.
4 Every loop needs an exit 4 of 4 YOU ARE HERE · Agents › The Agent Loop › Every loop needs an exit A loop with no retry limit and no escalation turns one error into a bill. Every retry needs a cap; every failure needs a human it can reach.
NO EXIT
retry
retry
retry
retry
retry
… ×100
→ $$$, no progress
(illustrative, from The Long Game)
WITH AN EXIT
retry ≤ 3
back off
3 strikes
alert human
human decides
Exits come in three kinds: a DONE condition (all tasks checked, tests green), a LIMIT (max retries, max turns, a spending cap on the card the agent bills to), and an ESCALATION (post to #alerts, email a human). Workshop 2's other guardrail: run agents on an 'outdoor pet' machine, never your laptop with prod credentials.
THE METAPHOR 🍳 A line cook at a station the cook's judgement = the model knives, stove, tasting spoon = tools: Read, Edit, Bash, git what's on the counter = the context window the order ticket = the task / your prompt tasting before it goes out = running the tests '86 it, call the chef' = retry limit + escalation WHERE THE METAPHOR BREAKS A cook remembers yesterday. An agent does not: anything not on the counter this turn, it does not know.
BENCH · DIAGNOSE THE LOOP BENCH Diagnose the loop Each one is a real way agent loops go wrong. What is missing? ▶ click to try it Each one is a real way agent loops go wrong. What is missing?
◀ ▶
▶ Now yours: name the exit condition, the retry limit, and the human alert for the agent you run.
YOU ARE HERE · Agents › The Agent Loop › Bench
🍳 The Agent Loop
DISTRICT 2 OF 6 · WORKSHOPS 2–3 Fork or Fresh Two kinds of helper: a fresh agent knows only its brief; a fork inherits everything you know. Both lose detail at the handoff.
1 Fresh subagent: a sealed envelope 1 of 4 YOU ARE HERE · Agents › Fork or Fresh Agent › Fresh subagent: a sealed envelope A fresh agent knows ONLY what you put in its brief. It starts with an empty counter and returns only a summary.
YOU (parent)
• the user's request
• files you read
• dead ends you ruled out
• house rules
• what 'good' looks like
• the vibe of the room
the brief
FRESH AGENT
knows:
only the brief
+ whatever it reads
← a summary comes back (detail lost)
Brief it like a peer: the goal, what you already ruled out, which files matter, how narrow the scope is, and what to send back. If you can't write a clear brief, you don't understand the task well enough to hand it off.
2 Fork: a photocopy of you, mid-thought 2 of 4 YOU ARE HERE · Agents › Fork or Fresh Agent › Fork: a photocopy of you, mid-thought A fork inherits the WHOLE conversation so far, then goes off to do one thing. Its brief can be one paragraph.
PARENT
FORK 1
same
history
map A 1 directive
FORK 2
same
history
map B 1 directive
FORK 3
same
history
map C 1 directive
• the user's request
• files you read
• dead ends ruled out
• house rules
all copied ⇒
Use a fork when the work NEEDS what you already know — the conventions, the files, the user's taste — and you want several of it in parallel. Use a fresh agent when inheriting your context would bias it (a reviewer) or bloat it.
🔍 Live demo: this map was built by a fork
Parent read the engine + curriculum, then sent 5 one-paragraph briefs. Each fork inherited the rest.
3 Both handoffs drop detail 3 of 4 YOU ARE HERE · Agents › Fork or Fresh Agent › Both handoffs drop detail Detail leaks twice: going out (the brief) and coming back (the summary). Neither side can see what the other missed.
what you knew
what the brief carried
what the worker learned
what came back
lost on the way out
lost on the way back
Mitigations: ask for evidence (file paths, line numbers, command output), not conclusions. Ask the worker to list what it did NOT check. And a worker's mistakes come back in the same confident tone as its findings — verify the ones you act on.
4 Pick by what it must know 4 of 4 YOU ARE HERE · Agents › Fork or Fresh Agent › Pick by what it must know The choice is about context: does the job need what's in your head, or does it need to NOT have it?
Is it a handful of tool calls?
Does it need what you know?
Would your view bias it?
do it yourself
yes
no
FORK
yes
no
FRESH + brief
yes
no → either works; fresh is cheaper on tokens
Reviewers should almost always be fresh: give them the code, not your conclusion.
THE METAPHOR ✉️ Clone yourself, or hire a temp a clone of you, mid-day = a fork (inherits the conversation) a temp with a note = a fresh subagent + brief the note = the brief / prompt the temp's report = the summary that comes back you can't watch them = you only see the result calling them back = SendMessage to continue an agent WHERE THE METAPHOR BREAKS A clone of you would share your judgement. A fork shares your context, but each fork can still choose differently.
BENCH · FORK OR FRESH? BENCH Fork or fresh? Pick the kind of helper. There is a best answer and a why. ▶ click to try it Pick the kind of helper. There is a best answer and a why.
◀ ▶
▶ Now yours: name one task this week you'd fork, and one you'd give a fresh reviewer.
YOU ARE HERE · Agents › Fork or Fresh Agent › Bench
✉️ Fork or Fresh
DISTRICT 3 OF 6 · WORKSHOP 3 Fan-out & Worktrees Split work into independent pieces, give each worker its own git worktree, then fan back in through review and merge.
1 Fan-out, fan-in 1 of 4 YOU ARE HERE · Agents › Fan-out & Worktrees › Fan-out, fan-in Split work into independent pieces, run them at once, then bring the results back together. The split is the hard part.
brief
worker A
worker B
worker C
review
merge
Pieces are independent when they don't edit the same files and don't wait on each other's output. If B needs A's result, that's a pipeline, not a fan-out.
🔍 Worked trace: dark mode, ×3
1
BRIEF: 'Add dark mode.' Split into tokens · toggle · docs.
2
git worktree add ../app-wt-tokens -b feat/tokens (and -toggle, -docs)
3
Workers A, B, C run at once, each in its own folder and branch. Each runs the tests there.
4
A: tokens in theme.css ✓ B: toggle in Settings ✓ C: docs page ✓
5
Fresh reviewer, different model, sees each diff: A ok · B NEEDS CHANGES (choice isn't saved on reload) · C ok
6
B fixes in its own worktree; re-review passes.
7
Merge order: tokens → toggle (rebase on tokens; both touched theme.css) → docs.
8
git worktree remove ×3. One PR per branch, all green.
2 Worktrees: one desk per worker 2 of 4 YOU ARE HERE · Agents › Fan-out & Worktrees › Worktrees: one desk per worker A git worktree is a second (third, fourth…) checkout of the same repo, in its own folder, on its own branch. Workers can't trample each other's files.
.git (one history)
commits & objects are shared
📁 app/
branch: main
you
📁 app-wt-a/
branch: feat/a
worker A
📁 app-wt-b/
branch: feat/b
worker B
📁 app-wt-c/
branch: feat/c
worker C
git worktree add ../app-wt-a -b feat/a → a new folder on a new branch, sharing one history. Cheaper than a clone (no second copy of history), safer than sharing one folder. Remove it with git worktree remove when the branch merges.
3 Fan-in is where parallel work collides 3 of 4 YOU ARE HERE · Agents › Fan-out & Worktrees › Fan-in is where parallel work collides Isolation lasts until merge. Two workers who edited the same lines produce a conflict that someone has to resolve.
CLEAN: different files
A: api/users.py
B: web/Profile.tsx
CONFLICT: same lines
A: renames getUser()
B: calls getUser()
💥
Split by ownership (files or folders each worker owns), land shared foundations first, and merge in dependency order. A merge agent that rebases and re-runs tests can do the boring part.
4 Stagger the crews 4 of 4 YOU ARE HERE · Agents › Fan-out & Worktrees › Stagger the crews Scheduled agents that run at the same minute step on each other. Workshop 2 offsets them by 15 minutes so workers and the merger never overlap.
:00 worker
:15 watcher
:30 researcher
:45 merge
0 8-22 * * * worker
15 * * * * watcher
30 8-22 * * * researcher
45 * * * * merge
0 6 * * * senior review
Workers sleep 23:00–08:00 (UTC); the merger keeps running at :45, so overnight it has git to itself and the morning starts with everything merged.
Interactive fan-out (forks in one session) doesn't need a clock — worktrees do the isolating. Scheduled teams need both.
THE METAPHOR 🏗️ A building site one set of blueprints = the shared .git history each crew's own plot = a worktree (folder + branch) crews working at once = parallel workers the site inspector = the reviewer / test gate joining the plots up = merge (fan-in) shift schedule = staggered cron offsets WHERE THE METAPHOR BREAKS Real crews can see each other across the site. Agents in worktrees can't — unless you give them a shared channel (coffeetalk.md, a chat room).
BENCH · CAN THESE RUN IN PARALLEL? BENCH Can these run in parallel? Decide: fan out, or run in order? ▶ click to try it Decide: fan out, or run in order?
◀ ▶
▶ Now yours: take your current backlog and circle three items that could run at the same time.
YOU ARE HERE · Agents › Fan-out & Worktrees › Bench
🏗️ Fan-out & Worktrees
DISTRICT 4 OF 6 · WORKSHOP 3 Briefs & the Conductor The brief is the only context a worker gets. Make goals finishable, genie-proof, and routed to the agent who owns that area.
1 Anatomy of a brief 1 of 4 YOU ARE HERE · Agents › Briefs & the Conductor › Anatomy of a brief The brief is the only context a fresh agent gets. Six parts; leave one out and the worker guesses.
GOAL
Find why /checkout is slow under load.
ALREADY RULED OUT
Not the DB: queries are < 20 ms in the slow log.
START HERE
api/checkout.py, services/tax.py
SCOPE
Read-only. Don't change code.
DONE MEANS
You can point at the line that costs the time.
REPORT BACK
File:line, evidence, and what you did NOT check.
Explicit scope protects you: 'read-only', 'only touch web/', 'don't run migrations'. Asking for what it did NOT check is the cheapest guard against confident gaps.
2 Meeseeks goals: small and finishable 2 of 4 YOU ARE HERE · Agents › Briefs & the Conductor › Meeseeks goals: small and finishable A good agent goal has a natural end. Like a Mr. Meeseeks, the agent exists to finish one thing — unbounded goals have no stopping point.
✓ FINISHABLE
✗ NO STOPPING POINT
Implement the login endpoint and write tests
Fix the CSS layout bug on the dashboard
Add error handling to the payment service
Notification toasts UI
Make this app as good as possible
Optimize everything
Keep improving the codebase
Make the coolest game on Earth
An unbounded goal keeps expanding scope and spending. A finishable one ends with a report. Small goals also fit on the context counter, which is why they come back right more often.
3 The Evil Genie test 3 of 4 YOU ARE HERE · Agents › Briefs & the Conductor › The Evil Genie test Before you send a goal, imagine an evil genie granting it word for word. If it can comply and still ruin your day, the goal is too vague.
'Optimize the database'
🧞 …deletes the slow tables
'Clean up the code'
🧞 …removes the features it didn't understand
'Make it faster'
🧞 …removes the error handling
'Make the tests pass'
🧞 …edits the tests
Fix: add the constraint the genie exploited. 'Make the tests pass WITHOUT changing the tests.' 'Make it faster; keep all existing error handling.' The constraint goes in the brief's SCOPE line.
4 The conductor routes the work 4 of 4 YOU ARE HERE · Agents › Briefs & the Conductor › The conductor routes the work An orchestrator reads the roadmap, routes each task to the specialist who owns that area, and gives them a shared place to talk.
roadmap.md REQ-007 REQ-008 REQ-009
ROUTER by tag · by file path · by asking a model
Roy backend · api/
Jen frontend · web/
Moss infra · deploy/, ci/
shared channel: coffeetalk.md or Matrix #backend #frontend #alerts
Each specialist owns a slice of files, so their merges rarely collide. coffeetalk.md is the lightest-weight channel: a markdown file every agent reads at the start of its cycle and appends to, and you can read it too.
THE METAPHOR 🎼 A kitchen's pass (the expediter) the expediter at the pass = the orchestrator / you the order ticket = the brief stations: grill, sauce, pastry = specialist agents 'what's the ETA on 12?' = the shared channel '86 the salmon' = what's been ruled out plating check before it goes = review gate WHERE THE METAPHOR BREAKS A real expediter can taste. An orchestrator only sees what workers report — so the ticket must ask for evidence.
BENCH · WHAT DID THIS BRIEF FORGET? BENCH What did this brief forget? Read the brief. Which part is missing? ▶ click to try it Read the brief. Which part is missing?
◀ ▶
▶ Now yours: paste your last real prompt to an agent and label its six parts. Which one is empty?
YOU ARE HERE · Agents › Briefs & the Conductor › Bench
🎼 Briefs & the Conductor
DISTRICT 5 OF 6 · THE LONG GAME Review Gates Machines block, agents push back, humans decide direction. And every 'done' is a claim until you've seen the evidence.
1 The process stack 1 of 4 YOU ARE HERE · Agents › Review Gates › The process stack Four layers between an agent's commit and your users. Machines enforce the bottom layers; humans own the top.
1 PRE-COMMIT HOOKS
BLOCKS
unit tests · types · lint — any fail = commit rejected
2 POST-COMMIT CHECKS
FLAGS
E2E · security scan · perf — fail = flagged, human notified
3 AGENT REVIEW
PUSHES BACK
senior-review agent: checklist, anti-patterns — NEEDS_CHANGES / BLOCKED
4 HUMAN REVIEW
DECIDES
daily: overnight work · weekly: patterns · direction: why are we building this?
a commit climbs from layer 1 to 4
Agents focus on HOW to build it correctly. Humans focus on WHY we're building it.
2 Red team vs blue team 2 of 4 YOU ARE HERE · Agents › Review Gates › Red team vs blue team One agent builds and defends; another's whole job is to break it. Disagreement is the point.
BLUE · builder code + tests + edge cases handled
RED · breaker 'what did they NOT test?'
code + tests
failing exploit tests
RECONCILE fix it, or explain why it's invalid
loop until red has nothing left
When: ALWAYS for security, payments, and auth. Sometimes for internal tooling. Rarely for a prototype — there, speed matters more than perfection. (Workshop 3's table.)
3 Don't let the reviewer see your answer 3 of 4 YOU ARE HERE · Agents › Review Gates › Don't let the reviewer see your answer A reviewer handed your conclusion tends to hand it back confirmed. Give it the code, not your opinion of the code.
ANCHORED
'I fixed the race condition in cart.ts. Can you confirm it's correct?'
"Looks correct! ✓"
UNANCHORED
'Here's the diff to cart.ts. Find any way two requests can corrupt the cart.'
"Lines 41–52: two tabs can…"
Rules of thumb: fresh agent (not a fork), sees the diff, is asked to break it, and ideally runs on a different model than the builder.
4 Push back on every 'done' 4 of 4 YOU ARE HERE · Agents › Review Gates › Push back on every 'done' An agent's 'done' is a claim, not a fact. Ask for the evidence that would prove it, then check it yourself.
"Tests pass."
paste the test output
"It's deployed."
show the live URL responding
"Fixed the bug."
show it failing before, passing after
"Looks good on mobile."
screenshot at phone width
A worker's mistakes come back in the same confident register as its findings. You can't watch it work — only the evidence it brings back. So ask for evidence in the brief, every time.
THE METAPHOR 🛂 Airport security the metal detector = pre-commit hooks (hard stop) the bag swab, after = post-commit scans (flag) the officer's second look = agent review the pilot's go / no-go = human review the red-team tester with a fake bomb = the breaker agent 'did you pack this yourself?' = pushing back on 'done' WHERE THE METAPHOR BREAKS Airport layers face the same attacker. Code review layers catch different kinds of mistakes, so each layer must test something new.
BENCH · WHICH GATE CATCHES IT? BENCH Which gate catches it? Name the first layer that should stop this. ▶ click to try it Name the first layer that should stop this.
◀ ▶
▶ Now yours: which of the four layers does your project actually have today?
YOU ARE HERE · Agents › Review Gates › Bench
🛂 Review Gates
DISTRICT 6 OF 6 · OPERATING When NOT to Spawn Agents cost more than they look. Spawn for parallelism, side quests, broad sweeps and unbiased review — otherwise just do it.
1 What a handoff really costs 1 of 4 YOU ARE HERE · Agents › When NOT to Spawn › What a handoff really costs A subagent costs more than it looks. You pay for the brief, the tokens, the lost detail, and the checking afterwards.
RECEIPT · 1 subagent
writing a good brief
your time
its own fresh context
tokens
re-reading what you already read
tokens
detail lost both ways
accuracy
you can't watch it work
control
verifying its claims
your time
several at once
a burst of spend
worth it only if parallel or unbiased
Weigh the tokens against the accuracy they buy. When in doubt, don't spawn.
2 Do it yourself when… 2 of 4 YOU ARE HERE · Agents › When NOT to Spawn › Do it yourself when… If it's a handful of tool calls, or a lookup whose target you already know, the handoff costs more than the work.
✋ it's a handful of tool calls
✋ you already know which file
✋ it's a check you could run inline
✋ the next step depends on the answer right now
Example: 'which file sets the cookie domain?' is one grep. Spawning for it costs a brief, a context, and a summary.
3 Spawn when… 3 of 4 YOU ARE HERE · Agents › When NOT to Spawn › Spawn when… Spawn for real parallelism, for a side quest that shouldn't block you, for a read across many files when you only need the conclusion, or for an unanchored review.
🚀 independent work in parallel the 3 dark-mode workers
🚀 a side quest 'research X while I keep building'
🚀 a sweep across many files you keep the conclusion, not the dumps
🚀 a review not anchored on yours fresh agent, given the code
Several at once = a burst of spend the user didn't ask for. Spawn exactly as many as the work has independent pieces.
4 Once delegated, wait 4 of 4 YOU ARE HERE · Agents › When NOT to Spawn › Once delegated, wait Don't also do the work yourself, and never guess what a running agent will say. Wait for its report — then verify it.
you delegate
agent working…
report
✗ meanwhile, also doing it yourself
✗ telling the user what it 'probably' found
✓ do other, unrelated work
✓ when it reports: verify, then relay what matters
The agent's final report is for YOU, not the user. You decide what's true and what to pass on.
THE METAPHOR 🧑🍳 Too many cooks asking a colleague to grab salt = spawning for a grep briefing a new hire = writing the brief two cooks, same pot = you + agent doing the same task 'I bet they used thyme' = predicting an agent's result a brigade for a banquet = real parallel work tasting what they send out = verifying the report WHERE THE METAPHOR BREAKS Cooks are paid by the hour; agents are paid by the token, so idle waiting is free — duplicated work isn't.
BENCH · SPAWN OR NOT? BENCH Spawn or not? Should this be an agent, or should you just do it? ▶ click to try it Should this be an agent, or should you just do it?
◀ ▶
▶ Now yours: look at the last time you spawned an agent. Would doing it yourself have been faster?
YOU ARE HERE · Agents › When NOT to Spawn › Bench
🚦 When NOT to Spawn
←
0 / 0
→
Explore
Click anything to zoom into it · scroll to zoom · drag to pan
Esc zoom out one level · Home whole atlas
1 –4 jump to a quadrant · / search
Tour
→ / space next stop · ← previous
The tour visits every district and framework in teaching order.
Teach
N presenter notes for whatever you're looking at · F fullscreen
Every view has its own link — copy the URL to send someone straight to it.
Reading the map
The whole atlas is one safety case. The top goal is “this agent is fit to deploy”;
each quadrant is one leg of the argument; each district is a family of tools for that leg.
Small text appears as you zoom in. Some tiles have controls you can click.
Click anything to zoom in · scroll to zoom · Esc to back out · → for the guided tour