Breaking Down Tasks: Master Task Decomposition for AI Agents

Michael BrenndoerferJuly 19, 202513 min read

Learn how AI agents break down complex goals into manageable subtasks. Understand task decomposition strategies, sequential vs parallel tasks, and practical implementation with Claude Sonnet 4.5.

Breaking Down Tasks (Task Decomposition)

Here's a question you've probably faced in your own life: when someone gives you a big, complicated task, what's the first thing you do?

Most of us don't just dive in randomly. We pause. We think. We break the big task into smaller, more manageable pieces. If someone asks you to "plan a weekend getaway," you don't immediately book a hotel. You first figure out where you might go, then check transportation options, then look at accommodations, and so on. You decompose the large goal into a sequence of concrete steps.

Our AI assistant needs to learn this same skill. Up until now, we've built an agent that can reason, use tools, remember context, and navigate its environment. But when you give it a complex, multi-step request, it needs a way to organize its approach. It needs to plan.

Task decomposition is the foundation of planning. It's the art of taking a big, fuzzy goal and breaking it down into specific, achievable subtasks. In this section, we'll explore why this matters, how agents can do it, and what it looks like in practice.

Why Agents Need to Decompose Tasks

Let's see what happens when an agent tries to handle a complex request without decomposition. Imagine you ask your assistant:

"Help me prepare for my client presentation next Friday. I need to research the client's industry, create a slide deck, practice my delivery, and send a meeting invite to the team."

That's actually four different subtasks bundled into one request. If the agent tries to do everything at once, it might:

  • Miss one of the subtasks entirely
  • Start working on steps in the wrong order (like practicing before creating the slides)
  • Get overwhelmed and produce a confused or incomplete response

Here's what an unprepared agent might output:

In[3]:
Code
## Using Claude Sonnet 4.5 for its superior agent reasoning capabilities
import os
from anthropic import Anthropic

client = Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))

response = client.messages.create(
    model="claude-sonnet-4-5",
    max_tokens=300,
    messages=[{
        "role": "user",
        "content": "Help me prepare for my client presentation next Friday. I need to research the client's industry, create a slide deck, practice my delivery, and send a meeting invite to the team."
    }]
)

print(response.content[0].text)
Out[3]:
Console
I'll help you break this down into a manageable plan for your presentation preparation. Here's a structured approach:

## **Immediate Priority (This Week)**

**1. Research the Client's Industry**
- Identify key trends, challenges, and competitors
- Review recent news and market reports
- Understand regulatory environment if applicable
- Time needed: 3-4 hours

**2. Send Meeting Invite**
- Do this ASAP so your team can plan accordingly
- Include: date, time, attendees, agenda, any prep materials
- Time needed: 15 minutes

## **Mid-Week Tasks**

**3. Create Slide Deck**
- Outline key messages first
- Structure: Problem → Solution → Value/ROI → Next Steps
- Keep it visual and concise (10-15 slides max)
- Time needed: 4-6 hours

## **Later in Week**

**4. Practice Delivery**
- Run through 2-3 times alone
- Practice once with a colleague for feedback
- Time your presentation
- Anticipate questions
- Time needed: 2-3 hours

## **Suggested Timeline**
- **Monday-Tuesday**: Research + send invite
- **Wednesday-Thursday**: Build deck
- **Thursday-Friday**: Practice runs
- **Weekend/Monday**: Final refinements

**

The model might respond with something like:

I can help you prepare for your presentation! You should start by researching the client's industry, looking at recent news and trends. For the slide deck, consider using a template that highlights key points. Practice your delivery a few times to build confidence, and don't forget to send a calendar invite to your team with the meeting details.

That's not terrible, but notice what's missing: the agent hasn't actually done anything. It's given you advice, but it hasn't organized the work into actionable steps, determined what order to tackle them, or begun executing any of them.

Compare that to what we want: an agent that breaks down the request into clear subtasks and can work through them systematically.

The Core Idea: Think First, Act Second

Task decomposition follows a simple but powerful principle: before you start working, figure out what work needs to be done.

This is different from the chain-of-thought reasoning we covered earlier. Chain-of-thought helps an agent think through a single problem step by step. Task decomposition is one level higher: it's about identifying multiple distinct problems that need to be solved, and organizing them into a coherent plan.

Think of it like the difference between:

  • Reasoning: "How do I calculate the answer to this math problem?" (thinking through one task)
  • Decomposition: "This assignment has three math problems, a written explanation, and a graph. Let me tackle them one at a time." (organizing multiple tasks)

For our assistant, task decomposition means taking a user request and generating a list of subtasks. Each subtask should be:

  1. Specific: Clear enough that the agent knows exactly what to do
  2. Achievable: Something the agent can actually accomplish with its available tools and capabilities
  3. Ordered: Arranged in a logical sequence where later steps can build on earlier ones

Let's see what this looks like in practice.

A First Example: Breaking Down a Complex Request

Let's build an agent that can decompose a multi-step request. We'll use Claude Sonnet 4.5 because of its strong reasoning capabilities, and we'll explicitly prompt it to break down the task before doing anything else.

First, we'll create a function that prompts the model to decompose a task:

In[4]:
Code
## Using Claude Sonnet 4.5 for its superior agent reasoning capabilities
import os
import re
from anthropic import Anthropic
import json

client = Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))

def decompose_task(user_request):
    """Ask the agent to break down a complex task into subtasks."""
    prompt = f"""You are a helpful assistant that breaks down complex tasks.
    
User request: {user_request}

Please decompose this request into specific, actionable subtasks.
Each subtask should be concrete and done independently.
Organize them in a logical order.

Respond ONLY with a JSON list, no other text: ["subtask 1", "subtask 2", ...]"""

    response = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=500,
        messages=[{"role": "user", "content": prompt}]
    )
    
    text = response.content[0].text
    # Extract JSON array from response (in case there's extra text)
    match = re.search(r'\[.*\]', text, re.DOTALL)
    if match:
        return json.loads(match.group())
    return json.loads(text)

Now let's test it with our presentation example:

In[5]:
Code
user_request = """Help me prepare for my client presentation next Friday. 
I need to research the client's industry, create a slide deck, 
practice my delivery, and send a meeting invite to the team."""

subtasks = decompose_task(user_request)

print("Decomposed Task List:")
for i, subtask in enumerate(subtasks, 1):
    print(f"{i}. {subtask}")
Out[5]:
Console
Decomposed Task List:
1. Research the client's industry trends, key competitors, and recent news
2. Identify the client's main pain points and business challenges
3. Define the presentation objectives and key messages
4. Create an outline for the slide deck structure
5. Design and build the presentation slides with content
6. Add visual elements, charts, and graphics to the slides
7. Prepare speaker notes for each slide
8. Review and proofread the entire slide deck
9. Practice the presentation delivery out loud at least twice
10. Time the presentation to ensure it fits the allocated duration
11. Prepare answers to potential questions the client might ask
12. Create a list of team members who need to attend
13. Draft the meeting invite with date, time, location, and agenda
14. Send the meeting invite to all team members
15. Send a calendar reminder for final preparation the day before

When you run this, the agent might produce:

Decomposed Task List:

1. Research the client's industry, including recent news and key trends
2. Create a slide deck based on research findings
3. Practice delivery of the presentation
4. Send a meeting invite to the team for next Friday

Notice what happened here. The agent took our messy, compound request and turned it into a clean, ordered list. Each item is specific enough to guide action, and they're arranged in a sensible sequence (you wouldn't practice your delivery before creating the slides).

This is the heart of task decomposition: transforming ambiguity into clarity.

Decomposing Different Types of Tasks

Task decomposition isn't one-size-fits-all. Different kinds of requests need different kinds of breakdowns. Let's explore a few scenarios to build intuition.

Sequential Tasks

Some tasks have a natural order where each step depends on the previous one. Our presentation example is like this: you need to do research before creating slides, and you need slides before you can practice.

In[6]:
Code
## Using Claude Sonnet 4.5 for agent-based applications
request = "Plan my weekend getaway to the mountains."

subtasks = decompose_task(request)

## Might produce:
## 1. Find mountain destinations within driving distance
## 2. Check weather forecast for the weekend
## 3. Book accommodation at chosen destination
## 4. Plan activities based on weather and location
## 5. Create packing list for mountain trip

Notice the dependencies: you can't book accommodation until you've chosen a destination. You can't create a packing list until you know the weather. The agent needs to recognize these logical dependencies.

Parallel Tasks

Other tasks can be done simultaneously or in any order. If someone asks you to "clean up my inbox, check my calendar, and get a weather update," there's no dependency between these subtasks. The agent could do them in any sequence, or even (in a more advanced system) do them in parallel.

In[7]:
Code
request = "Give me a morning briefing: check my calendar, unread emails, and today's weather."

subtasks = decompose_task(request)

## Might produce:
## 1. Retrieve today's calendar events
## 2. Count and summarize unread emails
## 3. Get current weather and forecast
## 4. Compile briefing summary

The first three subtasks can happen in any order. Only the last one (compiling the summary) depends on the others.

Nested Tasks

Sometimes a subtask is itself complex enough to need further decomposition. This is where planning gets interesting: you might break down a task, then break down one of the subtasks, creating a hierarchy.

For now, we'll keep things simple with flat lists. But as we build more sophisticated agents, this kind of hierarchical decomposition becomes powerful.

Guiding the Agent's Decomposition

The way you prompt the agent significantly affects the quality of its task breakdown. Here are a few techniques that work well:

Be Explicit About What You Want

Tell the agent to decompose the task. Don't assume it will do so automatically.

In[8]:
Code
## Good: Explicit instruction
prompt = """Break this request into specific, actionable subtasks:
{user_request}

List each subtask on a new line."""

## Less effective: Vague prompt
prompt = "Help me with this: {user_request}"

Ask for Ordering and Dependencies

Encourage the agent to think about sequence:

In[9]:
Code
prompt = """Break down this task into ordered steps.
Arrange them so that each step can build on previous steps.

Task: {user_request}

Provide a numbered list."""

Specify the Level of Detail

Sometimes you want high-level subtasks; sometimes you want very granular steps. Make this clear:

In[10]:
Code
## For high-level decomposition
prompt = "Break this into 3-5 major steps: {user_request}"

## For detailed decomposition
prompt = "Break this into detailed, specific subtasks, aiming for 8-10 items: {user_request}"

Making Decomposition Practical

Let's build a more complete version of our decomposition system that our assistant can actually use. We'll add structure to make it easier to work with the resulting subtask list.

First, here's a class that handles task decomposition:

In[11]:
Code
## Using Claude Sonnet 4.5 for its superior agent reasoning capabilities
import os
from anthropic import Anthropic
import json
import re
from typing import List, Dict

class TaskDecomposer:
    """Breaks complex tasks into actionable subtasks"""
    
    def __init__(self):
        self.client = Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))
    
    def decompose(self, user_request: str) -> List[Dict]:
        """Decompose a user request into structured subtasks."""
        prompt = f"""You are an AI assistant that excels at breaking down complex tasks.

User request: {user_request}

Decompose this into specific, actionable subtasks in logical order.

Respond ONLY with a JSON array, no other text:
[{{"id": 1, "description": "first subtask"}}, ...]"""

        response = self.client.messages.create(
            model="claude-sonnet-4-5",
            max_tokens=700,
            messages=[{"role": "user", "content": prompt}]
        )
        
        text = response.content[0].text
        # Extract JSON array from response (in case there's extra text)
        match = re.search(r'\[.*\]', text, re.DOTALL)
        if match:
            subtasks_data = json.loads(match.group())
        else:
            subtasks_data = json.loads(text)
        
        # Add status tracking to each subtask
        return [
            {
                "id": task["id"],
                "description": task["description"],
                "status": "pending"
            }
            for task in subtasks_data
        ]

Now let's use it:

In[12]:
Code
decomposer = TaskDecomposer()
request = "Plan my weekend getaway to the mountains."
plan = decomposer.decompose(request)

print("Task Decomposition:")
for task in plan:
    print(f"{task['id']}. [{task['status']}] {task['description']}")
Out[12]:
Console
Task Decomposition:
1. [pending] Determine travel dates and duration of the weekend getaway
2. [pending] Set a budget for transportation, accommodation, food, and activities
3. [pending] Choose specific mountain destination based on distance, weather, and preferences
4. [pending] Research and book accommodation (hotel, cabin, Airbnb, etc.)
5. [pending] Plan transportation method and book if needed (car rental, gas, flights, shuttles)
6. [pending] Check weather forecast for the mountain destination
7. [pending] Create packing list including weather-appropriate clothing, gear, and essentials
8. [pending] Research and list activities available (hiking trails, skiing, sightseeing, restaurants)
9. [pending] Make restaurant reservations if needed
10. [pending] Book any activities or tours that require advance reservations
11. [pending] Plan route and check road conditions or trail conditions
12. [pending] Prepare vehicle or arrange transportation pickup details
13. [pending] Pack bags with clothing, toiletries, medications, and activity gear
14. [pending] Download offline maps and save important contact numbers and confirmations

This gives us a structured plan that we can later execute. Each subtask has an ID (for reference), a description (what to do), and a status (to track progress).

Output might look like:

Task Decomposition:

1. [pending] Find mountain destinations within 2 hours driving
2. [pending] Check weather forecast for this weekend
3. [pending] Research lodging options at chosen destination
4. [pending] Book accommodation for Friday and Saturday night
5. [pending] Plan hiking or activities based on weather
6. [pending] Create packing list for mountain trip

Now our assistant has a concrete plan. In the next sections, we'll see how to actually execute these steps.

When Decomposition Goes Wrong

Task decomposition is powerful, but it's not foolproof. Let's look at some common issues and how to address them.

Too Vague

Sometimes the agent creates subtasks that are still too broad:

Bad decomposition:

1. Do research
2. Create content
3. Finish project

These aren't specific enough to guide action. You want concrete, actionable steps. To fix this, prompt for more detail or give examples of the level of specificity you want.

Wrong Order

The agent might list steps in an illogical sequence:

Bad decomposition:

1. Book flights to Paris
2. Decide where to go for vacation
3. Pack bags

Obviously, you need to decide where to go before booking flights. If this happens, you can either prompt the agent to reconsider the ordering or manually reorder the steps.

Missing Steps

The agent might overlook important subtasks:

Incomplete decomposition for "Host a dinner party":

1. Send invitations
2. Cook meal
3. Clean up after guests leave

What about planning the menu? Buying groceries? Setting the table? If you notice gaps, you can prompt the agent to expand its list or add missing steps manually.

The good news is that as models get better at reasoning, these issues become less frequent. And even when they occur, having some plan (even an imperfect one) is usually better than having no plan at all.

Connecting to What We've Learned

Task decomposition builds directly on the concepts we've covered in earlier chapters:

From Reasoning (Chapter 4): We learned that agents can think step by step using chain-of-thought prompting. Task decomposition applies this same idea at a higher level: instead of thinking through the steps to solve one problem, we're identifying the multiple problems that need to be solved.

From Tools (Chapter 5): When the agent breaks down a task, it can identify which subtasks need tools. "Research the client's industry" might require a web search tool. "Send a meeting invite" might require a calendar API. Decomposition helps the agent figure out what tools it needs and when.

From Memory (Chapter 6): As the agent works through a plan, it needs to remember what it's already done and what comes next. Task decomposition creates a structure that memory can track.

From State (Chapter 7): The list of subtasks becomes part of the agent's state. The agent knows "I'm currently on step 3 of 5" or "I've completed the first two subtasks and I'm waiting for user input before continuing."

Task decomposition ties all these pieces together. It's the bridge between understanding what the user wants and actually getting it done.

Looking Ahead

We've now seen how an agent can break down a complex request into manageable subtasks. This is the first and most crucial step of planning: figuring out what work needs to happen.

In the next section, we'll explore how the agent can execute this plan. We'll see how it can work through the subtasks one by one, using its tools and reasoning capabilities to complete each step, and how it can handle situations where things don't go quite as expected.

For now, remember this: when faced with complexity, the best first move is often to step back and break things down. Our assistant is learning to do exactly that.

Glossary

Task Decomposition: The process of breaking down a complex goal or request into smaller, specific, actionable subtasks. This makes large problems more manageable and ensures nothing important gets overlooked.

Subtask: An individual, concrete step within a larger task. Good subtasks are specific enough to be directly actionable and are arranged in a logical order.

Sequential Dependency: When one subtask must be completed before another can begin. For example, you must choose a destination before you can book a hotel there.

Parallel Tasks: Subtasks that can be completed in any order or simultaneously because they don't depend on each other. For example, checking the weather and checking your calendar can happen in any sequence.

Plan: An ordered list of subtasks that, when completed in sequence, accomplish a larger goal. The plan is the output of task decomposition.

Quiz

Ready to test your understanding? Take this quick quiz to reinforce what you've learned about task decomposition for AI agents.

Loading component...

Reference

BIBTEXAcademic
@misc{breakingdowntasksmastertaskdecompositionforaiagents, author = {Michael Brenndoerfer}, title = {Breaking Down Tasks: Master Task Decomposition for AI Agents}, year = {2025}, url = {https://mbrenndoerfer.com/writing/breaking-down-tasks-task-decomposition-ai-agents}, organization = {mbrenndoerfer.com}, note = {Accessed: 2025-12-25} }
APAAcademic
Michael Brenndoerfer (2025). Breaking Down Tasks: Master Task Decomposition for AI Agents. Retrieved from https://mbrenndoerfer.com/writing/breaking-down-tasks-task-decomposition-ai-agents
MLAAcademic
Michael Brenndoerfer. "Breaking Down Tasks: Master Task Decomposition for AI Agents." 2025. Web. 12/25/2025. <https://mbrenndoerfer.com/writing/breaking-down-tasks-task-decomposition-ai-agents>.
CHICAGOAcademic
Michael Brenndoerfer. "Breaking Down Tasks: Master Task Decomposition for AI Agents." Accessed 12/25/2025. https://mbrenndoerfer.com/writing/breaking-down-tasks-task-decomposition-ai-agents.
HARVARDAcademic
Michael Brenndoerfer (2025) 'Breaking Down Tasks: Master Task Decomposition for AI Agents'. Available at: https://mbrenndoerfer.com/writing/breaking-down-tasks-task-decomposition-ai-agents (Accessed: 12/25/2025).
SimpleBasic
Michael Brenndoerfer (2025). Breaking Down Tasks: Master Task Decomposition for AI Agents. https://mbrenndoerfer.com/writing/breaking-down-tasks-task-decomposition-ai-agents