dsh-global-system-prompt: Providing Editable Global System Prompts for DeepSeek Harness

Introduction

When doing multi-turn conversations or mounting multiple agent presets in DeepSeek Harness (dsh), you often want a piece of instruction that “takes effect regardless of which project or conversation is opened”—coding conventions, reply language, tool usage habits, and so on. If you only write it in a repository’s AGENTS.md, it won’t carry over when you switch directories or tools; if you manually paste it into every conversation, it’s easy to miss items and hard to maintain.

Products like cc-switch use a “global prompt” approach: a piece of user text that automatically enters the system prompt in every conversation. dsh-global-system-prompt connects similar capabilities to dsh, allowing direct editing in the Web settings panel; after saving, it takes effect in the next request without restarting the process (when only the prompt content changes). Below, we introduce what it is, how to install it, how to use it, and its relationship with the project AGENTS.md and the user’s global instructions file.

What Is This

dsh-global-system-prompt is a community-maintained dsh plugin (npm package name dsh-global-system-prompt, repository YMRwithNoworry/dsh-global-system-prompt), categorized as Workflow in the SkillHub directory. It maintains an editable piece of global text that takes effect through two channels:

  1. System prompt: Registered as an independent segment (default order: -900, placed right after the harness identity line and before the persona), carried by root sessions, agents mounted by presets, and in-process subagents; the segment name user:global-prompt will not be overwritten by a preset’s persona.
  2. Project AGENTS.md: Synchronizes the same body text to the AGENTS.md at the root of the session’s project (walking up to find .git), so that Claude Code, Codex, Cursor, Zed, etc. can read the same set of rules, and it can be committed with git.

The default prompt file is $DSH_HOME/global-prompt.md (i.e., ~/.dsh/global-prompt.md). The plugin can also optionally append the absolute paths of two files (the global prompt file and the user global instructions $DSH_HOME/AGENTS.md) at the end of the injected content, reducing situations where the model searches the disk for a “global AGENTS.md”.

Core Features

System Prompt Injection

  • The file is re-read every time a step re-renders; after saving, the next request carries the new content.
  • When the content does not change, the prompt prefix cache is not polluted; only this segment changes with edits.
  • If the file exists but the content is empty, the body is not injected (the file location note can still be appended according to configuration), serving as a temporary mute; if the file does not exist, the text from the configuration is used as a fallback (default empty).
  • The default UTF-8 injection limit is maxBytes: 65536 (64 KiB); anything beyond is truncated; the Web panel can view the actual injected byte count and a preview.

Sync to Project AGENTS.md

Written once at the start of a session, then rechecked at each step (low overhead when the content hasn’t changed). It maintains a marked block at the end of AGENTS.md, leaving the original content outside the block untouched; writing uses a temporary file followed by a rename to avoid reading half-written content. When the prompt is cleared, the block is removed; if the file was created solely by the plugin and has no other content, the file is deleted.

Web Settings Panel

Path: Settings → Global Prompt. You can edit, save, and re-read from disk; the panel displays the file path, segment order, project sync status, and a preview of the “block written to the project”. The dsh Desktop allows saving by removing cross-site Origin, avoiding 403s on the desktop.

Division of Labor with Presets and Other Plugins

  • External CLI subagents (such as Codex, Claude Code) have their own prompts and are not affected by this plugin’s system prompt channel.
  • The plugin does not write to $DSH_HOME/AGENTS.md (that is the user global instructions for dsh and dsh-global-rules); it only declares its location in its path note.
  • Within a dsh session, the same set of rules may appear both in the system prompt and be read into the context by dsh-agent-instructions-like contexts via the workspace AGENTS.md—the former is the dsh real-time channel, the latter is the cross-tool channel; if you don’t want to leave traces in the project, you can disable syncProjectAgents.

Installation and Activation

For official installation, use npm. The package name must be dsh-global-system-prompt; there is an unrelated package dsh-global-prompt on npm, do not install it by mistake.

Web panel profile:

dsh plugin --profile web add dsh-global-system-prompt

For TUI only, without a Web server (injection and project sync still available):

dsh plugin --profile dsh-tui add dsh-global-system-prompt

Install from GitHub or pin a commit:

dsh plugin --profile web add github:YMRwithNoworry/dsh-global-system-prompt

dsh plugin --profile web add github:YMRwithNoworry/dsh-global-system-prompt#<commit-sha>

dsh plugin add adds the package to the profile’s dependencies and appends packages that declare dsh.bundle to dsh.profile.bundles. Adding a new bundle is a startup boundary; after installation, you need to restart dsh once; after that, changing only the prompt content does not require a restart.

After installation, you can first verify whether the configuration is merged (PowerShell example):

dsh --profile web --dump-config | Select-String -Context 0,8 'global-system-prompt'

You should see # == dsh-global-system-prompt and lines like id: global-prompt.

The current npm version is 0.3.2 (subject to package.json), license MIT, runtime environment requires Node >= 22.19.0. The plugin executes within the local dsh process; please review the repository source code and license yourself before installing.

Typical Usage

  1. Install the plugin for the web or dsh-tui profile using the command above, then restart dsh.
  2. Open the Web panel: Settings → Global Prompt, write the rules into the text box (e.g., uniformly use Chinese, commit conventions, forbid unsolicited large-scale refactoring), and save.
  3. Start the next conversation; the current already-sent turn will not change.
  4. You can also directly edit ~/.dsh/global-prompt.md, then click “Reload” in the panel.
  5. If you want the rules to enter git and be available to non-dsh tools, keep the default syncProjectAgents: true, and check the block marked with BEGIN dsh-global-system-prompt in AGENTS.md at the root of the session’s project.

The block form in the project file (body consistent with the global prompt, paths depend on the local machine):

<!-- BEGIN dsh-global-system-prompt -->
<!--
  Managed by the dsh-global-system-prompt plugin. The rules below are synced from:
  (absolute path of global-prompt.md)
  Edits inside this block are overwritten on the next sync; delete the block,
  markers included, to stop syncing.
-->

Global rules — follow these in every task in this project:

(Original text of the global prompt)

<!-- END dsh-global-system-prompt -->

Configuration Notes

The default configuration is in the package’s cordis.patch.yml, with the segment id as global-prompt. When overriding by id in the profile’s ~/.dsh/profiles/<name>/cordis.patch.yml, the patch will entirely replace the config of that line, and all fields must be written out.

Field Default Meaning
enabled true Master switch; when false, the segment is not registered and the project AGENTS.md is not written (the panel route still exists)
file $DSH_HOME/global-prompt.md Prompt file
order -900 Segment order; smaller means earlier
text '' Fallback only when the prompt file does not exist
maxBytes 65536 UTF-8 byte limit for injection
escapeBraces true Escape {{ in the system prompt channel; does not affect the original text written to the project
announcePaths true Append the absolute paths of both files at the end of the injection
syncProjectAgents true Whether to sync to the project AGENTS.md
projectAgentsPreamble Global rules — follow these in every task in this project: Leading instruction line of the project block; if '', only the body remains

Common combinations: syncProjectAgents: false to keep only the system prompt; announcePaths: false to remove the path note; enabled: false to disable the entire plugin.

Use Cases and Notes

Suitable for: Needing “user global rules” that remain fixed beyond the persona in all dsh sessions; wanting the same set of rules synced to the project AGENTS.md for multi-tool collaboration and version control; wanting the model to clearly know the paths of global-prompt.md and $DSH_HOME/AGENTS.md.

Notes:

  • The plugin reads and writes files and the project directory with the permissions of the current dsh process; please review the GitHub repository source code and MIT license before installing.
  • If the project AGENTS.md exceeds 1 MiB, the markers are manually corrupted, or an IO failure occurs, the plugin logs a warning and keeps the original file; system prompt injection continues.
  • If the project root resolves to $DSH_HOME/AGENTS.md, the plugin skips writing and warns.
  • The DeepSeek Harness ecosystem emphasizes “everything is a plugin”; the SkillHub plugin directory is a community site, with no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-global-system-prompt uses an editable piece of global text that enters both dsh’s system prompt in every turn and the session project’s AGENTS.md, maintained centrally in the Web panel. After installing the package, restart dsh once to start using it; after that, changing words and saving takes effect in the next conversation turn.

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

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

Xiaoye