Introduction

In daily use of DeepSeek Harness (DSH), drafts written directly in the input box are often not specific enough or may contain vague references (such as “this” or “continue”). prompt-optimizer-plugin is a DSH plugin that uses the current model to read the conversation context, rewrites the input draft to make it clearer and more specific, and automatically fills it into the input box.

Installation

Before installing, ensure pnpm is installed on the system. The installation steps are as follows:

  1. Install pnpm (one global installation is sufficient):
npm install -g pnpm
  1. Install the plugin:
dsh plugin --profile web add github:naitoupi/prompt-optimizer-plugin
  1. Restart DeepSeek Harness:
dsh web

Features and Usage

The plugin provides a “✨ Optimize” button next to the input box. To use it, first write a draft in the input box and click the button. The plugin rewrites the draft and automatically fills it into the input box. The original text before optimization is displayed above for reference (it is not included when sending). If you are not satisfied, you can click “↩ Undo” to restore the original text.

Core capabilities include:
* Reading context: It parses the most recent messages in the current conversation (defaults to the last 12 messages, up to 4000 characters), the conversation topic, working directory, and Agent preset to resolve ambiguous references.
* Auto-fill: The optimized prompt is directly filled into the input box and can be sent immediately.
* No history pollution: The optimization process is sent only to the current model and does not inject optimization instructions or the process into the chat history.

Context Reading and Parameters

When rewriting, the plugin reads the following content as background, but does not copy it verbatim into the prompt:
* Included items: recent conversation text (message text, not tool calls), conversation topic, working directory, and Agent preset.
* Excluded items: tool calls and results, the model’s reasoning/thinking process, DSH-injected system reminders, images and attachments.

The default parameters are optimally configured under “Settings → Prompt Optimization”:
* Thinking strength: off
* Max output: 1500
* Temperature: 0.1
* Context length: 4000 characters

Settings and Privacy

In DSH’s “Settings”, the last item in the left navigation bar is “Prompt Optimization”. You can disable/enable the plugin here, or adjust generation parameters and optimization instructions. All settings are stored locally: ~/.dsh/prompt-optimizer-state.json.

Regarding privacy, the content read during optimization is sent only to the same model currently used in the conversation and does not pass through any third-party server.

Conclusion

This plugin aims to reduce the time spent manually adjusting prompts by automating the optimization process. For more details and source code, please visit its GitHub page.