Skip to content
PrepMint

Claude Code

Claude Code Workflows

Agentic workflows, subagents, multi-step tasks

50 questions
Easy· 20Medium· 20Hard· 10

Last reviewed

Recommended

Claude Code Workflows — Timed Test 3 (10 questions)

TimedEasy10 questions · 10 min
Start test

No account needed. Answers and explanations arrive when you submit.

What this topic tests

The mix every Claude Code Workflows set is built to, and the questions published against it so far. Nothing here is hidden before you start.

Claude Code Workflows — target difficulty mix and published question count per level
LevelTarget sharePublished
Easy40%20
Medium40%20
Hard20%10
Total50

Claude Code Workflows — the theory

Why Delegate Anything

Delegation looks like a speed trick and is mostly an economy one. What you spend is the context window of the conversation you are steering, and reading forty files into it to answer one question wastes it fastest. So delegate when the task produces verbose output you don't need in your main contextdelegate the exploration so only the findings come back. The bill does not disappear, though: running several sessions or subagents at once multiplies token usage.

What a Subagent Is, and What It Never Sees

A subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions, and returns a summary.

The isolation is the feature and the price. Each starts fresh, and it doesn't see your conversation history, the skills you've already invoked, or the files Claude has already read. "Fix the bug we just discussed" reaches an agent that was not there: whatever the worker needs must be in its prompt.

A fork is the exception that proves the rule — a subagent that inherits the entire conversation so far instead of starting fresh. Use one when re-explaining would cost more than the work; a fork can't spawn further forks.

Claude picks the worker automatically based on the task description in your request. Foreground subagents block the main conversation until complete; background ones run while you keep working, their results arriving as a completion notification in a later turn.

Four Surfaces, and the Question That Chooses Between Them

Claude Code delegates four ways, and in every approach the workers are Claude sessions. What separates them is one question: who holds the plan?

  • Subagents — Claude holds it, turn by turn: workers that do a side task in their own context and return a summary.
  • Background sessions — you hold it: they run unattended and report only to you.
  • Agent teams — a lead session holds it, coordinating work, assigning tasks, and synthesizing results.
  • Dynamic workflows — a script holds it. A workflow moves the plan into code.

Anthropic draws that line directly: use subagents when you need quick, focused workers that report back; use agent teams when teammates need to share findings, challenge each other, and coordinate on their own. And one near-miss: a background bash command doesn't spawn an agent.

Agent Teams Coordinate Peers

Teammates work independently, each in its own context window, and communicate directly with each other — the difference from subagents.

  • Teams don't isolate teammates in worktrees, so two teammates editing the same file leads to overwrites — break the work so each owns a different set of files.
  • Consent does not delegate: a teammate denied an action can't relay it to another teammate to bypass the check.
  • Teammates cannot spawn their own teammates, and the main session is the lead for its lifetime.

Coordination is explicit: a teammate shares results by messaging the lead or updating the shared task list. And they cost more: teams use significantly more tokens than a single session, and for sequential tasks, same-file edits, or work with many dependencies, a single session or subagents are more effective.

When the Plan Belongs in a Script

A dynamic workflow is a JavaScript script that orchestrates subagents at scale, written for the task you describe. What it buys is context, not concurrency: the script holds the loop, the branching, and the intermediate results itself, so Claude's context holds only the final answer. A script can even have independent agents adversarially review each other's findings before they're reported.

The price is your absence: there is no mid-run user input, so every decision is encoded before the run starts. So run the workflow on a small slice first to gauge the spend.

Isolation Is Not Coordination

The common failure in parallel work is two agents editing one file — a different problem with a different answer: worktrees isolate file edits, while subagents and agent teams coordinate the work itself.

A git worktree is a separate working directory with its own files and branch, sharing the same repository history and remote as your main checkout, so edits in one session never touch files in another. They require a git repository; outside one, sessions aren't isolated from each other. Claude Code blocks commands that reach back into the main checkout, and you can't turn this check off. Removing a worktree deletes the worktree directory and its branch, along with all the work in them.

Handing Off, and What Crosses Between Agents

A background session is a full Claude Code conversation that keeps running without a terminal attached, so you can open it, reply, and leave whenever you want. A subagent it spawns lands its file edits in the session's worktree rather than your working copy. And because it runs autonomously, it can't ask clarifying questions — the brief is the whole job.

Between sessions, a message is a piece of text one Claude writes to another, never conversation history or files; to move a whole conversation or its context, resume the session instead. No message from any agent counts as your approval for a pending permission prompt.

Splitting the Work Before You Delegate It

Decomposition is about ownership, not size: one agent, one set of files, one deliverable.

Fan out when the pieces are independent — each subagent explores its area independently, then Claude synthesizes the findings — which works best when the research paths don't depend on each other. Chain them when they do, so each passes relevant context to the next subagent.

Decide before editing, because letting Claude jump straight to coding can produce code that solves the wrong problem. And pilot anything repetitive: refine your prompt based on what goes wrong with the first 2-3 files, then run on the full set.

The Grader Must Not Be the Worker

Claude stops when the work looks done, and without a check the only thing deciding the agent is finished is the agent itself. So the longer Claude works unattended, the more an independent check matters — move the grading off the worker.

  • Give Claude something that produces a pass or fail, and the loop closes on its own — then ask for the test output, the command it ran and what it returned, not an assertion.
  • Review in a fresh context. A reviewer in a fresh subagent context sees only the diff and the criteria you give it, not the reasoning that produced the change, so it won't be biased toward code it just wrote — which is how the agent doing the work isn't the one grading it.

A goal adds a separate evaluator that checks your condition after every turn, so completion is decided by a fresh model rather than the one doing the work. Code Review is the same shape at scale: each agent looking for a different class of issue, then a verification step checks candidates against actual code behavior.

The trap sits inside the solution: a reviewer prompted to find gaps will usually report some, even when the work is sound, because that is what it was asked to do. So put the constraint in the brief — flag only gaps that affect correctness or the stated requirements — because chasing every finding leads to over-engineering. An unfiltered reviewer is not a stricter one.

Where a Repeatable Workflow Lives

Create a skill when you keep pasting the same instructions, checklist, or multi-step procedure into chat. For a guarantee rather than guidance, hooks are deterministic: they fire at fixed lifecycle points rather than at the model's discretion. Guidance belongs in a skill, enforcement in a hook, orchestration in a script.

Where to Go Next

Claude Code collects the subject. Claude Code Basics is the page underneath this one, and where compaction and /rewind live. MCP Integration in Claude Code adds the tools these agents reach for. AI Agents Basics generalises what changes once any assistant is given tools, and Prompt Engineering for Code covers the brief a delegated worker has to succeed from.

Sources

Official Anthropic documentation for Claude Code. Agents · Subagents · Agent teams · Workflows · Worktrees · Agent view · Cross-session messaging · Common workflows · Best practices · Glossary · Goal · Code Review · Skills

Sample questions

Three questions from this topic, with the answer and the reasoning shown.

Q1EasyA colleague arranges several Claude Code sessions as an agent team: one lead, a few teammates, and a task list shared between them. What does that arrangement add, compared with a set of workers that each hand their findings back to the session that called them?
  • The same workers under a new label — one caller still hands out the tasks and collects what each one returns
  • Peers that each hold their own context window and message one another directly, coordinated by a lead through a shared listCorrect
  • Peers do exist, but every finding travels through the lead, which relays to the others whatever one teammate learned
  • Stronger workers than the same job would otherwise get, so the work that comes back is of better quality

Explanation

The principle — a team is not a bigger subagent; what changes is who talks to whom.

Why the key is correct — three documented sentences fit together. Agent teams let you coordinate multiple Claude Code instances working together. One session acts as the team lead, coordinating work, assigning tasks, and synthesizing results. And teammates work independently, each in its own context window, and communicate directly with each other. The glossary names the two channels: a shared task list and peer-to-peer messaging.

Why the others are wrong — a relabelling would leave the topology alone, and that is what moves. A lead that relays every finding is not what is described: it assigns and synthesises while teammates talk between themselves. Capability is not what separates the surfaces.

Remember this — a team buys peers with a shared list, not better workers.

Sources — Anthropic's agent teams documentation and the glossary.

Open this question on its own page

Q2EasyA dynamic workflow is a script that orchestrates subagents. What does the script itself hold that a conversation doing the same work would otherwise be holding?
  • The loop, the branching and the intermediate results, so what reaches the conversation is the final answer aloneCorrect
  • The wording of a prompt you saved and re-run whenever the same job comes round again, rather than anything that executes
  • The arrangement for running many agents at the same time, since doing the work concurrently is what the whole thing is for
  • The sequence the agents run in, while each agent's working output still arrives in your conversation as it is produced

Explanation

The principle — a workflow moves the plan out of the conversation and into something that executes, and the context saving follows from where the working state is kept.

Why the key is correct — Anthropic defines it in three steps. A dynamic workflow is a JavaScript script that orchestrates subagents at scale. A workflow moves the plan into code. And the consequence: a workflow script holds the loop, the branching, and the intermediate results itself, so Claude's context holds only the final answer.

Why the others are wrong — a saved prompt cannot loop or branch. Concurrency is a by-product rather than the purpose. And intermediate results landing in the conversation is the thing the arrangement is built to prevent.

Remember this — the script holds the working state; the conversation gets the answer.

Sources — Anthropic's Claude Code documentation on orchestrating subagents at scale.

Open this question on its own page

Q3EasyA shell command sent to the background, and a prompt set to run on a schedule in the cloud, are both sometimes described as delegating work. What do they actually have in common?
  • Both are lightweight agents, useful when the job does not need a full one
  • Neither gives you another agent working in parallel on your machineCorrect
  • Both run agents in parallel with your session, just started differently
  • Both count as delegation, because neither one blocks your conversation

Explanation

The principle — two mechanisms look like parallel delegation because neither makes you wait. Neither gives you a second agent beside you.

Why the key is correct — Anthropic rules each out in its own sentence. A background bash command runs one shell command without blocking the conversation, and it doesn't spawn an agent. A routine runs a session on a schedule in the cloud, not in parallel on your machine.

Why the others are wrong — there is no lighter class of agent here — one of the two involves no agent whatever. Nor are both parallel: a scheduled run happens in the cloud on its own timetable. And treating non-blocking as the test would make almost anything delegation.

Remember this — not waiting is not the same as being helped. Ask what got started, and where.

Sources — Anthropic's Claude Code agents documentation.

Open this question on its own page

Practise all 50 questions

Every published question in Claude Code Workflows, with its answer and explanation.

Frequently asked

What people ask about claude code workflows.

Why does my subagent seem to ignore what we just discussed?
Because it was never there. Each subagent starts with a fresh, isolated context window and doesn't see your conversation history, the skills you've already invoked, or the files Claude has already read. It receives its own system prompt plus basic environment details like the working directory, not the full Claude Code system prompt, and every invocation creates a new instance with fresh context, so nothing carries over between calls. Whatever the worker needs has to be in the prompt it is sent. The one exception is a fork, which inherits the entire conversation so far instead of starting fresh.
Should I reach for subagents or an agent team?
Anthropic's own line is the clearest test: use subagents when you need quick, focused workers that report back, and use agent teams when teammates need to share findings, challenge each other, and coordinate on their own. Subagents work within a single session and report to the conversation that spawned them, while teammates each hold their own context window and communicate directly with each other. That coordination is not free — agent teams use significantly more tokens than a single session, and for sequential tasks, same-file edits, or work with many dependencies, a single session or subagents are more effective.
How do I stop two parallel agents from overwriting each other's work?
Isolate the files, which is a different problem from coordinating the work: worktrees isolate file edits, while subagents and agent teams coordinate the work itself. A git worktree is a separate working directory with its own files and branch, sharing the same repository history and remote as your main checkout, so edits in one session never touch files in another. Two caveats. Worktrees require a git repository, and outside one sessions aren't isolated from each other. And agent teams don't isolate teammates in worktrees at all, so two teammates editing the same file leads to overwrites — break the work so each teammate owns a different set of files.
Can I trust Claude's own “done” after it has been working unattended?
Treat it as a claim rather than a verdict. Claude stops when the work looks done, and without a completion check the only thing deciding the agent is finished is the agent itself, so the longer Claude works unattended the more an independent check matters before you count the work as done. Give Claude something that produces a pass or fail and the loop closes on its own, then ask for evidence rather than assertion: the test output, the command it ran and what it returned, or a screenshot. A goal goes further, adding a separate evaluator that checks your condition after every turn so completion is decided by a fresh model rather than the one doing the work.
Why does my reviewer subagent always find something wrong?
Largely because you asked it to. A reviewer prompted to find gaps will usually report some even when the work is sound, because that is what it was asked to do, and chasing every finding leads to over-engineering: extra abstraction layers, defensive code, and tests for cases that can't happen. The fix belongs in the brief — tell the reviewer to flag only gaps that affect correctness or the stated requirements, and treat the rest as optional. Fresh context is still worth having, since a reviewer that sees only the diff and your criteria won't be biased toward code it just wrote, but an unfiltered reviewer is not a stricter one.
What does a dynamic workflow do that asking Claude to spawn subagents does not?
It moves the plan out of a context window and into code. A workflow is a JavaScript script that orchestrates subagents at scale, and the script holds the loop, the branching and the intermediate results itself, so Claude's context holds only the final answer while the runtime executes it separately from your conversation. That is also what makes it worth encoding structure a person would not drive by hand, such as independent agents adversarially reviewing each other's findings before they're reported. The cost is your absence: there is no mid-run user input, so every decision has to be encoded before the run starts.

More Claude Code topics

All of Claude Code

Related guides

  • How it works · 11 min read

    Why the agent stopped before it finished

    You asked for five things and got one, with a confident summary and no error. An agent loop ends when the model writes a message containing no tool call — a judgement nothing checks against your task. The five ways a run ends early, each fingerprint, and the phrasing that fixes it.

  • How it works · 9 min read

    What a Claude Code subagent can and cannot see

    The docs specify how to define a subagent and never state what it inherits. A subagent starts on an empty context window, the delegation prompt is the only thing that crosses, and only its final message comes back — so it re-reads files you already read, and that is the feature working.