dsh-session-instructions: Writing Persistent Instructions into the Top-Level System Prompt

Introduction

When collaborating with agents in DeepSeek Harness (DSH), there are rules you state once—such as outputting documents must include file cards, replying in a specific language by default, or not pushing to main without confirmation. If these rules only appear in a single round of user messages, as the conversation gets long and the context is squeezed, the model may not reliably execute them.

A more common practice is copying these rules every time a new topic is started, or stuffing long background information into a single message and hoping for the best. The dsh-session-instructions plugin (maintained by borncode-app) takes a different approach: it maintains a set of “persistent instructions” in the Web GUI and reads them into the very beginning of the system prompt before every request, ensuring essential delivery agreements travel with every call.

This plugin is categorized as “Memory” in SkillHub. The standalone repository borncode-app/dsh-session-instructions still has a link available, but the README notes that the BornCode series of plugins has migrated to a monorepo borncode-app/dsh-borncode, with the corresponding path being packages/dsh-session-instructions; for new installations, it is recommended to install the dsh-borncode bundle as a whole, rather than maintaining multiple old repository entries separately.

Plugin Overview

dsh-session-instructions does only one thing: it reads the persistent instructions saved by the user in the Settings → General → Instructions text box and contributes them to the top of the system prompt before every round of work. It does not expose tools, initiate network requests, or rely on timers; implementation-wise, it is “an HTTP endpoint + a prompt injection”.

The license is MIT (version 1.0.0 in package.json). Requirements: DeepSeek Harness 0.2.x (Web GUI), Harness comes with Node 24. Platforms supported: Windows, macOS, Linux.

Core Mechanism

Below is an explanation of the data flow describing how the plugin turns the text in settings into effective instructions for every round.

  1. User edits and saves the text in Settings → General → Instructions.
  2. Web GUI writes to the plugin’s persistent state via PUT (saved in the plugin’s state.json).
  3. When assembling the system prompt for every request, the plugin inserts this text at the very beginning, rather than appending it after the long conversation.

Therefore, it does not take up the “recency” of user messages, and when the context gets tight, it is not part of the information likely to be dropped first. The README also reminds that persistent instructions are counted as tokens every round, so they should be short and contain hard rules; long background is better placed in skill files like SKILL.md, rather than stuffing the Instructions box.

Key Features (Consistent with README)

  • Always first: Fixed at the top of the system prompt, not after a long conversation.
  • GUI Editable: Changing the text requires no code changes or patching, and no separate restart is needed for wording changes (the first install requires a restart per Harness requirements to load the bundle).
  • Persistent: Stored in state.json, so written rules are not easily overwritten when upgrading Harness or pulling the plugin directory.
  • Length Limit: Default maxLength is 20,000 characters to prevent accidental pasting of huge paragraphs that would incur costs every round.
  • Interface Language: locale/ provides English, Thai, and Chinese.

Configuration

In advanced scenarios, you can adjust the following fields in the plugin configuration (defaults are used if unchanged):

field default meaning
endpoint /plugins/session-instructions Path for the Web GUI to read/write instruction text
maxLength 20000 Maximum number of characters accepted

Installation and Activation

Source code and history are maintained in the monorepo dsh-borncode; if you have already obtained the plugin directory (containing the cordis.patch.yml bundle) from that repository, the typical way to install the bundle on the Harness side is:

plugin_manager install_bundle target=C:\path\to\dsh-session-instructions

Change target= to the actual directory on your machine. If you are installing the entire BornCode collection, follow the instructions in the dsh-borncode repository (replacing individual old repositories). The standalone repository page is kept for legacy links to still be readable.

After installation, restart Harness once, open Settings → General → Instructions, and write the rules you want the model to follow every round.

Security and Permissions: The plugin runs under the current DSH process permissions and only processes the instruction text you write and the local state.json. Before installation, it is recommended to review index.js, client.js, and the license file to confirm they meet your compliance requirements.

Typical Usage Examples

The Instructions box is suitable for writing short, absolute, and executable rules, rather than a project encyclopedia. Examples from the README include:

  • If outputting documentation, must include file cards.
  • Always answer in a specific language (e.g., Thai).
  • Do not push to main without explicit request.

After saving, there is no need to repeat this in every round of user messages; subsequent rounds will show the same content at the top of the system prompt.

Code Structure (For Self-Audit)

file role
index.js Host role: endpoint, persistence, prompt contribution
client.js Settings page UI
cordis.patch.yml Bundle patch inserting the host role
locale/{en,th,zh}.json Interface text
icon.svg Plugin icon
test/smoke.mjs Build-time smoke check

Applicable Scenarios and Notes

Suitable for: Harness users who need to stably execute the same set of delivery constraints across multiple conversation rounds; users with few rules, clear wording, and who are willing to pay a fixed cost for tokens every round.

Not suitable for: Large chunks of project background, frequently changing long documents—these should be handled using skill files or combinations of other memory-type plugins, rather than using Instructions as a knowledge base.

Ecosystem Note: DSH advocates “everything is a plugin”; the SkillHub Directory Page is a community directory site and has no official affiliation with DeepSeek / 幻方. Installation and auditing responsibilities lie with the user.

Conclusion

dsh-session-instructions puts “once-said, never-forgotten” persistent instructions at the top of the system prompt, using GUI + state.json for persistence to avoid rules from sinking into the context with single messages. For reference and installation, please refer to the repository and directory page:

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye