Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/COMMANDS-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Portable AI snapshots exclude skill roots, auth by default, caches, histories, d

## claude-mem peer sync

`dot ai memory sync [push|pull|sync|sessions|status]` replicates the claude-mem store (`~/.claude-mem/claude-mem.db`) with a peer Mac over ssh; the peer needs only the dot binary, which serves `max`/`export`/`import`/`count` as JSON over stdio via the hidden `--serve` flag — no python or claude-mem tooling on either side. Incremental export uses the receiver's `MAX(created_at)` minus a 7-day overlap (`--full` disables it); dedupe keys are `(created_at, title)` for observations, `(created_at, request)` for summaries, and `(platform_source, content_session_id)`/`memory_session_id` for sessions. Inserts use the column intersection of both sides minus identity/sync columns, so plugin version skew skips a column (logged once) instead of failing; previously copied rows get a one-off attribution backfill (`agent_type`/`agent_id`/`metadata`/`content_hash`/`generated_by_model`). An import that adds rows kicks the local worker's `/api/admin/restart` when it runs. `dot ai memory install --peer <target>` installs the hourly LaunchAgent `com.dotfiles.claude-mem-sync` (ssh pre-check `ssh <target> true || exit 0`, so an away peer is a skipped run, exit 0); each scheduled pass refreshes claude-mem to the latest marketplace version first (also `dot ai memory update` and a `dot ai update` step), keeping both Macs on the same plugin version. Last run/result and both sides' counts live in `~/.claude-mem/sync-state.json` and the `dot ai memory status` "peer sync" section.
`dot ai memory sync [push|pull|sync|sessions|status]` replicates the claude-mem store (`~/.claude-mem/claude-mem.db`) with a peer Mac over ssh; the peer needs only the dot binary, which serves `max`/`export`/`import`/`count` as JSON over stdio via the hidden `--serve` flag — no python or claude-mem tooling on either side. Incremental export uses the receiver's `MAX(created_at)` minus a 7-day overlap (`--full` disables it); dedupe keys are `(created_at, title)` for observations, `(created_at, request)` for summaries, and `(platform_source, content_session_id)`/`memory_session_id` for sessions. Inserts use the column intersection of both sides minus identity/sync columns, so plugin version skew skips a column (logged once) instead of failing; previously copied rows get a one-off attribution backfill (`agent_type`/`agent_id`/`metadata`/`content_hash`/`generated_by_model`). An import that adds rows kicks the local worker's `/api/admin/restart` when it runs. A run is bounded by `--timeout` (default 10m): past it, or on SIGTERM, the open import rolls back and the run exits non-zero naming the phase it stopped in; each phase logs its start and end with row counts. `dot ai memory install --peer <target>` installs the hourly LaunchAgent `com.dotfiles.claude-mem-sync` (ssh pre-check `ssh <target> true || exit 0`, so an away peer is a skipped run, exit 0; a watchdog sends SIGTERM after 15 min and SIGKILL 30 s later, since launchd starts no new run while one is alive); each scheduled pass refreshes claude-mem to the latest marketplace version first (also `dot ai memory update` and a `dot ai update` step), keeping both Macs on the same plugin version. Last run/result and both sides' counts live in `~/.claude-mem/sync-state.json` and the `dot ai memory status` "peer sync" section.

## Apps and profile snapshots

Expand Down
5 changes: 5 additions & 0 deletions docs/commands/dot_ai_memory_sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ with a peer Mac. Incremental by default (receiver's MAX(created_at) minus a
needs only the dot binary: the transport is
'ssh <target> dot ai memory sync --serve <op>' with JSON over stdio.

A run is bounded by --timeout: past it, or on SIGTERM, the open import
rolls back and the run exits non-zero naming the phase it stopped in.
Each phase logs its start and end to stderr.

sessions replicates all sessions both ways. status prints both sides'
counts plus the last scheduled run. With no action, sync runs both
directions. --peer defaults to the configured dot peer target.
Expand All @@ -25,6 +29,7 @@ dot ai memory sync [push|pull|sync|sessions|status] [flags]
-h, --help help for sync
--peer string ssh target to sync with (default: the dot peer target)
--remote-db string DB path on the peer (default: the peer's ~/.claude-mem/claude-mem.db)
--timeout duration abort the run (and roll back an open import) after this long (default 10m0s)
```

### Options inherited from parent commands
Expand Down
Loading
Loading