Preface

In the development of DeepSeek Harness (DSH), agents often face a posture-mismatch problem: either over-planning on tasks that require single-line answers, or improvising in refactoring tasks that require rigorous planning. The “dogma” in the resident system prompt becomes diluted as conversation turns increase, turning into “wallpaper” that the model no longer reads.

The DSH plugin dsh-mode provides a mechanism: at the moment of switching, it injects the methodology corresponding to the phase through the switch_mode tool, guiding subsequent work, rather than writing it as a permanent rule into the system prompt.

What Is This?

dsh-mode is a DSH plugin maintained by xiyiyiru and belongs to the workflow category.

It provides a set of stateless work-mode switching tools. The core value of the plugin is that, at points where the working posture needs to change, it delivers specific methodologies via tool calls, rather than making global changes at the system prompt level. Since 0.1.0-rc.6, the tool no longer modifies the system prompt and does not write session events.

Core Features

The plugin mainly includes the following capabilities:

  1. Mode switching tool: Provides the switch_mode tool, supporting switching among five preset modes.
  2. API exports: Provides exported APIs such as MODES and CORE_BEHAVIOR, allowing developers to retrieve mode definitions and core behavior principles.
  3. Stateless design: The tool itself is stateless; it does not modify the system prompt, does not re-inject content, and does not carry snapshots.
  4. Core behavior principles: Contributes a static section mycel:core-behavior (order 10) to the system prompt, defining a set of mode-agnostic underlying working principles (such as prioritizing root cause over action and treating uncertainty honestly).
  5. Idempotency: Switching to the same mode re-reads the corresponding methodology, serving as a recovery path.

Installation and Enablement

Install it through DSH’s plugin manager; dependencies are resolved automatically.

dsh plugin --profile <name> add @xiyiyiru/dsh-mode

Typical Usage

The return value of the switch_mode tool includes the methodology text for the current mode. After receiving the result, the model adjusts its subsequent behavior according to that text. Common switching scenarios include:

  • planner mode: Switch when the goal requires a fully decided plan. The executor receiving the plan will not make further decisions.
  • analyst mode: Switch when judgment, root-cause analysis, or impact assessment is needed. This mode focuses on adjudicating facts, collecting evidence, and stating impact, without directly fixing the issue.
  • explorer mode: Switch when handling unfamiliar code or performing read-only reconnaissance. It focuses on producing structure, responsibilities, and critical paths, without touching code.
  • executor mode: Switch when the plan has been approved and only execution steps remain. Execute strictly according to the plan, exposing vulnerabilities in the plan rather than silently improving it.
  • base mode: The default posture, used for direct answers without complex rituals.

Applicable Scenarios and Cautions

This plugin is suitable for scenarios that require dynamically adjusting the agent’s thinking mode during a conversation flow.

Cautions:

  1. Statelessness and logging: Since 0.1.0-rc.6, switching operations are not written to session events and rely on the logging system for tracking.
  2. System prompt: The plugin does not modify the system prompt and does not re-inject mode content when reverting or in subsequent turns.
  3. Decoupling: Since 2026-09-03, the plugin has been decoupled from the task stack of state plugins.
  4. Dependencies: peerDependencies are resolved automatically; ensure the environment meets version requirements before installation.
  5. License: MIT License.

Conclusion

dsh-mode solves the problems of resident prompt dilution and posture mismatch by injecting methodologies at switching points. It turns mode switching into an explicit tool call, keeps the system prompt clean, and provides targeted mental guidance for agents at different stages.

Plugin directory and source code:
https://www.skillhub.cn/plugins/xiyiyiru/dsh-mode
https://github.com/xiyiyiru/dsh-mode