Dismiss

New here? Start the Builder path.

Home · Agents · 06 · Planning

Concept card · Agents

Planning

What this gets you. Decide when your agent writes a plan first, and when it changes the plan.

Planning is breaking a job into steps before or during an agent's run. The steps can be fixed in your code, written by the model before it starts, or kept as a list the agent updates as results come in.

Last checked 2026-10-28 5 min

Search for Planning

What changed

Oct 28: First card. A worked example writes a plan for one support ticket, then changes it after a result.

See who writes your agent's plan, how to check it before it runs, and when to change it.

1 What it is

On Agent loop, the model picks the next step each turn. Planning is the bigger picture: the steps for the whole job. There are three ways to hold them.

  • Fixed steps in your code. Anthropic's Building effective agents calls this a workflow: AI models and tools run through predefined code paths. It suits a job you can split into fixed steps.
  • A plan the model writes first. The model lists the steps, your code runs them, then the model checks the plan again. LangChain's Plan-and-Execute post calls this re-planning: finish, or write a follow-up plan if the first one didn't work.
  • A list the agent keeps updating. Anthropic's context engineering guide gives a to-do list as a way to track progress across dozens of tool calls.

Whichever you pick, the plan is a guess made before the results. Each result can change it.

From Agent loop: who picks the next step, and who runs the tool?

Show the answer

The model picks the step. Your code runs the tool and sends the result back.

Example: made up to show the idea.

The Support assistant from Agent loop, with the same three tools: search the docs, look up an account, file a ticket. A customer writes: 'My export is missing attachments.' The model writes a plan before any tool runs.

Step Plan before the run After step 2
1 Search the docs: "export attachments" · read Done. export.md: "Attachments are not included in the CSV."
2 Look up the account · read Done. Ticket #4127 about this is already open
3 File a ticket · acts, waits for a person's OK Dropped. A ticket is already open
4 Reply with the new ticket number Reply: cite export.md and give ticket #4127

Step 2 changed a fact the plan relied on, so the plan changed. The step it dropped is the one that would have filed a second ticket.

2 Why it matters

Show why it matters

Cost

Picking one step at a time costs a model call for every tool call. LangChain's post says that with a plan written first, the larger model is called only to plan, re-plan and write the final reply.

Risk

Small mistakes add up over many steps. Anthropic's Building effective agents warns of compounding errors, and recommends showing the agent's planning steps. A plan you can see is a plan a person can check before anything acts.

How much plan does this job need?

The job Use
Same steps every time, in the same order Fixed steps in your code
One lookup, or a few steps that each depend on the last answer The loop alone: Agent loop
Many steps you can name at the start A plan the model writes first, checked after each result
A long job where the steps change as you learn A to-do list the agent updates
Any step that files, sends, pays or deletes Show the plan; that step waits for a person: Permissions & human sign-off

3 How to apply · try today

Take one task your agent runs in more than three tool calls. Before it runs, have it write its steps as a numbered list, each marked read or act. After each result, ask: is the next step still right? Then compare the list with the trace.

Common mistake

Following the first plan to the end after a result shows it's wrong. A plan is written before the results. Check it after each one, and drop the steps that no longer fit.

Self-check

Every refund request goes through the same four steps, in the same order. Who should set the steps?

Self-check

Step 2 returns: 'Ticket #4127 is already open.' Step 3 is 'File a ticket.' What next?

Self-check

A run is 30 tool calls in. Where should the plan live so it isn't lost?

Want the why? Understand it · 5 min, optional

Questions

What is planning in an AI agent?
Planning is breaking a job into steps before or during an agent's run. The steps can be fixed in your code, written by the model before it starts, or kept as a list the agent updates as results come in.
Isn't the agent loop already planning?
It plans one step at a time: each turn, the model picks the next step. Planning here means the steps for the whole job, written in your code, by the model first, or as a list it updates.
When should an agent change its plan?
When a result changes a fact the plan relies on, such as a ticket that's already open. Not when text in a result asks for new steps: that's prompt injection.

Next card: Prompt injection →