Introduction¶
When performing complex tasks in DeepSeek Harness (dsh), the official @deepseek-ai/dsh-plan-mode already provides plan mode’s state machine, /plan command, and the exit_plan_mode review flow. However, entry is mostly driven by user input or text guidance, and during the planning phase, write-type tools still rely on model self-discipline. If you are familiar with the ZCode open-source implementation’s approach—“model proactively enters plan mode + hard read-only enforcement + four-phase workflow”—you may want a similar enhancement on the dsh side without replacing official components. The following introduces the community plugin dsh-plan-mode-plus (maintained by shuxidemosheng). It adds three key features on top of the official plan projection while preserving the official exit flow and UI.
What This Is¶
dsh-plan-mode-plus is a workflow-type plugin in the DSH ecosystem. Directory page: skillhub.cn/plugins/shuxidemosheng/dsh-plan-mode-plus, source code: github.com/shuxidemosheng/dsh-plan-mode-plus. In one sentence: it extends the official plan-mode state machine (plan/mode events + plan projection) to align with ZCode’s plan mode form—adding the enter_plan_mode tool, hard enforcement during planning, and a four-phase workflow prompt section. Exiting still uses the official exit_plan_mode; /plan / /plan off and the blue Plan chip in the composer remain unchanged.
Core Features¶
1. enter_plan_mode Tool¶
When the model determines a task is non-trivial, it can request to enter plan mode immediately without parameters. This corresponds to ZCode’s EnterPlanMode. This plugin aligns with ZCode’s implementation: no user approval is required for entry (it’s reversible via /plan off), and the official plan/mode event is appended immediately in the current step rather than queued for the next step.
2. Hard Enforcement (Read-Only Enforcement)¶
When plan mode is active, write-type tools configured in denyTools are directly rejected by ctx.tools.guard() before dispatch. The rejection message matches ZCode:
Plan mode only allows read-only, non-destructive tools
The default deny list aligns with ZCode’s destructive tool naming: bash, pwsh, write, edit, str_replace_editor. Setting enforce to false reverts to the official “pure guidance” behavior, retaining only the tools and prompt sections.
Allowed tools align with ZCode’s read-only classification: read / read_image / glob / grep, web_search / web_fetch, todo_write, ask_user_question, skill, present, goal series, subagent, send_message / interrupt_agent, and all MCP tools. For stricter deployments, you can add subagent, subagent_fork to denyTools to prevent subagents from writing on your behalf.
3. Four-Phase Workflow Prompt¶
The plan:workflow-plus section is rendered only when plan mode is active: Explore → Design → Review → exit_plan_mode. The mechanism is identical to the official plan:policy (conditional system prompt section; returns empty string when inactive).
4. Client-Side “Plan Mode” Capsule Button (Web)¶
The session title bar now includes a capsule button: clicking it when plan mode is off executes /plan to enter; when on, it highlights and clicking executes /plan off to exit; during the transition queue, it displays “Applying…”. This complements the official Plan chip: the chip handles active indication and exit, while this button provides one-click entry.
Relationship with Official Plan Mode¶
- State machine fully reuses the official one: no new event types are added; once the
planprojection isactive=true, the officialplan:policy,/plan off,exit_plan_mode, and UI chip are synchronized. - Read state:
sessionProjections.stateOf(session, 'plan'); this plugin does not touch theplanModeservice instance, relying on the global projection and session logs. Host plane registration applies to all sessions. - Presets without official plan-mode (e.g., some headless environments): if
stateOfisundefined, tools, guard, and prompt sections automatically become inactive, without causing session creation failures.
Installation and Activation¶
The plugin runs with the current dsh process permissions; review the source code and MIT License before installation. The community directory SkillHub and DeepSeek / High-Flyer have no official affiliation; installation commands follow the repository’s README.
Desktop version (Git Bash, fully quit DeepSeek Harness main program first):
ELECTRON_RUN_AS_NODE=1 "/d/DeepSeek Harness/DeepSeek Harness.exe" \
--expose-internals \
"D:/DeepSeek Harness/resources/app.asar/dsh/node_modules/@deepseek-ai/dsh-desktop-host/lib/cli.js" \
plugin --profile desktop add dsh-plan-mode-plus
After add, you can also append a local tgz (file:D:/.../dsh-plan-mode-plus-x.y.z.tgz) or a Git repository address. Restart the main program after installation.
Configuration¶
The default configuration is injected via the insert line in the plugin-bundled cordis.patch.yml; you can override it at the profile layer ~/.dsh/profiles/<name>/cordis.patch.yml with the same id, or directly edit the bundled line. Unknown configuration keys will cause an error on startup.
- insert:
- id: plan-mode-plus
name: dsh-plan-mode-plus
config:
enforce: true # false = only keep tools and prompt sections, no hard enforcement
denyTools:
- bash
- pwsh
- write
- edit
- str_replace_editor
Typical Usage¶
- After installing and restarting dsh, in sessions supporting official plan-mode, the model can call
enter_plan_mode(without parameters) at the start of a complex task. - After entering, attempting to call
bash,write, or other deny tools should be rejected by the guard, returning the above ZCode original message; read-only tools and MCP remain available. - The system prompt will display the four-phase workflow; after planning, still use the official
exit_plan_modeto go through the Approve / Keep planning review UI. - In addition to the official Plan chip, the web client can use the title bar capsule for one-click
/planentry or/plan offexit.
The repository’s verified scenarios include: headless (plugtest) end-to-end (entry, enforcement, four-phase titles referenced); web (plugweb) title bar button and chip synchronized with the projection.
Use Cases and Considerations¶
Suitable for: Teams or individuals who want ZCode-like planning discipline in dsh—model can proactively enter plan mode, write operations are hard-blocked during planning, and workflow prompts coexist with official policy.
Considerations:
- peerDependencies lock to
@deepseek-ai/*0.2.0-rc.2 (developer preview); after upgrading the host, synchronize verification of the plugin. - Build requires Node ≥ 24; if building from source:
pnpm install/npm install,npm run build,npm pack. - When
enforce: false, behavior is close to the official “Guidance, not enforcement”; hard enforcement is an active plugin enhancement, occurring before dispatch, without modifying the tool catalog. - Subagent sessions are independent:
enter_plan_modeonly affects that subagent session, not the parent session (this intentionally deviates from ZCode’s design of removing plan tools from the subagent tool surface).
Conclusion¶
dsh-plan-mode-plus enhances the official plan-mode by adding model-initiated entry, hard read-only enforcement during planning, and a four-phase workflow, without altering the official exit and UI. It is suitable for users who want to align dsh plan mode with the ZCode reference implementation. For details and installation instructions, see the SkillHub directory page and GitHub repository.