Introduction¶
The DeepSeek Harness instruction chain is injected on a session’s first request. The outermost layer consists of two user-global files: $DSH_HOME/AGENTS.md (typically ~/.dsh/AGENTS.md) and <agentsHome>/AGENTS.md. These files define general behavioral conventions for each session, but they currently lack a graphical interface: users must edit the files directly, which is error-prone (easily mistyped paths), and there’s no visibility into the byte budget—exceeding the limit results in the harness silently truncating the content. This plugin adds a settings page for that file, making locating, editing, budgeting, saving, and clearing all available through a visual interface.
What It Is¶
dsh-windows-agents is a DeepSeek Harness plugin maintained by LXMH1982. It leverages DSH’s settings partition and configuration forms to manage the content of $DSH_HOME/AGENTS.md within the settings page. It does not handle prompt injection or modification; it is solely responsible for writing editor content to disk. When the file content diverges from the UI, the file takes precedence and is imported into the interface to prevent manual edits from being overwritten. The plugin targets the DSH Web client, depends on @deepseek-ai/schemastery, and adds a “Personalization” section to the settings upon installation.
Core Features¶
- Edit user-global instructions: A large monospace-font editor whose content maps directly to
$DSH_HOME/AGENTS.md. - Byte budget display: Real-time display of “current bytes / 65,536 bytes”, calculated in UTF-8, consistent with the harness instruction chain budget.
- Atomic save: Writes to a temporary file first, then renames—mid-write failures never leave a partial file;
$DSH_HOMEis created if it doesn’t exist. - Clear: Deletes
$DSH_HOME/AGENTS.md, signaling to the harness that “no global instructions exist,” without affecting other files. - File-first: On Host activation, if the file and UI are inconsistent, the file is imported into the UI, ensuring manual edits aren’t overwritten by stale values.
- In-place effect:
contentis a volatile field; saving updates the running plugin without requiring a restart or losing the session.
Installation & Activation¶
The plugin is a DSH bundle, installed via the profile’s plugin list. Installing from a local directory is recommended for easier debugging.
git clone https://github.com/LXMH1982/dsh-windows-agents.git
cd dsh-windows-agents
npm install
After installation, in DSH:
- Open the Plugins page.
- Click Add plugin and select the repository directory containing
package.json. - Return to the Plugins list and confirm that the
dsh-windows-agentsrow is in an enabled state. - Open Settings—a “Personalization” section should now appear on the left.
To package for distribution, run:
npm install
npm pack
This produces dsh-windows-agents-0.2.0.tgz, which can be installed as a plugin package.
Typical Usage¶
1. Write Rules That Apply to All Sessions¶
Open Settings → Personalization and write your global conventions in the editor. The content here is injected at the very beginning of every session, before project-level instructions, making it suitable for general agreements such as language, communication style, and file-operation habits.
A ready-to-use starting point:
# Global Working Conventions
- Respond in Simplified Chinese; keep code, commands, and logs in their original language.
- Read a file before modifying it; make only the minimal changes necessary to achieve the goal.
- Flag uncertainties explicitly; never fabricate paths, version numbers, or APIs.
- For destructive or irreversible operations, explain the impact first, then proceed.
- When reporting, lead with the conclusion, then provide supporting evidence and verification steps.
Common patterns:
| Desired Effect | What to Write |
|---|---|
| Fix the response language | Respond in Simplified Chinese. |
| Fix the response structure | Lead with the conclusion, then details; after execution, report what was done and how to verify. |
| Safety habits | Read files before modifying; never delete or overwrite unrelated content. |
| Reduce pleasantries | No small talk; don’t restate my question. |
| Tool preferences | Prefer ripgrep for searching; use pnpm for dependency management. |
Avoid placing project-specific build commands (that’s the job of project-level AGENTS.md), one-off tasks, or large reference documents (they will consume the 64 KiB budget).
2. Save, Then Verify with a New Session¶
Click Save. Seeing “Saved. New and resumed sessions will load it.” confirms the file has been written to disk.
When it takes effect:
- New sessions: Takes effect immediately (the baseline is rendered on the first request).
- Resumed sessions: The baseline is re-reconciled, so it takes effect.
- Running sessions that have already made requests: Not reloaded; they retain the instructions loaded at the time of opening. To verify immediately, open a new session.
Verification: Open a new session and ask “What global instructions have you loaded?”, or inspect the Instructions from: ~/.dsh/AGENTS.md section injected at the beginning of the session.
3. Clearing Means “No Global Instructions”¶
Clicking Clear deletes $DSH_HOME/AGENTS.md, telling the harness that no global instruction chain exists. Other files are unaffected. Note: this is not “clear the editor but leave an empty file”—the plugin chooses deletion to avoid leaving a misleading empty file behind.
4. Pointing to a Different Path¶
By default, $DSH_HOME/AGENTS.md is maintained. If you need to consolidate global instructions on a sync drive, add a file field in the profile’s plugin configuration:
- id: global-agents
name: dsh-windows-agents
config:
file: 'D:/sync/agents/AGENTS.md'
file only appears in YAML; after changing it, the plugin restarts to read the new path. The path must be a full absolute path; the plugin does not expand ~.
Relationship with Project-Level AGENTS.md¶
Injection order (from broadest to most specific):
$DSH_HOME/AGENTS.md(user-global chain)<agentsHome>/AGENTS.md(user-global chain)<project root>/AGENTS.md- …subsequent directories…
<session working directory>/AGENTS.md
(CLAUDE.md,AGENTS.local.md,CLAUDE.local.mdin the same directory also participate)
Key points:
- Each chain has an independent 65,536-byte budget; they don’t borrow from each other.
- Within the same candidate group, files with identical content are rendered only once.
- Injection occurs only on the first request and on incremental changes triggered by filesystem operations; the harness does not watch for external edits.
Configuration¶
| Field | Default | Where It Appears | Description |
|---|---|---|---|
content |
'' |
Page form | Instruction body; a volatile field. |
file |
'' |
YAML only | The absolute path to maintain; empty string means $DSH_HOME/AGENTS.md. |
$DSH_HOME resolves to the DSH_HOME environment variable if set, otherwise to ~/.dsh, consistent with dsh-agent-instructions resolution.
FAQ¶
I saved successfully, but the current session didn’t change?
This is by design. The instruction baseline is rendered on a session’s first request. An already-open session retains the instructions it loaded at the time. Open a new session or resume an existing one to see the change.
I edited the file manually—will the page update automatically?
It reads once only when the plugin is activated (Host starts): if the file and UI are inconsistent, the file is imported into the UI. During runtime, the plugin does not watch the file; saving on the page at that point would overwrite your manual edits. Either refresh the content first (restart DSH or re-activate the plugin), or edit exclusively through the page.
What happens if I write more than 65,536 bytes?
It saves as usual. The harness handles the budget at render time: within the same chain, it first discards entire broader files, then truncates the most specific one, and notifies the model with Workspace instruction budget .... The page counter lets you see the remaining headroom before you blow the budget.
I don’t see “Personalization” on the left?
Three possibilities: the plugin isn’t installed, it’s installed but not enabled, or the current profile’s Host settings document is read-only. Check the Plugins list first to confirm the row exists.
Do multiple profiles each get their own copy?
No. The file location is determined by the process’s DSH_HOME, not the profile directory. Multiple profiles on the same machine share the same user-global instructions. If you need isolation, use file in each profile’s configuration to point to different paths.
Does this content override the project’s AGENTS.md?
No. It is a broader layer; project-level files come after it and are more specific, participating in budget allocation with “specificity priority” and cannot override system/developer-level instructions.
Does Chinese count against the budget?
Yes, it’s counted in UTF-8 bytes—each Chinese character is 3 bytes. The counter on the page shows bytes, not characters, and is fully consistent with the harness’s calculation.
Uninstallation¶
Disable or remove dsh-windows-agents on the Plugins page, and the “Personalization” section in Settings will disappear accordingly. The file is not deleted; $DSH_HOME/AGENTS.md will still be loaded by the harness. If you want to remove the instructions along with the plugin, click Clear on the page before uninstalling.
Compatibility¶
- Targets the DSH Web client (
dsh.client.platform: "web"), injecting into@deepseek-ai/dsh-client-ui-settingsand reading/writing through the sharedctx.configFormsconfiguration form channel. - Host-side dependencies:
settingsservice,loader/volatile-updateevents,configEditorcapability, and@deepseek-ai/dsh-agent-instructionsfor reading$DSH_HOME/AGENTS.md. - The only runtime dependency is
@deepseek-ai/schemastery. - Development and testing environment: DeepSeek Harness desktop runtime
0.2.2-rc.3.
Directory Structure¶
index.js Host half: imports file on activation, writes back atomically on save, deletes on clear
client.js Browser half: registers settings.section partition, editor UI, navigation icon
cordis.patch.yml Inserts the Host row with id global-agents (config: {})
locale/en.json Plugin card title and description (English)
locale/zh.json Plugin card title and description (Chinese)
docs/DETAIL.md Plugin detail page content
icon.svg Plugin icon
Development & Packaging¶
npm install # Only one dependency: @deepseek-ai/schemastery
npm pack # Produces tgz; files whitelist controls the contents
- The repository directory name retains the development name
dsh-plugin-global-agents, while the package name and repository name aredsh-windows-agents. Installation and references follow thenamefield inpackage.json. package.jsonretainsprivate: true; it is not published to the npm registry. Distribution uses the tgz produced bynpm pack.
Ecosystem Context¶
The DeepSeek Harness philosophy is “everything is a plugin.” This plugin provides a visual editing entry point for user-global instructions, lowering the configuration barrier. The community directory is an independent site with no official affiliation to DeepSeek / High-Flyer.
- Directory page: https://www.skillhub.cn/plugins/LXMH1982/dsh-windows-agents
- GitHub: https://github.com/LXMH1982/dsh-windows-agents