In DeepSeek Harness (DSH) usage scenarios, the granularity of prompts directly affects the quality of model reasoning. Manually iterating on prompts repeatedly is not only time-consuming but also difficult to keep consistent. The dsh-prompt-optimizer plugin solves this problem by providing an “Optimize” entry directly in the send bar. It uses model routing to reuse the current session’s model for assisted rewriting. This plugin is maintained by Y1X1n, with thanks to Jerry for developing Mac support.
Core Features¶
- UI and Interaction: Adds an “Optimize” button (✨) to the right of the send bar. After clicking it, the optimization results stream to the screen segment by segment via SSE, without waiting for the full text to be generated. The panel provides a five-dimensional diagnostic view, displaying analysis results and the optimized draft in real time.
- Dual-Strategy Optimization: Automatically switches strategies based on the context. Without context, it uses structural template normalization (role/task/constraints, etc.); with context, it switches to extraction and polishing while preserving the original expression framework.
- Fidelity Discipline: Includes a built-in fidelity self-check to ensure semantic equivalence and traceability to the source. It prioritizes checking element completeness over length to prevent output drift.
- Context and Memory: By default, it carries the most recent 8 messages/1,600 characters from the current session as reference. It supports a lightweight memory chain, automatically continuing the previous round’s decisions when making further edits based on the optimization result.
- Safety and Isolation: When optimizing slash commands (such as
/goal), it automatically preserves the command prefix and does not break the command structure. The panel is isolated by session, so results do not interfere with each other after switching sessions.
Installation and Activation¶
- Prerequisite: The
dshCLI environment must be installed. - Installation command:
dsh plugin --profile web add @y1x1n/dsh-prompt-optimizer
Usage¶
- Click the “Optimize” button next to the send bar to analyze and optimize in one click.
- Configure the optimization model, mode (full/fast), timeout, and other parameters in settings.
- Use slash commands (such as
/goal) to optimize the body text without modifying the command prefix. - After optimization completes, click “Replace Input Box” or “Undo” in the panel.
Notes¶
- The dsh CLI environment must be installed.
- Compatible with DeepSeek Harness (dsh v0.1.5-rc.2+).
- For local installation on Windows, use the tarball format to avoid symbolic link issues.
- Context defaults to carrying 8 messages/1,600 characters.
- The output limit defaults to increasing automatically with input length (capped at 32,768).
- In fast mode, the result is considered compliant regardless of whether the model outputs markers.
Plugin address: GitHub