dsh-anywhere-claude-mem
已验证@bleed00/dsh-anywhere-claude-mem · v0.1.0 · MIT
A DeepSeek Harness plugin that turns the anywhere-claude-mem git sync into a DSH peer: pull cross-machine memory at session start and push new prompts/observations as they land in the claude-mem worker
安装
dsh plugin add @bleed00/dsh-anywhere-claude-mem 用 dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南。
源码
标签
作者
说明文档
dsh-anywhere-claude-mem
A DeepSeek Harness plugin that makes DSH a full
peer in the anywhere-claude-mem cross-machine sync of your claude-mem memory.
When a DeepSeek Harness session starts, this plugin pulls the data repository
into the local claude-mem worker — the same anywhere-claude-mem startup-pull that the
OpenCode startup plugin runs. During the session it also watches the prompt /
tool "put" events and, after a debounce, pushes new memory back to git. DeepSeek
Harness thus becomes a first-class participant in the bidirectional anywhere-claude-mem
sync, so the memory DSH produces is available on every other machine — and the
memory other machines produced is already there when DSH starts.
The git sync itself is entirely delegated to the
anywhere-claude-memPython command. This plugin never touches the claude-mem worker API or its SQLite database; it only shells out to theanywhere-claude-memCLI.
Why the plugin and the watcher coexist safely
The automatic watcher (anywhere-claude-mem watch) already polls the claude-mem database
and pushes once a configured number of new observations lands. That detection is
based on claude-mem's own rows, independent of which coding tool wrote them —
OpenCode, Claude Code, or DeepSeek Harness all feed the same worker. So the
watcher alone would eventually push DSH memory too.
dsh-anywhere-claude-mem makes DSH push promptly on the actual "put" instead of waiting
for the next poll tick. The two can run at the same time without conflict
because anywhere-claude-mem push is idempotent (a push with nothing new creates no
commit) and serially locked by anywhere-claude-mem's SyncLock; a push this plugin fires
and a push the watcher fires simply serialize, and the duplicate is a no-op.
Install
One-liner from the project checkout (or any profile):
npx -y @deepseek-ai/dsh plugin --profile <profile> add github:Bleed00/Anywhere-claude-mem/dsh-plugin
Or install the anywhere-claude-mem Python package and use its installer, which offers a
deepseek setup alongside opencode and writes this bundle into your DSH
profile for you:
pip install -e .
anywhere-claude-mem install # choose "deepseek" at the platform prompt
Requirements
- A DeepSeek Harness installation with
dshonPATHand a profile to patch. - The npm package
@bleed00/dsh-anywhere-claude-mem(or this checkout) available to pnpm. anywhere-claude-meminstalled (Python package) and configured (anywhere-claude-mem install).- The claude-mem worker running (
http://127.0.0.1:37700).
Config
| Field | Default | Description |
|---|---|---|
command |
resolved on PATH, then ~/.local/bin/anywhere-claude-mem |
The anywhere-claude-mem executable. |
pullOnSessionStart |
true |
Run anywhere-claude-mem startup-pull when a DSH session starts. |
pushOnPut |
true |
Push new memory back to git on "put" events. |
pushDebounceMs |
10000 |
Coalescing window (ms) for push-on-put. |
pushOnEvents |
["prompt","tool"] |
Which "put" events count: prompt, tool, or both. |
Override any of them in your profile's cordis.patch.yml:
- id: anywhere-claude-mem
config:
command: /home/me/.local/bin/anywhere-claude-mem
pushDebounceMs: 15000
pushOnEvents:
- prompt
How it works
agent/session-start→anywhere-claude-mem startup-pull(fire-and-forget).agent/pre-step(a prompt was submitted) andtools/post-execute(a tool finished) are the "put" moments. Each arms a debouncer; oncepushDebounceMspasses with no new event it runsanywhere-claude-mem push, again fire-and-forget so a sync never blocks a turn.
Development
pnpm install --config.auto-install-peers=false
pnpm run build # tsc + tsdown → lib/index.js
pnpm test
The package targets Node ≥ 20.12, TypeScript 6.0, and is authored against the
@deepseek-ai/* framework packages (cordis, schemastery, dsh-agent, dsh-tools,
dsh-skill). Because the peer packages are supplied by the host dsh installation,
install with --config.auto-install-peers=false.
License
MIT — see LICENSE © Bleed00