Preface¶
DeepSeek Harness (dsh) delegates system prompt assembly to the Cordis plugin chain, but by default there is no “global memory” layer: the global AGENTS only recognizes ~/.dsh/AGENTS.md, and the workspace level only follows the project directory; dsh will not automatically read the CLAUDE.md, AGENTS.md files you maintain in Codex, Claude Code and other tools, nor the markdown in your knowledge base repository.
There are also community plugins leaning towards a “memory engine” — automatic ingestion, retrieval, distillation, often requiring a service and database. If you already have written rules, long-term memory, or curated knowledge bases, and simply want this content to appear in the system prompt by default at every dsh session, the heavier path may not be suitable.
Below we introduce dsh-memory-snapshot (maintainer yzx4036, GitHub: yzx4036/dsh-memory-snapshot): a zero-dependency lightweight snapshot injection plugin that includes the full text of designated md files or directories into the system prompt at every session assembly, leaving documents at their original paths — no file migration, no copy duplication.
What Is This¶
In one sentence: the local markdown files (or *.md under directories) you list in the config are injected when dsh assembles the system prompt at each session, and it works across workspaces (requires absolute paths or ~).
The plugin itself is about 150 lines, with no database, no write channel, no retrieval distillation; after modifying a file, the next session takes effect. It requires dsh 0.2.x (the README states it was tested with 0.2.0-rc.2; earlier versions perform unclosable {{variable}} interpolation on sections, and memory files containing {{name}} could cause session failures).
What It Can Do, What It Can’t¶
What It Can Do¶
- Multi-path injection:
filessupports a single md, multiple paths, or a directory (the directory collects*.mdaccording todirDepth, and supports~). - Size control: per-file limit
maxBytes(default 3000 bytes, UTF-8 truncation falls back to a newline boundary); total limittotalMaxBytes(default 0 means no overall limit). - Readability and observability: optionally strips YAML front-matter (
stripFrontMatter); snapshot header and file header can carry time information (freshness); unreadable items can be annotated with the reason or silently skipped viaskipMissing; injected content goes into the Trajectory log. - Read-only injection: dsh does not write back to these files; the model also has no write tool provided by the plugin.
What It Can’t Do¶
- It does not automatically record conversations; files need to be maintained by yourself.
- It injects full text; excessive content consumes tokens, so it suits KB-level curated content, not as a general memory engine.
Installation and Enabling¶
Before installing, please review the repository source code and the MIT license yourself; the plugin reads disk with dsh process privileges, so paths should only point to content you trust.
Choose one of the two paths, do not install both layers at the same time (same id will report duplicate loader entry id).
A. dsh plugin add (profile level)
dsh plugin --profile <your-profile> add dsh-memory-snapshot
When the mirror is not synced or you are offline, the GitHub direct installation method given in the README is:
dsh plugin --profile <your-profile> add github:yzx4036/dsh-memory-snapshot
Uninstall:
dsh plugin --profile <your-profile> remove dsh-memory-snapshot
B. node install.mjs (home level, no registry needed)
Execute in the plugin repository directory:
node install.mjs
Optional: --profile headless, --files A.md,B.md, --verify, --update, --uninstall; when a same-named entry already exists across layers, --force can be used to skip the pre-check (see README).
No additional “startup” step is needed after installation; every subsequent dsh session will inject according to the config.
Configuration and Typical Usage¶
Memory sources are written in dsh’s Cordis patch configuration. To change paths, modify files under the memory-snapshot entry, and restart dsh to take effect. The README explains that the profile level can modify ~/.dsh/cordis.patch.yml; install.mjs writes to the home-level config by default, and combined with absolute paths enables cross-workspace support.
To verify whether the session carries the snapshot, you can use:
dsh --profile headless "What's in your memory snapshot?"
Common config options (all subject to the README):
| Config Option | Meaning |
|---|---|
files |
Path list, default ['./MEMORY.md']; use absolute paths or ~ for cross-workspace |
maxBytes |
Per-file injection limit, default 3000 |
totalMaxBytes |
Combined limit for all files, default 0 (no overall limit) |
dirDepth |
Directory recursion depth, default 1 |
skipMissing |
Default false (missing items are listed in the footnote); true silently skips |
freshness |
Default true, snapshot and files carry time information |
stripFrontMatter |
Default true, strips YAML front-matter |
order |
Section order, default 50 |
marker |
Marker prefix, default MEMORY-SNAPSHOT |
Relative paths are resolved against dsh’s startup directory, which becomes “each workspace finds its own”; if you want dsh started from any directory to carry the same memory, you need a home-level installation with files using absolute paths or ~.
Brief Principle¶
A functional Cordis plugin: declares the injection point via inject = ['systemPrompt']; config validation does not depend on zod; text is re-read from files by the provider at every assembly. See docs/architecture.md in the repository for more structural explanation.
Applicable Scenarios and Notes¶
Better suited for: existing stable markdown memory/rules/small knowledge bases; headless, batch, or unattended scenarios where you want memory present by default rather than manually reading files with @ each time.
Of limited use: only occasionally using dsh manually, and verbally asking the model to read files every time — the plugin’s automatic injection advantage is not obvious.
Version and ecosystem: dsh is still in developer preview; please check breaking changes before upgrading. Community plugin directories (such as skillhub.cn) are independent sites and have no official affiliation with DeepSeek / High-Flyer.
Links¶
- Directory page: https://www.skillhub.cn/plugins/yzx4036/dsh-memory-snapshot
- Source code and documentation: https://github.com/yzx4036/dsh-memory-snapshot