Injects your existing markdown documents (notes, rules, knowledge-base files) into every dsh session's system prompt as read-only memory — list file or directory paths in `files`; no database, no service, no write path; UTF-8 byte-budgeted truncation with line-boundary fallback, total budget, YAML front-matter stripping, and freshness timestamps.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-memory-snapshot
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:yzx4036/dsh-memory-snapshot
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Zero-dependency lightweight snapshot (memory) injection plugin for DeepSeek Harness (dsh). The whole point in one line: the important markdown documents you've built up in Codex, Claude Code, Hermes, OpenCode and other Agent tools — constraint rules, long-term memory, or content from a knowledge-base repo — scattered across different directories. List their paths here, and dsh proactively injects them into every session, across all workspaces. No moving files, no duplicate copies, no reminding the model to read them.
Compatibility: requires dsh 0.2.x (verified against 0.2.0-rc.2: assembly, injection, literal
{{}}preservation). Earlier versions interpolate{{variable}}refs in section text with no opt-out — a memory file containing{{name}}fails the session. dsh is still in developer preview: check the breaking changes before upgrading.
Why
dsh has no built-in global memory. Its AGENTS.md auto-load reads exactly one global file — ~/.dsh/AGENTS.md — and workspace-level only walks the project directory chain; global documents of other tools (~/.claude/CLAUDE.md, ~/.codex/AGENTS.md) are never read (checked against the official repo in 2026-08).
But most dsh users already run other Agent tools, or keep a knowledge-base repo — the rules, memory and knowledge inside are all markdown, already the seed of cross-session global memory; dsh just doesn't know they exist.
The community has other memory plugins, but they're all built as "memory engines": auto-ingest, distillation, retrieval, plus services and databases to set up — pretty heavy. If your existing markdown documents are exactly the memory you need, that's a sledgehammer to crack a nut.
So this plugin takes the light path: documents stay put, injected in place. List the paths in files, and every session's system prompt carries them in full. No engine, no database, no write path, about 150 lines of plugin body.
Of course you could also tell dsh to read the files manually each time, but in headless batches and automation pipelines where nobody is around, the plugin keeps memory present by default. If you only drive dsh interactively and always remember to prompt it, this plugin won't do much for you — saying so up front.
What it does, and what it doesn't
Does:
- One or more md files or directories (
~supported), injected in full at every prompt assembly; directory entries collect their*.mdfiles (dirDepthcontrols recursion) - Edits take effect next session
- Per-file byte cap (
maxBytes), truncated by UTF-8 bytes, rolled back to a line boundary, with a "truncated" marker; plus a combined budget (totalMaxBytes) so many files together can't blow up the system prompt - Leading YAML front-matter is stripped (
stripFrontMatter); the snapshot header carries its build time and each file its mtime (freshness) - Unreadable files are reported with the reason (or skipped silently via
skipMissing); the session never crashes - Injected content lands in the Trajectory log — you can always audit what the model received
Doesn't (need these → look at the memory-engine plugins):
- No auto-recording of conversations — you maintain the files yourself
- No write tools for the model — it never writes into your files
- No retrieval or distillation — full-text injection; big files just burn tokens, so this suits curated KB-sized content
Install
Two mutually exclusive ways (don't install at both levels — the same id triggers duplicate loader entry id):
A. dsh plugin add (profile-level, standard ecosystem path)
dsh plugin --profile <your-profile> add dsh-memory-snapshot
# or straight from GitHub: 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, registry-free)
node install.mjs # one command: locate DSH_HOME, copy the plugin, write config
Other options:
--profile headlessinstalls into one profile only;--files A.md,B.mdalso configures the memory files;--verifyruns a self-check after install;--updaterefreshes plugin files only (keeps your config);--uninstallremoves the files and the config entry; a cross-layer duplicate entry blocks installs (--forceskips the precheck).
Usage
It works as soon as installed — every dsh session automatically carries your documents:
dsh --profile headless "What is in your memory snapshot?"
To change memory sources, edit files under the memory-snapshot entry in ~/.dsh/cordis.patch.yml, list your document paths, and restart dsh.
Common config:
files: list of paths (files or directories), default['./MEMORY.md'], multiple allowed; directories collect their*.mdchildren. For cross-workspace effect use absolute paths or~— relative paths resolve against dsh's launch directory, so each workspace ends up looking for its own copymaxBytes: per-file injection cap, default 3000 bytes (truncated by UTF-8 bytes, never splitting a multi-byte character, rolled back to a line boundary)totalMaxBytes: combined injection cap across all files, default0(no combined cap). When exceeded, files are skipped infilesorder and noted at the enddirDepth: directory recursion depth, default1(direct children only;2includes one subdirectory level). Dot-directories are skippedskipMissing: defaultfalse(missing entries are listed in a footnote);trueskips them silently — for machines with different path layoutsfreshness: defaulttrue— the snapshot header carries its build time and every file header carries the file's mtime;falsedisablesstripFrontMatter: defaulttrue— leading YAML front-matter blocks are stripped (unclosed blocks are kept);falsepreserves themorder: section order, default 50marker: marker prefix, defaultMEMORY-SNAPSHOT
Cross-workspace = installed at home level
~/.dsh/cordis.patch.yml(install.mjs default) + absolute paths in files. With both in place, dsh carries these documents no matter which directory you launch it from. One-way and read-only: dsh never writes back to these files, and your other Agent tools don't notice the injection.
How it works
A function-style Cordis plugin: inject = ['systemPrompt'] declares the injection point; Config implements the ~standard interface directly for validation (no zod); text uses a provider function, so files are re-read at every assembly. Development details in docs/architecture.md.
Test
npm test # 66 automated tests (unit 54 + e2e 12; live-session cases skip without credentials)
Manual acceptance (optional, full 7 steps in tests/MANUAL-TEST.md):
dsh --profile headless "What is in your memory snapshot?"
License
MIT, see LICENSE.
Links
More in this category
vectorize-io/hindsight#coding-agents★ 64308
Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.
volcengine/OpenViking#examples/dsh-memory-plugin★ 43076
OpenViking memory and context bundle for DeepSeek Harness: pre-step auto-recall and profile injection, session capture, `viking://` URI guarding, and recall/write memory tools backed by an OpenViking server.
MemTensor/MemOS#memos-local-plugin★ 12546
Local-first memory plugin for DeepSeek Harness: layered L1/L2/L3 memory with automatic capture, manual memos_* retrieval tools, and a built-in memory viewer.
agentscope-ai/ReMe#dsh★ 3873
Connects DeepSeek Harness to ReMe's local-first, self-evolving personal knowledge base: automatically captures completed main-agent conversations as user-owned Markdown memory, searches conversations and source material through reme_search with BM25, optional embeddings, and wikilink expansion, and schedules daily memory consolidation.
zilliztech/memsearch#MemSearch★ 2971
Shared Markdown memory for DSH and other coding agents, with automatic capture, pre-step context injection, searchable recall, and memory-to-skill self-evolution through a review panel.
vshulcz/deja-vu#extensions/dsh★ 1709
Cross-session memory and context recovery across forty-five other coding agents (45+) on this machine, reading session files they already wrote before install (Claude Code, Codex, Cursor, Windsurf, Trae, Antigravity, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Qoder, Cline, Zed, Magpie and more): six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall injected into runtime context. Local BM25 CLI/MCP index, no LLM, no embeddings, no network (dsh plugin --profile web add dsh-deja).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.