Skip to content
Back to search

dsh-auto-memory

Claude Code-style auto-memory plugin for DeepSeek Harness (dsh): typed memory files + MEMORY.md index auto-injected into the system prompt. File-only, no external services.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/AskTheWay/dsh-auto-memory with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/AskTheWay/dsh-auto-memory'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/asktheway--dsh-auto-memory/badge.svg)](/listings/asktheway--dsh-auto-memory)

HTML

<a href="/listings/asktheway--dsh-auto-memory"><img src="/api/listings/asktheway--dsh-auto-memory/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

dsh plugin --profile demo add dsh-auto-memory   # from npm (prebuilt)
dsh --profile demo                               # restart the profile

From source: `npm install && npm run build && dsh plugin --profile demo add /abs/path`. Requires `@deepseek-ai/dsh >= 0.1.5-rc.2` (Node `^22.19 || >=24`).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 349 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # dsh-auto-memory
  2. [![CI](https://github.com/AskTheWay/dsh-auto-memory/actions/workflows/ci.yml/badge.svg)](https://github.com/AskTheWay/dsh-auto-memory/actions/workflows/ci.yml)
  3. [![npm version](https://img.shields.io/npm/v/dsh-auto-memory)](https://www.npmjs.com/package/dsh-auto-memory)
  4. [![npm downloads](https://img.shields.io/npm/dm/dsh-auto-memory)](https://www.npmjs.com/package/dsh-auto-memory)
  5. [![License: MIT](https://img.shields.io/npm/l/dsh-auto-memory)](LICENSE)
  6. [![Node](https://img.shields.io/node/v/dsh-auto-memory)](package.json)
  7. [English](README.md) | [中文](README.zh.md)
  8. > ### Your dsh agent forgets everything you tell it. Every. Single. Session.
  9. > **Fix it with one command.** Claude Code-style persistent memory for
  10. > [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) — native,
  11. > zero servers, zero embeddings, zero setup.
  12. ```sh
  13. dsh plugin --profile web add dsh-auto-memory
  14. ```
  15. Say *"Remember: I'm a Python backend engineer preparing for interviews"* today —
  16. open a brand-new session tomorrow, ask *"what do you know about me?"*, and it
  17. **remembers**.
  18. ![dsh-auto-memory — persistent memory for DeepSeek Harness](imgs/img-1.png)
  19. ---
  20. ## Highlights
  21. **1.8 — memory hygiene**: sessions that ran web/search/MCP tools are flagged
  22. (host tool-event metadata, no content sniffing) — their consolidation gets a
  23. "only persist what the user themselves stated" guard and an importance cap;
  24. index receipts report two tiers (75% filling up / 90% near cap); verified on
  25. dsh 0.2.2-rc.3.
  26. **1.7 — memory maintenance**: retrieval keywords (vector-free semantic
  27. generalization), an aging tier for long-unverified candidates, citation
  28. discipline + freshness banners (citing a memory doesn't make it truer),
  29. dead-link health checks, near-cap write receipts, and a graded capability
  30. contract (`docs/CONTRACT.md`).
  31. **1.6 — memory has a shelf life**: time-sensitive facts (plans, prices,
  32. versions) carry a `validUntil`; expired memories stop being injected, surface
  33. on the health board with one-click renew, and are marked as historical when
  34. recalled. High-recall memories now rank higher in the index (a gentle
  35. reads multiplier), and writes carrying secrets get an explicit "redacted"
  36. receipt instead of silent sanitization.
  37. **1.5 — a panel, not a wall**: tabbed UI (Memories first-class, Insights,
  38. Health, Settings), monochrome SVG iconography, color-blind-checked identity
  39. colors — and health rows jump straight to the memory card they're about.
  40. **1.4 — runtime settings + a recall funnel**: a Settings card (presets,
  41. sliders, per-field reset) changes the injection budget, value gate and
  42. eviction **at runtime — next request, no restart**; the recall funnel makes
  43. "injected but never actually read" visible and actionable (mute the budget
  44. hogs, pin the buried gems).
  45. **1.x — trustworthy memory + measured end-to-end**: consolidation products are
  46. born `candidate` with verbatim evidence quotes; only *you* can grant
  47. `verified`; disputed memories are never re-injected; every write passes an
  48. injection-pattern guard at the store choke point. And it's measured: four
  49. evaluation layers (deterministic / recall / consolidation / end-to-end) plus a
  50. LongMemEval-S alignment run — including an honestly published off-target score.
  51. Full history: [CHANGELOG.md](CHANGELOG.md) ·
  52. [Releases](https://github.com/AskTheWay/dsh-auto-memory/releases)
  53. ## Claude Code has this. dsh didn't. Now it does.
  54. DeepSeek Harness is the hottest open agent harness on GitHub right now —
  55. models, tools, sandboxes, everything is a plugin. But it ships with **no memory
  56. subsystem at all**. The official answer is three *default-off* MCP configs to
  57. third-party servers, which the official docs themselves qualify: not
  58. auto-injected, no forgetting policy, substring-only search. Your agent has
  59. amnesia by design.
  60. `dsh-auto-memory` closes that gap natively:
  61. | | MCP bridge approach | **dsh-auto-memory** |
  62. |---|---|---|
  63. | Memories injected into **every** system prompt, automatically | ✗ | ✓ (zero tokens when empty) |
  64. | Typed memories: user / feedback / project / reference | ✗ | ✓ |
  65. | Workspace + user scope layers — no cross-project leakage | ✗ | ✓ |
  66. | **Trust machine**: candidate / verified / disputed / superseded + verbatim evidence | ✗ | ✓ |
  67. | **Auditability**: every injection logged, recall funnel, health board | — | ✓ |
  68. | Crash & concurrency safety (cross-process locks, orphan recovery) | — | ✓ |
  69. | External services / databases / embeddings required | ✓✓✓ | **none — just plain Markdown files** |
  70. Memories are ordinary files under `$DSH_HOME/memory/` — hand-editable,
  71. grep-able, git-friendly, yours.
  72. ### Trustworthy, not just persistent (1.0.0)
  73. Model-consolidated memories can be confidently wrong — and a wrong memory
  74. gets re-injected every session. So memories carry a **trust status**:
  75. consolidation products are born `candidate` (with a verbatim evidence quote
  76. from the transcript — fabricated citations are dropped by checking against
  77. it), `verified` can only be granted by *you* in the panel, `disputed` /
  78. `superseded` are never injected. Every write path passes an injection-pattern
  79. guard at the store choke point; content changes downgrade trust and expire
  80. old evidence. A `🩺` health board surfaces unverified / zombie / conflicting
  81. memories for review. Same flat files, same zero services — now with an audit
  82. trail for *whether to believe them*.
  83. ## One minute to feel it
  84. ```sh
  85. node scripts/demo.mjs # no API key, no browser: watch write → index → inject → recall → forget
  86. ```
  87. Or for real, in a chat: tell your agent things worth remembering. The model
  88. calls `memory_write` / `memory_read` / `memory_list` / `memory_search` /
  89. `memory_delete`, following Claude Code's write discipline: **dedupe-and-update
  90. over piling up**, absolute dates only, `[[name]]` cross-links, `feedback`
  91. memories carry **Why:** / **How to apply:** lines.
  92. ## The memory panel
  93. The whole memory system has one home in the dsh Web UI: user-scope and
  94. project-scope groups, per-memory read counts and trust badges, pin / disable /
  95. edit / delete, injection statistics (per memory and per project, with budget
  96. truncation boards), the health board, and the Claude Code import/export
  97. bridges.
  98. ![The memory panel: injection stats, trust badges, import/export](imgs/image-2.png)
  99. ## Import from Claude Code — and take it back
  100. The panel's **📥 Import from Claude Code** button scans
  101. `~/.claude/projects/*/memory` read-only and lists every memory grouped by source
  102. project. Tick what you want and apply: fields map one-to-one (same four types,
  103. H1 → title, ISO `modified` → epoch), same-name memories are skipped, never
  104. overwritten.
  105. Imported files carry an `origin` block (`kind` / `slug` / `file` / `imported` /
  106. `hash`) in their frontmatter, so the checkbox becomes reversible: uncheck an
  107. already-imported memory and apply, and it is deleted from this plugin — the
  108. Claude Code source stays untouched and can be re-imported any time. If the
  109. memory was edited after import, the content fingerprint no longer matches; the
  110. entry is marked **modified** and kept, never silently discarded. Memories
  111. imported by earlier versions (no `origin` block) are recognised by exact content
  112. equality and marked **legacy import**, so they can be revoked the same way.
  113. You don't even have to check: the host scans the Claude memory directory every
  114. 5 minutes, and a hint bar appears above the list whenever sync-able memories
  115. are waiting.
  116. ### Export to AGENTS.md — the bridge goes both ways
  117. A panel button renders your *trusted* memories (verified or unset — candidates
  118. and disputed never leave) as an **AGENTS.md** snippet copied to the clipboard.
  119. Paste it into any tool that follows the AGENTS.md convention — Claude Code,
  120. Codex, Cursor — and what this plugin learned travels with you. Same flat
  121. files, two directions.
  122. ## What the model actually sees
  123. Every request, one system-prompt section (order 4000) carries the index —
  124. re-evaluated per step, byte-budgeted, and **gone entirely when the store is
  125. empty**:
  126. Since 1.9.0 the index is a **session snapshot**: the assembly right after
  127. your first message freezes the selection for the whole session — writes land
  128. on disk immediately (tools can read them at once) and join the injection on
  129. the *next* session, keeping the session's prompt prefix absolutely stable
  130. (same semantics as Claude Code's official auto-memory). When the index
  131. exceeds budget, the current workspace's memories get a guaranteed 60% share.
  132. Full design: [docs/injection-design.md](docs/injection-design.md).
  133. ```
  134. # Persistent memory index
  135. ## Project memories
  136. - [压测过 PostgreSQL](id-generator-benchmark.md) — psycopg2 连接池有踩坑经验 (2026-09)
  137. - [用户是 Python 后端工程师](user-prefers-python.md) — 正在准备面试; 偏好中文交流
  138. ```
  139. Chinese titles, YAML frontmatter, one file per memory — exactly the Claude
  140. Code `MEMORY.md` model, rebuilt natively on dsh's prompt-assembly pipeline.
  141. ## Hardened before first release
  142. This plugin survived a **12-agent adversarial code review** (680k tokens of
  143. source-level scrutiny) before v0.1.0. Five production-grade traps were caught
  144. and fixed — with regression tests — including two that would have been
  145. field incidents:
  146. - **The NTFS silent destroyer**: a memory named `memory` collides with
  147. `MEMORY.md` on case-insensitive filesystems — the write *succeeds* while
  148. destroying the record. Blocked by a reserved-name guard.
  149. - **The poisoned-prompt bomb**: three literal `{{{ }}}` braces in any memory
  150. could crash *every* model request in the workspace — with no way for the
  151. model to self-recover. Neutralized by a converging sanitizer.
  152. Plus: orphaned-lock self-healing (Ctrl+C can't brick your memory store),
  153. symlink-read protection, malformed-file tolerance, stable index ordering to
  154. protect KV-prefix caches, and a strict no-custom-session-events policy (they
  155. make dsh sessions refuse to resume).
  156. ## Measured, not just claimed
  157. A deterministic evaluation layer ([evals/](evals/README.md)) runs in CI —
  158. no LLM, fully reproducible:
  159. - **Injection cost is a flat line** — measured on the real render path
  160. (typical ~40-char descriptions, default 4 KB budget):
  161. | memories | 0 | 10 | 20 | 50 | 100 | 200 |
  162. |---|---|---|---|---|---|---|
  163. | injected section | **0 B** | 2.3 KB (~564 tok) | 3.2 KB (~801 tok) | 4.0 KB (~1008 tok) | 4.0 KB | 4.0 KB |
  164. The byte budget is a hard ceiling — from 50 memories on, the section is
  165. pinned at the cap no matter how many exist (oldest/lowest-ranked rows
  166. truncate with a marker). An empty store injects **0 bytes**: the whole
  167. section disappears.
  168. - **Compaction-proof by construction**: the index rides in a *dynamic*
  169. system-prompt section re-evaluated on every step assembly — context
  170. compaction only compresses conversation history, so memories survive every
  171. compaction without re-injection tricks. Approaches that store memories as
  172. session-log messages lose theirs on the first compaction pass.
  173. - **End-to-end lift measured** (L2, the layer above the pipeline): with the
  174. full consolidation → injection → QA loop, the model answers project-specific
  175. probe questions at **95.8% with memories vs 16.7% without — a +79.2 point
  176. net contribution** (standard dataset, 30 probes, blind LLM judge). An
  177. honest off-target data point is published too: on LongMemEval-S (122k-token
  178. chat-haystack needle-search, 30-question stratified subset, official judge
  179. protocol) the plugin scores 23.3% overall — quantifying exactly how far
  180. this coding-scenario design is from the chat-needle task, instead of
  181. cherry-picking benchmarks. [Results](evals/results/) ·
  182. [methodology](evals/README.md)
  183. - **Eviction never misfires**: four-class mixed scenario — only
  184. stale-zero-read memories get hidden; zero files lost; one read revives.
  185. - **Relevance-ranked truncation** (#18, 1.3.0): when the index exceeds budget,
  186. entries are kept by relevance to the frozen per-session query profile —
  187. KV-safe, re-evaluated per session. Honest boundary: in "inject before the
  188. question is known" scenarios (like LongMemEval) there is no query signal at
  189. truncation time — the needle probe in
  190. [evals/README](evals/README.md) pins those coordinates instead of hiding
  191. them.
  192. This evaluation layer already caught a real bug: the byte budget used to
  193. exclude the policy text, overshooting by ~800 bytes (fixed, regression-tested).
  194. **Verified platform matrix** (manually tested, not just declared):
  195. | | CLI | Desktop | Web profile |
  196. |---|---|---|---|
  197. | dsh version | 0.1.5-rc.2 | 0.2.0-rc.2 | 0.2.2-rc.3 |
  198. | status | ✓ tools/prompt/consolidation | ✓ panel + import + audit | ✓ panel + settings + health (5 boards) |
  199. **239 tests + a three-axis evaluation system (regression net / component quality / system effect with budget-decoupled dual-budget runs / explicit budget-stress axis). Runtime deps: `yaml` + `schemastery` (schema DSL), ~364 kB unpacked.**
  200. ## Install
  201. The package lives on npm ([dsh-auto-memory](https://www.npmjs.com/package/dsh-auto-memory)) —
  202. `dsh plugin add` pulls it straight from the registry, no manual download:
  203. ```sh
  204. # 1) install into a profile (web is the default graphical one;
  205. # substitute your own profile name if you use another)
  206. dsh plugin --profile web add dsh-auto-memory
  207. # 2) restart the profile — done
  208. dsh web
  209. ```
  210. **Desktop client instead?** Open the built-in plugin manager (Plugins page),
  211. search `dsh-auto-memory`, click install — same package, same versions.
  212. From source: `npm install && npm run build && dsh plugin --profile web add /abs/path`.
  213. Requires `@deepseek-ai/dsh >= 0.1.5-rc.2` (Node `^22.19 || >=24`). Works with
  214. the official desktop client — verified on 0.2.0-rc.2.
  215. Then just talk to your agent: say *"remember that I prefer Chinese comments"*,
  216. open the **Memory** panel in the web UI, or watch the injection stats fill up
  217. after a few sessions.
  218. ## Configuration
  219. Two layers, hottest knobs first:
  220. **Runtime settings (1.4.0)** — the panel's Settings card, no restart, no
  221. YAML. Focus/Companion presets, sliders for index budget / value gate /
  222. soft eviction, auto-consolidate toggle. Every field shows where its value
  223. comes from (`profile` or `your override`) and resets to the profile default
  224. with one ↺. Changes apply to the **next request** — the injection budget,
  225. consolidation gate and eviction read a live config object, not a frozen
  226. snapshot. Stored as overrides in the memory root's `settings.json`
  227. (whitelist + range validated; `memoryDir` deliberately not settable):
  228. | field | range | default | what it does |
  229. | --- | --- | --- | --- |
  230. | `maxBytes` | 1024–65536 | 4096 | per-request injection budget |
  231. | `minImportance` | 0–10 | 4 | consolidation value gate (0 = off) |
  232. | `staleAfterDays` | 0–3650 | 0 | soft-hide zero-read memories (0 = off) |
  233. | `autoSummarize` | on/off | false | consolidate durable facts on session end |
  234. | `autoSummarizeMaxMemories` | 1–20 | 5 | cap per consolidation |
  235. **Profile config** — override in your profile's `cordis.patch.yml` (config
  236. replaces wholesale). This is where `memoryDir` and `enableUserScope` live,
  237. and where the defaults the runtime layer falls back to come from:
  238. ```yaml
  239. - id: auto-memory
  240. config:
  241. maxBytes: 4096 # injection budget (index + guidance + wrapper)
  242. memoryDir: D:/memories # default: $DSH_HOME/memory
  243. enableUserScope: true # false: user layer off on every path
  244. autoSummarize: false # true: on root-session end, a background LLM files durable new facts
  245. autoSummarizeMaxMemories: 5 # cap per consolidation
  246. autoSummarizeMaxTokens: 2048 # consolidation output cap
  247. staleAfterDays: 0 # >0: soft-hide zero-read memories older than N days (files kept)
  248. ```
  249. ## How it works (60 seconds)
  250. - **Write**: tool `execute` → name normalized to `[a-z0-9-]` (reserved names
  251. rejected) → cross-process file lock (official `dsh-atomic-write`) → atomic
  252. write → full index rebuild inside the lock.
  253. - **Inject**: one dynamic section re-evaluated on every step assembly; reads
  254. the index synchronously, enforces the byte budget, neutralizes `{{`.
  255. Tool writes take effect on the **very next request** — no restart, ever.
  256. - **Audit**: no custom session events (third-party types make dsh refuse to
  257. resume); everything flows through standard `tool/call` / `tool/result`.
  258. Since 1.0, every injection is also logged to `audit.jsonl` (which memories,
  259. which session, what the budget cut) and aggregated into the panel's
  260. statistics — memory with a paper trail.
  261. Deep dives: [design decisions](docs/design.md) ·
  262. [postmortem: shipping a PR to awesome-dsh-plugin](docs/postmortem-pr-5696.md)
  263. ## Roadmap
  264. - [x] P0 — typed store, four tools, prompt injection, scoped layers, crash safety
  265. - [x] P1 — auto-consolidation on session end, forgetting & eviction, recall expansion, human-gated bulk delete
  266. - [x] P2 — Web UI memory panel, token-cost / recall-quality benchmarks
  267. - [x] P3 — update-replace semantics, matching core shared with the eval harness
  268. - [x] 0.8–1.0 — Claude Code import bridge (revocable), injection audit + stats, trustworthy memory (status / evidence / guard / health)
  269. - [x] 1.1–1.2 — L2 end-to-end + LongMemEval alignment, `memory_search`, import watcher, reverse AGENTS.md export
  270. - [x] 1.3–1.4 — consolidation value gate + chitchat suppressor, relevance-ranked truncation, memory evolution lineage, runtime settings center, injection→recall funnel
  271. - [ ] real-coding-session blind eval (#20), community-driven work
  272. ## Changelog
  273. Per-version notes: [CHANGELOG.md](CHANGELOG.md) ·
  274. [GitHub Releases](https://github.com/AskTheWay/dsh-auto-memory/releases)
  275. ## License
  276. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.