Rubric
Contents — domains, guide and mocks

Task decomposition strategies

CCAR-F 1.69 min read · checked 21 September 2026

Task statementDesign task decomposition strategies for complex workflows

Two patterns

Prompt chaining (fixed pipeline)Dynamic, adaptive decomposition
ShapeKnown steps in a known orderPlan generated from what is discovered
Best forPredictable multi-aspect work, e.g. a structured reviewOpen-ended tasks, e.g. “add tests to a legacy codebase”
StrengthPredictable, easy to test and debugHandles what you could not anticipate
RiskRigid when the input surprises youLess predictable cost and duration

Anthropic's “Building effective agents” names prompt chaining as the workflow pattern for tasks that decompose cleanly into fixed subtasks, trading latency for accuracy by making each step simpler. Reach for dynamic decomposition only when the steps genuinely cannot be known in advance.

The same post adds two details worth knowing. A chain can include programmatic “gates” between steps — checks in code that stop the chain if an intermediate result is off track. And there is a middle ground between a fixed chain and a fully dynamic agent: when the parts are independent, you can run them side by side (the post calls this sectioning), or let an orchestrator decide the subtasks from the input (orchestrator–workers, covered in 1.2). The post's overall advice is to start with the simplest pattern that works and add autonomy only when it pays for itself.

Pick the pattern from the task

Could you list the steps before seeing the input?
  • Yes, in a fixed order
    Prompt chaineach step feeds the next; gates between
  • Yes, and parts are independent
    Parallel sectionsrun side by side, then merge
  • No — findings change the plan
    Dynamic planmap, prioritise, adapt as you go
The deciding question is whether a later step depends on what an earlier step finds.

Large reviews: split the attention

Give a model thirty files at once and ask for a review, and it will skim — the guide calls this attention dilution. The fix is a chain: analyse each file on its own for local issues, then run a separate cross-file integration pass looking at how the pieces interact.

Anthropic's context-engineering write-up explains why this happens: as the number of tokens in context grows, the model's ability to recall and use any one part of it falls — attention is a budget that more material spreads thinner. A bigger context window gives you room for forty files; it does not give each file forty times the attention.

  1. Per-file pass: for each changed file, review only that file for local bugs, style and security issues.
  2. Integration pass: with the per-file findings and the interfaces between files, look for cross-file problems — broken contracts, inconsistent data flow, missing updates.
  3. Merge and de-duplicate findings.

One pass versus two layers

All 40 files in one pass

  • Attention spread across every file at once
  • Comments get shallower the further down the diff
  • Cross-file issues found only by luck

Per-file passes + integration pass

  • Each file gets a focused review of its own
  • Integration pass reads interfaces and findings, not everything
  • Findings merged and de-duplicated at the end
The per-file passes find local bugs; only the integration pass is positioned to see that a rename in one file was missed in two others.

The per-file passes are independent of each other, so they can run in parallel; the integration pass depends on all of them, so it runs last. Claude Code's own guidance for very large jobs follows the same idea: generate the list of files first, run one focused invocation per file, test the prompt on two or three files before running it on all of them.

Open-ended tasks: map, prioritise, adapt

“Add comprehensive tests to this legacy codebase” has no knowable step list. The guide's approach is to map the structure first, identify high-impact areas, and create a prioritised plan — then adapt the plan as dependencies are discovered. The plan is a working document, not a contract.

The adaptive loop

  1. Map the codebasemodules, entry points, existing tests
  2. Prioritisehighest risk and most used first
  3. Do the next itemwrite tests for one area
  4. Update the planrecord what was learned

new dependency or surprise → re-plan · plan complete → stop

Each pass of the loop can change the plan. That is the difference from a chain, whose steps are fixed before the first one runs.

Keeping the plan outside the model's head helps on long jobs. Anthropic describes agents keeping structured notes — a progress file or to-do list — that persist while the conversation is summarised or restarted. For this task, that note is the living plan: what is covered, what is next, and what was discovered.

Traps the wrong answers are built from

Tempting but wrongDo this instead
Reviewing many files in a single passPer-file local passes plus a separate integration pass.
A rigid pipeline for open-ended investigationMap first, then plan and adapt as you learn.
Dynamic agents for predictable workUse a fixed chain — cheaper, faster and easier to test.
Relying on a larger context window to fix shallow reviewsReduce what each pass must attend to.
Treating the first plan as fixedUpdate it when a dependency or surprise changes priorities.

You should now be able to

  • Choose prompt chaining for predictable multi-aspect work and dynamic decomposition for open-ended tasks.
  • Split large reviews into per-file passes and a cross-file integration pass.
  • Decompose open-ended work by mapping structure, prioritising, and adapting the plan.
  • Add programmatic gates between chain steps to stop bad intermediate results.

Practice questions

Original questions written for this lesson, in the exam’s style. Answer first, then open the reasoning — every option is explained, including why the wrong ones are tempting.

  1. Question 1

    A CI review of a 40-file pull request reports shallow comments and misses a bug where a renamed field in one module was not updated in two others.

    Which change addresses both problems?

    1. AUse a model with a larger context window and review all 40 files at once.
    2. BAsk the model in the prompt to be thorough and check every file carefully.
    3. CReview only the files with the most changed lines in this pull request.
    4. DReview each file separately, then run a cross-file integration pass.
    Show answer and reasoning
    1. AIncorrect. More room does not stop attention diluting across 40 files.
    2. BIncorrect. An instruction to be thorough does not change the structure causing the problem.
    3. CIncorrect. The missed bug is in files with small changes.
    4. DCorrect. Per-file passes fix the shallowness; the integration pass catches the cross-module rename.
  2. Question 2

    Which task is best suited to dynamic, adaptive decomposition rather than a fixed pipeline?

    1. AChecking every invoice for the same five required fields.
    2. BFinding why an unfamiliar service drops messages.
    3. CTranslating each release note into three languages.
    4. DFormatting a quarterly report to the house template.
    Show answer and reasoning
    1. AIncorrect. Known, repeated steps with nothing to discover — a fixed chain.
    2. BCorrect. Each finding determines what to look at next, so the steps cannot be listed in advance.
    3. CIncorrect. Predictable steps with no dependence on discovery.
    4. DIncorrect. The whole job is specified in advance, so a fixed chain fits.
  3. Question 3

    Which TWO are good reasons to implement a workflow as a fixed prompt chain? (Select 2.)

    1. AEvery input needs the same steps in the same order.
    2. BEach step can be tested and debugged on its own.
    3. CThe next step depends on what the previous one finds.
    4. DThe task is exploratory and its scope is unclear.
    5. EIt gives the lowest possible end-to-end latency.
    Show answer and reasoning
    1. ACorrect. That is the defining condition for chaining: the steps are known before the input arrives.
    2. BCorrect. Simple, separate steps with defined inputs and outputs are a core strength of a chain.
    3. CIncorrect. That is the signal for dynamic decomposition, not a fixed chain.
    4. DIncorrect. Unclear scope needs mapping and an adaptive plan.
    5. EIncorrect. Chaining trades latency for accuracy; sequential calls add time.
  4. Question 4

    An agent is adding tests to a legacy codebase from a plan it wrote at the start. While testing the orders module, it discovers the module depends on an untested pricing library with inconsistent behaviour.

    What should happen next?

    1. AContinue the original plan and note the pricing issue for the end.
    2. BUpdate the plan to characterise the pricing library before orders.
    3. CAbandon the plan and start again with a fresh map of the codebase.
    4. DSkip the orders module entirely because it has a risky dependency.
    Show answer and reasoning
    1. AIncorrect. Tests written against unknown pricing behaviour may lock in bugs; the discovery should change priorities.
    2. BCorrect. Adaptive decomposition means revising the plan when a dependency changes what should come first.
    3. CIncorrect. Most of the map is still valid; the plan needs an update, not a restart.
    4. DIncorrect. Avoiding the high-risk area defeats the purpose of prioritising by impact.

Sources

Drafted with AI assistance and checked against the sources above; expert review is in progress. Spotted an error? Tell us and it gets fixed, dated and listed on how this is written.