# Planning

> The Planning in AI agents is the step of breaking a goal into a sequence of subtasks before executing them.

## How do AI agents plan tasks?

The step where an agent analyzes the goal and creates a plan of subtasks, often as a to-do list, before acting. A visible plan can be reviewed by the user and helps the agent stay on track in long tasks.

- Topic: AI Agents
- Type: technique

## Example

Wrong:

```text
Plan:
1. Improve the app
2. Fix problems
3. Make it faster
```

Right:

```text
Plan:
1. Run the test suite and list failing tests
2. Fix the date parsing bug in utils/date.ts
3. Rerun the tests; all must pass
4. Measure page load and compare with the baseline
```

Each step in the better plan is concrete and checkable, so the agent knows when to move on or replan.

## Common mistakes

- Following an outdated plan after a step has failed.

## Key points

- The plan is a list of concrete steps that can each be checked as done.
- The plan is updated when a step fails or new information appears.
- Risky plans are shown to a person before execution.

## Interview questions

### Plan-and-execute vs ReAct?

Plan-and-execute writes the full plan first, then runs it. ReAct decides one step at a time. Many agents combine both and replan on failure.

### Should an agent always plan first?

For long or risky tasks, yes. For short tasks a plan adds overhead with little gain.

### Why do agents write plans to a file?

A written plan or to-do list survives a long context, keeps progress visible and lets a person review it.

## Related cards

- [Plan Mode](https://wonderium.dev/ai/plan-mode.md)
- [AI Agent](https://wonderium.dev/ai/ai-agent.md)
- [ReAct Pattern](https://wonderium.dev/ai/react-pattern.md)
- [Multi-Agent System](https://wonderium.dev/ai/multi-agent-system.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/planning
- Last updated: 2026-11-25
