anywhere-claude-mem
把 anywhere-claude-mem 的 Git 同步变成 DSH 对等方:会话启动时拉取跨机器记忆,新提示与观察落地即推送。
bleed00
@bleed00
⬇ 1
★ 1
main
安装
dsh plugin --profile web add github:bleed00/anywhere-claude-mem
需要可复现安装时,可在仓库后追加 #commit 固定提交。
把 anywhere-claude-mem 的 Git 同步变成 DSH 对等方:会话启动时拉取跨机器记忆,新提示与观察落地即推送。
该插件未提供要点说明,请参考仓库 README。
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/bleed00/anywhere-claude-mem |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 1 |
| GitHub 星标 | 1 |
| 最近推送 | 2026-08-14 |
| 收录日期 | 2026-09-19 |
| 分类 | 会话与消息 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# Anywhere-claude-mem
Two-way synchronization of **claude-mem** memory across multiple **OpenCode** and
**DeepSeek Harness** installations, on **Linux and Windows**.
```text
OpenCode / DeepSeek Harness -> claude-mem worker -> Anywhere-claude-mem Python CLI -> private Git data repository
```
Each machine exports its local claude-mem memory to a **private Git repository**
and imports the merged memory of the other machines. The sync core is pure
Python; only the service integration, config paths, launchers, process handling,
and the *startup-pull trigger* differ per OS or per coding tool.
Both platforms write into the **same claude-mem worker**, so the automatic
watcher recognizes OpenCode and DeepSeek Harness observations alike. Only *who
runs `anywhere-claude-mem startup-pull` when the tool starts* changes with the platform
selected during install: an OpenCode plugin, or a DeepSeek Harness plugin.
## Quick install
Run the installer from the wrapper directory. It asks a few questions, clones
(or attaches) your private data repository, and sets up the automatic watcher.
**Linux:**
```bash
git clone https://github.com/Bleed00/Anywhere-claude-mem.git
cd Anywhere-claude-mem
python3 -m anywhere_claude_mem install
```
**Windows (PowerShell):**
```powershell
git clone https://github.com/Bleed00/Anywhere-claude-mem.git
cd Anywhere-claude-mem
pip install -e .
python -m anywhere_claude_mem install
```
> On Windows the `anywhere-claude-mem`, `anywhere-push` and `anywhere-pull` commands come from
> `pip install -e .`; on Linux the installer writes them to `~/.local/bin`.
> The terminal UI differs by platform: **Windows** uses `rich` and
> `questionary` (installed by `pip install -e .`); **Linux** uses a
> zero-dependency ANSI UI, so no pip package or virtual environment is needed
> there.
The install command is interactive:
1. asks which platform to set up — **OpenCode** or **DeepSeek Harness**;
2. verifies Git, Python, `curl`, the chosen tool (OpenCode + the claude-mem
plugin, **or** DeepSeek Harness + a DSH profile), and a running worker;
3. offers to create a **new** private data repository (requires `gh`) or attach
an **existing** one (always available);
4. clones the data repository into `data/`;
5. asks whether automatic synchronization should be enabled (and its
thresholds);
6. asks whether to pull memory when the chosen tool starts (startup pull);
7. installs the watcher service and the startup-pull trigger for the platform
you chose (an OpenCode plugin, or the `dsh-anywhere-claude-mem` DeepSeek Harness
bundle).
When the installer finishes you can start using it immediately:
```bash
anywhere-claude-mem push # export local memory to the data repository
anywhere-claude-mem pull # import the data repository into the local worker
anywhere-claude-mem status # show sync and service state
```
### Choosing a platform
During install you pick **opencode** or **deepseek**. The choice changes only the
startup-pull trigger:
- **opencode** writes and registers the `anywhere-claude-mem.js` OpenCode startup plugin
(the historical behavior);
- **deepseek** installs the `@bleed00/dsh-anywhere-claude-mem` bundle into a DeepSeek
Harness profile, which pulls the data repository at session start and pushes
new memory back on "put" events.
Everything else — the git sync, the merge rules, the automatic watcher — is
identical regardless of platform. The watcher's push trigger already reads
claude-mem's own rows, so OpenCode and DeepSeek Harness observations are pushed
the same way by the same code.
## Prerequisites
Install these before running the installer (which ones are required depends on
the platform you select):
- **OpenCode** — for the `opencode` platform
- **claude-mem** installed and configured as an OpenCode plugin (for the
`opencode` platform)
- **DeepSeek Harness** (`dsh` on `PATH` with at least one profile) — for the
`deepseek` platform
- a running **claude-mem worker**
- **Python** 3.10 or newer
- **Git**
- **`curl`**
- **GitHub CLI (`gh`)** — optional; only needed to *create* a new data
repository. Without it you can still attach an existing one.
- a **private GitHub data repository** (or permission to create one)
### Install OpenCode and claude-mem
For the **opencode** platform:
```bash
opencode --version # verify OpenCode
npx -y @thedotmack/claude-mem install --ide opencode # install claude-mem
```
### Install DeepSeek Harness
For the **deepseek** platform, install DeepSeek Harness and create a profile:
```bash
npx -y @deepseek-ai/dsh web # or `dsh plugin init ` for a CLI profile
dsh plugin --profile add @deepseek-ai/dsh-base
```
The anywhere-claude-mem installer mounts `@bleed00/dsh-anywhere-claude-mem` into the profile you
choose; the claude-mem worker still must be running.
Configure the worker, for example with OpenRouter. Save as
`~/.claude-mem/settings.json`:
```json
{
"CLAUDE_MEM_RUNTIME": "worker",
"CLAUDE_MEM_PROVIDER": "openrouter",
"CLAUDE_MEM_OPENROUTER_MODEL": "poolside/laguna-xs-2.1:free",
"CLAUDE_MEM_OPENROUTER_API_KEY": "YOUR_API_KEY"
}
```
Protect it and start the worker:
```bash
chmod 600 ~/.claude-mem/settings.json
npx claude-mem start
npx claude-mem status
```
### Install GitHub CLI
Used only to create a *new* data repository. Skip this if you will attach an
existing repository.
```bash
# Arch / CachyOS
sudo pacman -S github-cli
# Debian / Ubuntu
sudo apt install gh
# Fedora
sudo dnf install gh
# Windows
winget install GitHub.cli
```
Then authenticate:
```bash
gh auth login
```
Choose `GitHub.com`, `HTTPS`, and browser authentication.
## Usage
### Manual synchronization
Export the local memory to the private data repository:
```bash
anywhere-claude-mem push
anywhere-push # alias
```
Import the data repository into the local worker:
```bash
anywhere-claude-mem pull
anywhere-pull # alias
```
Both operations are idempotent: re-running a pull never creates duplicate
records, and a push with nothing new produces no commit.
Run the first full export explicitly right after installing, so the accumulated
memory is available on every machine:
```bash
anywhere-claude-mem push
```
### Status
```bash
anywhere-claude-mem status
```
Shows whether the worker is reachable, the state of the local data repository,
the automatic-sync configuration, and the watcher service status.
## Automatic synchronization
During installation, enable automatic sync and configure:
- observations per push (e.g. `1`, `10`, `30`);
- polling interval in seconds;
- debounce interval in seconds.
The watcher starts from a **baseline** of the observations already present, so
installing never pushes the whole database unexpectedly. After the first manual
`anywhere-claude-mem push`, the watcher pushes automatically once the configured number of
new observations is reached. A failed push is retried at the next polling
cycle.
The watcher is installed per platform:
- **Linux**: a `systemd --user` service
(`anywhere-claude-mem-watch.service`) with restart on failure.
- **Windows**: a per-user **registry Run key** that launches the watcher hidden
at logon via `pythonw.exe`. It uses no elevated APIs, so it works on accounts
where Task Scheduler registration is blocked; as a trade-off it does not
auto-restart on crash (it starts again at the next logon). Output is appended
to `%APPDATA%\anywhere-claude-mem\watch.log`.
The installer also registers a startup-pull trigger for the platform you chose.
For **opencode** that is an OpenCode startup plugin that runs
`anywhere-claude-mem startup-pull` whenever OpenCode starts; for **deepseek** it is the
`@bleed00/dsh-anywhere-claude-mem` bundle in the selected DSH profile, which pulls at
session start and pushes new memory back on "put" events. Both run with retries
while the worker is still starting and do not modify the claude-mem plugin.
Useful commands:
```bash
anywhere-claude-mem status # overall state incl. service
anywhere-claude-mem service status # watcher service state
anywhere-claude-mem service remove # stop and remove the watcher service
anywhere-claude-mem watch # run the watcher in the foreground
anywhere-claude-mem startup-pull # test the startup pull manually
systemctl --user status anywhere-claude-mem-watch.service # Linux service state
journalctl --user -u anywhere-claude-mem-watch.service -f # Linux watcher logs
Get-Content "$env:APPDATA\anywhere-claude-mem\watch.log" -Tail 20 # Windows watcher log
```
## Uninstall
```bash
anywhere-claude-mem uninstall # remove service, launchers, startup trigger and config
anywhere-claude-mem reinstall # uninstall and run the installer again
```
`uninstall` removes whichever startup trigger this install registered: the
OpenCode plugin, or the `@bleed00/dsh-anywhere-claude-mem` bundle from the saved DSH
profile.
## Data model and merge safety
The data repository contains:
```text
sessions.json
observations.json
summaries.json
prompts.json
```
Records are merged using **stable cross-device keys** instead of local SQLite
numeric IDs:
- sessions: platform plus content session ID;
- observations: memory session, title, and creation timestamp;
- summaries: memory session ID;
- prompts: platform, content session ID, and prompt number.
The first push exports the complete local knowledge base. Later pushes preserve
the complete accumulated data while Git stores only the differences in each
commit. Deletions and edits are propagated through tombstones so every machine
converges on the same state.
## Configuration
The local Anywhere-claude-mem configuration is stored at:
```text
~/.config/anywhere-claude-mem/config.json # Linux
%APPDATA%\anywhere-claude-mem\config.json # Windows
```
It contains local paths, the data repository URL, the selected platform
(`opencode` or `deepseek`), the chosen DSH profile (`dsh_profile`, when deepseek),
and automatic-sync settings. It does not contain API keys.
Watcher state is stored separately at:
```text
~/.config/anywhere-claude-mem/watch-state.json # Linux
%APPDATA%\anywhere-claude-mem\watch-state.json # Windows
```
## Security
- Keep the data repository **private**. It contains prompts, observations, and
summaries from your sessions.
- Never commit `~/.claude-mem/settings.json` or API keys.
- Use `chmod 600 ~/.claude-mem/settings.json` (Linux).
- The wrapper repository is safe to publish only after its Git history has been
audited and no personal data has ever been committed.
## Development
On **Linux** the CLI runs from the wrapper with no installation:
```bash
python3 -m anywhere_claude_mem --help
python3 -m unittest discover tests
```
On **Windows**, install the package (editable) to get the `anywhere-claude-mem`,
`anywhere-push` and `anywhere-pull` commands and the `rich`/`questionary` UI:
```powershell
pip install -e .
```
`anywhere-claude-mem install` bootstraps this automatically on Windows when the commands
or the UI dependencies are missing.
The runtime uses the Python standard library, plus `rich` and `questionary`
for the Windows terminal UI (Linux uses a zero-dependency ANSI UI), and the
system `git` and `gh` commands.
## Platform-specific pieces
The sync core (`data.py`, `sync.py`, `git.py`, `watcher.py`, the worker HTTP
client) is platform-independent. Only these pieces differ per OS or per coding
tool:
- `service.py` dispatches to `service_linux.py` (systemd user services) or
`service_windows.py` (logon autostart via the per-user Run key).
- `config.py` resolves `~/.config/anywhere-claude-mem` on POSIX and `%APPDATA%\anywhere-claude-mem` on
Windows, and skips `chmod` on Windows.
- `lock.py` checks process liveness with `os.kill(pid, 0)` on POSIX and
`OpenProcess`/`GetExitCodeProcess` on Windows.
- `worker.py` discovers the claude-mem worker port from `worker.pid`/
`supervisor.json`, then env/settings, then a health probe; it never relies on
a uid that does not exist on Windows.
- `ui.py` dispatches to `ui_rich.py` (rich + questionary, Windows) or
`ui_ansi.py` (zero-dependency ANSI, Linux).
- `cli.py` generates POSIX symlink launchers or relies on pip console scripts on
Windows, and hides console windows for background subprocesses.
- `deepseek.py` discovers DSH profiles under `$DSH_HOME/profiles` and mounts (or
removes) the `@bleed00/dsh-anywhere-claude-mem` bundle via `dsh plugin`.
- `git.py` and `cli.py` run background subprocesses with
`CREATE_NO_WINDOW` on Windows so no console window flashes.
The data format and worker API are platform- and tool-independent.
## DeepSeek Harness plugin
The `dsh-plugin/` directory is a self-contained, installable DeepSeek Harness
bundle (`@bleed00/dsh-anywhere-claude-mem`). It makes DSH a full peer of the sync: on
`agent/session-start` it runs `anywhere-claude-mem startup-pull` (the same command the
OpenCode plugin runs), and as prompts/tool results land in the claude-mem worker
it pushes the new memory back to git through a debounced, fire-and-forget
`anywhere-claude-mem push`.
It never touches the worker API or SQLite — it only shells out to the `anywhere-claude-mem`
CLI. Because `anywhere-claude-mem push` is idempotent and serialized by anywhere-claude-mem's
`SyncLock`, the automatic watcher can stay active as an independent fallback
without conflict.
```sh
cd dsh-plugin
pnpm install --config.auto-install-peers=false
pnpm run build # tsc + tsdown → lib/index.js
pnpm test
```
## License
MIT - see [LICENSE](LICENSE).
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。