# Cloud Sync Memories

Sets up and checks cloud sync and backup of memories to a cmem.ai account.

- Repository: https://github.com/thedotmack/claude-mem (109099 stars)
- Category: DevOps
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add thedotmack/claude-mem --skill cloud-sync -g -a claude-code -y`
Codex: `npx skills add thedotmack/claude-mem --skill cloud-sync -g -a codex -y`
Cursor: `npx skills add thedotmack/claude-mem --skill cloud-sync -g -a cursor -y`
Gemini CLI: `npx skills add thedotmack/claude-mem --skill cloud-sync -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add thedotmack/claude-mem`

## Description

Set up or check claude-mem cloud sync with cmem.ai Pro. Use when the user says "set up cloud sync", "sync my memories", "cmem pro", "cloud backup", "sync status", or wants their memory database backed up or synced to their cmem.ai account.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Cloud Sync (cmem.ai Pro)

The installed worker syncs through SyncHub. There is one client, one durable
operation log, and no separate sync daemon. This skill checks status and points
the user to the installer's cmem.ai sign-in, which writes the connection.

**Security rule:** never ask the user to paste the sync token into this chat,
and never put it in a command you write, print it, put it in argv, or log it. A
secret pasted into a chat lands in the transcript, which claude-mem itself can
capture and sync. The installer writes the token to
`~/.claude-mem/settings.json` (mode `0600`) without it ever passing through
this conversation.

## 1. Check status

Resolve the worker port and query the always-registered status route:

```bash
PORT="${CLAUDE_MEM_WORKER_PORT:-$(node -e "const fs=require('fs'),p=require('path'),os=require('os');const uid=(typeof process.getuid==='function'?process.getuid():77);const fallback=String(37700+(uid%100));try{const s=JSON.parse(fs.readFileSync(p.join(os.homedir(),'.claude-mem','settings.json'),'utf-8'));process.stdout.write(String(s.CLAUDE_MEM_WORKER_PORT||fallback));}catch{process.stdout.write(fallback);}" 2>/dev/null)}"
curl -s "http://127.0.0.1:${PORT}/api/sync/status"
```

- `configured: true` and `hub.reachable: true` → the worker completed an
  authenticated `GET /v1/sync/status` against SyncHub. Report `deviceId`,
  pending counts, `lastFlushAt`, `lastError`, and the Hub head/checkpoint;
  stop unless the user asked to replace the connection.
- `configured: true` and `hub.reachable: false` → report `hub.error` and say
  the SyncHub connection is not verified. A zero pending count or
  `lastError: null` is not success because an empty queue performs no push.
- `configured: false` → continue.
- Connection refused, 404, or 503 immediately after restart → retry every
  three seconds for about 30 seconds before diagnosing the worker.

## 2. Connect through the installer

Ask the user to run this in their own terminal:

The rest: https://github.com/thedotmack/claude-mem/blob/HEAD/plugin/skills/cloud-sync/SKILL.md
