Planning is useful until the plan costs more than the task: each planning round is another model call, and a plan with twenty steps is a plan nobody will follow. CrewAI’s planning configuration caps the plan at a maximum number of steps, with a default of twenty, and caps replans as well. Set your own cap lower for ordinary work: five to seven steps is enough for most tasks, and anything longer should be split into two tasks instead of one longer plan.
What you need
- A task you have already planned once, with the step count noted
- The number of model calls the planning took, if you can read it from the log
- A cap you are willing to enforce, for example seven steps
Step 1: Count the steps in the current plan
Open the plan the agent produced and count its steps. If it has more than your cap, the plan is overplanned for the task.
Step 2: Set the step cap and merge small steps
Set the maximum steps to your cap, and merge steps that only differ in wording into one step with a clear done condition. Steps that cannot merge are a sign the task should be split.
Step 3: Re-run and compare the cost
Run the task with the capped plan and compare the model calls and the result with the earlier run. A good cap keeps the same result with fewer planning calls.
Worked example: synthetic plan cap check
The table below is a synthetic example. It shows the expected result of capping the plan; no agent was run.
| Check | Before cap | After cap |
|---|---|---|
| Steps in plan | 18 | 6 |
| Planning model calls | 5 | 2 |
| Result still correct | Yes | Yes |
| Steps merged, none dropped | n/a | Yes |
Expected result (UNTESTED). the plan drops from 18 steps to 6 with the same correct result and fewer planning calls. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- A cap that is too low forces the agent to skip needed steps, so watch for missing work after capping.
- Merging steps hides detail; keep the done condition for each merged step.
- The cap is per plan, so a task split in two gets two caps, not one.
- Planning cost is only visible in the run log, so check the log rather than guessing.
