Rust CLI for synchronizing Claude Cowork state between machines on macOS.
Merge Cowork state from a remote Mac into your local Mac, then apply it to your live local Claude profile:
cargo run -- merge \
--merge-from "user@remote-mac" \
--applyThis is the normal workflow for two machines (local + remote).
- Checks that Claude is not running on the remote host.
- Incrementally fetches remote profile data over SSH (only changed files/sessions where possible).
- Merges Cowork session filesystem state.
- Merges browser state (LocalStorage and optionally IndexedDB) via native Rust Playwright.
- Validates merged output.
- Imports merged browser state into the merged profile.
- Atomically swaps the merged profile into your live local profile (backup kept).
- Quit Claude on both machines.
- Ensure SSH access works to remote host (
ssh user@remote-mac). - Install Playwright Chromium once (required for browser-state merge/apply):
npx playwright@1.56.1 install chromiumIf you intentionally want filesystem-only merge, use --skip-browser-state.
Dry-run merge from remote (no deploy):
cargo run -- merge \
--merge-from "user@remote-mac"Filesystem-only merge + apply (fastest path, skips browser-state handling):
cargo run -- merge \
--merge-from "user@remote-mac" \
--skip-browser-state \
--applyTune performance for large profiles:
cargo run -- merge \
--merge-from "user@remote-mac" \
--parallel-remote 64 \
--parallel-local 64 \
--hash-algorithm sha1 \
--apply- Local profile (
--profile-a) default:~/Library/Application Support/Claude - Remote profile (
--remote-profile-path) default:~/Library/Application Support/Claude --merge-fromuses local profile A as incremental baseline.- Browser-state auto-export is enabled for
--merge-fromwhen explicit browser-state files are not provided. - Progress rendering is enabled on TTY by default.
- Disable with:
COWORK_MERGE_PROGRESS=0
- Disable with:
Show CLI help:
cargo run -- --helpRun Rust tests:
cargo testLegacy Python tests (deprecated stack under python/):
uv run --project python pytestLegacy Swift GUI tests (deprecated stack under python/):
swift test --package-path python/swift-guiHomebrew packaging helper script:
scripts/release_to_brew.sh --helpActive implementation:
- Rust CLI at repo root (
Cargo.toml,src/)
Deprecated legacy implementations:
- Python CLI and tests in
python/ - Swift GUI wrapper in
python/swift-gui/
Raw LevelDB file syncing is unsafe for browser storage. This tool performs logical merges for Claude Cowork state.
- Filesystem session data under
local-agent-mode-sessions/ - Browser-origin state for
https://claude.ai:- LocalStorage
- IndexedDB (optional)
- Build source A (local) and source B (local or remote over SSH).
- Incrementally fetch remote source B when
--merge-fromis used. - Export browser state logically using Playwright.
- Prepare output profile from source A.
- Merge session filesystem trees.
- Merge browser state maps.
- Validate merged output.
- Optionally deploy atomically with backup (
--apply).
- Session metadata (
local_*.json) merged with timestamp-aware precedence. audit.jsonldeduped and ordered deterministically.- Payload files (
uploads/,outputs/,.claude/) merged with deterministic conflict naming. - Secondary
.claude/.credentials.jsonis excluded unless--include-sensitive-claude-credentialsis set.
cowork-read-statemerged by session union + max timestamp.- Session binding keys (
cc-session-cli-id-*,cc-session-cwd-*) rehydrated from merged metadata. - IndexedDB merging is optional and timestamp-aware.
local_*.jsonfile/folder consistency.- Expected LocalStorage session binding keys.
cowork-read-state.sessionscoverage for merged session IDs.
--merge-from user@host: use remote source B over SSH.--apply: import merged browser state + atomically swap merged profile into live profile.--skip-browser-state: filesystem-only merge.--skip-indexeddb: merge LocalStorage but skip IndexedDB.--parallel-remote <N>: remote hash scan parallelism.--parallel-local <N>: local diff-hash and session-merge parallelism.--hash-algorithm {sha256|sha1}: local+remote diff hashing algorithm.--force: overwrite output profile directory if it exists.--include-cache-dirs: include non-essential cache directories.--include-vm-bundles: include remotevm_bundlesduring fetch.--auto-export-browser-state: force browser-state auto-export when paths are not provided.--headless-browser-state/--no-headless-browser-state: Playwright mode control.