description: "Plan mode for users and maintainers choosing, configuring, or debugging the per-agent planning feature with deployment guidance, a /plan command, and a user-reviewed exit."
English | 中文
Plan mode asks an agent to explore and design before execution, then presents the finished plan for your approval. Enter it with /plan, optionally with a message or ordered image and file attachments; leave with /plan off, approve the review to continue, or return feedback for more planning. Deployment-defined guidance controls planning behavior, but every tool remains available, so use sandbox mode and approval prompts for enforced limits. The active state survives session resume and forks. Choose it when you want a reviewed plan before the agent acts.
When plan mode is active, the agent works under your instructions and presents its plan for review instead of executing right away. The common path: configure the guidance text, enter plan mode with /plan, and review the finished plan when the agent calls exit_plan_mode.
Choose plan mode when the agent should explore and design before executing and you want to approve the plan first. It does not restrict the agent: every tool stays callable, so use sandbox mode and approval prompts when you need enforced limits. Skip it when the agent should act on your requests immediately, without a planning phase.
The only required configuration is the guidance text the agent follows while planning; anything else you add fails at load.
- name: '@deepseek-ai/dsh-plan-mode'
config:
section: |
You are in plan mode. Explore and design before presenting the complete
plan through exit_plan_mode.
| Field | Default | Meaning |
|---|---|---|
section |
required | Guidance rendered as the plan:policy prompt section while plan mode is active |
The generated configuration catalog is the exhaustive source for every accepted field and its JSDoc.
Type /plan to enter plan mode, or /plan <message> to enter with an instruction — the message becomes your next request under plan guidance. Type /plan off to leave plan mode directly; it also cancels a plan-mode entry that has not taken effect yet.
You can attach images and generic files to a /plan message, and they are included with your instruction in selection order. /plan off with attachments is rejected before the mode changes, so the draft and cards remain available. The /plan command is available wherever slash commands are supported, such as the Web client.
When the agent has a finished plan, it calls exit_plan_mode with the plan written as markdown and starting with a heading. You review that exact plan and choose Approve to leave plan mode, or Keep planning to send the agent back with feedback.
Choosing Keep planning (optionally with free-text feedback) sends the agent back to revise the plan; closing the review to type a message instead tells the agent to wait for your next message. If no interactive review is available, exit_plan_mode cannot run and you can still leave plan mode with /plan off.
Interfaces can show whether plan mode is active and whether a mode change you requested is still waiting to take effect. The state is the same in every tab and survives restarts.
Read these pages when the package-level contract is not enough. They move from the subsystem semantics to the generated catalogs and the design decision.
While plan mode is active, the model sees the deployment's exact section text at first-party prompt order 500; inactive mode contributes no text.
You are in plan mode. Explore and design before presenting the complete plan through exit_plan_mode.
Inactive mode adds no tokens; active mode adds the configured section to every request.
The section is stable within plan mode, but entering or leaving changes the system prompt from first-party order 500 onward.
/plan, /plan off, and their terminal results stay outside model history. A non-empty suffix other than the exact off argument becomes one user message through agent.steer() after plan mode is selected: admitted image and file blocks in selection order, then the trimmed text block. Bare /plan with admitted attachments steers one user message containing only those blocks. An active /plan off selection contributes the standard logged user-switch notice only when the last request header described plan mode; cancelling a pending entry contributes none because no request observed it.
The optional message costs the same history tokens as submitting that content separately. Bare /plan without attachments and /plan off add none; bare /plan with attachments has the normal image and file-handle cost. A narrated active exit adds the small retained switch notice.
The user block is append-only conversation growth. Entering or leaving plan mode changes the earlier policy section; a narrated exit notice is appended after the reusable request prefix.
The exit_plan_mode schema remains available in both states; execution outside plan mode fails, while an approved in-mode review returns the canonical { approved: true } value and renders the existing confirmation text. Rejection remains a failed call carrying review feedback, and a dismissed review a failed call naming the user's takeover.
The stable schema is paid according to ToolRuntime mode, and each plan argument and review result remains in conversation history.
Mode transitions do not change the tool catalog; plan arguments and review results extend the conversation normally.
These limits describe when plan mode does not behave as you might expect or needs extra care. They are current package constraints, not a roadmap.
exit_plan_mode call and is told to include the unresolved decision in its final result; durable fork lineage alone does not prevent a session resumed as a runtime root from opening the review.plan-review presentation; another interaction provider presents the same request through its generic option flow.