Documentation › Replanning
A step in feature mode can reveal that the rest of the plan is wrong. During any step phase Claude may write {attempt_dir}/replan.md explaining what is wrong with the remaining plan and proposing a change (the step instructions describe this; see Review attempts for {attempt_dir}). The Stop hook looks for it before running the phase check:
feature.replan: "stall"(default): the run stalls. Read thereplan.mdthe message names, optionally edit the pending or active steps inrun/steps.json, then run/sl-go. The engine validates the file (schema plus the steps file protection rules againstapprovedSteps) and refuses with the errors if it fails, changing nothing. Otherwise it stores the new plan, archives the request torun/replans/replan-N.md, and restarts the current step atfeature.stepInitialPhasewith the iteration counter reset. If you removed the current step, the next pending step starts instead (or the run completes when none remain).feature.replan: "auto": the engine entersfeature.replanPhase(defaultfeature-replan, defined infeature.planPhases, delegated, edits limited torun/, instructions inphases/feature-replan.md). A planning subagent rewrites only pending or active steps. The gate is thestepscheck (withoutrequireAllPending) plus the steps file protection rules; when it passes, the engine continues as in the stall case. At mostfeature.maxReplansauto-replans run per run; a request beyond the cap stalls with a message saying so.
A step restarted by escalation on stall is restarted the same way: at feature.stepInitialPhase, with the iteration counter reset and the working tree kept.
The current step’s uncommitted work stays in the working tree either way; the engine never stashes, resets or checks out. /sl-advance in the replan phase adopts the current steps.json if it passes the same checks.
Configuration Keys
| Key | Default | Meaning |
|---|---|---|
feature.replan |
"stall" |
What a replan.md request does: "stall" for the user, or "auto" to run the replan phase. |
feature.replanPhase |
"feature-replan" |
Phase (in feature.planPhases) that rewrites the remaining steps in "auto" mode. |
feature.maxReplans |
3 |
Auto-replans allowed per run; later requests stall. |
See Also
- Feature mode: the step cycle that a replan restarts.
- Guard rails: the rules a replanned
steps.jsonmust satisfy. - Phases: the
stepscheck type. - Quality gates: a
steps: "last"gate moves to the new last step.