Backup Setup skill for Claude

Set up, check, or restore local claude-mem database snapshots.

When Claude uses it

Use when the user says "set up backups", "back up my memories", "backup status", or "restore my database".

Backup Setup SKILL.md

The full skill file from thedotmack/claude-mem (Apache-2.0).

Backups (local snapshots)

The installed worker snapshots ~/.claude-mem/claude-mem.db on a schedule (VACUUM INTO, consistent while sessions run) and keeps the newest N under ~/.claude-mem/backups/auto/. Each snapshot is one standalone SQLite file. Snapshots stay on this machine.

Preserve every unrelated setting and keep ~/.claude-mem/settings.json mode 0600. Never print the file's contents: it holds credentials.

Routing

Based on $ARGUMENTS:

  • setup or empty: 1. Check status, then 2. Enable snapshots
  • restore: 3. Restore
  • status: 1. Check status only

1. Check status

npx claude-mem backup status
  • Snapshot details printed: backups run. Report the last snapshot time, the snapshot count and any last error; stop unless the user asked for a change or a restore.
  • "Automatic backups are not enabled": continue to step 2 if setting up.
  • A "Last restore" line reports the outcome of the most recent restore.
  • "Worker is not running": start it with npx claude-mem start and retry.
  • "Unknown command: backup" or "Backup status failed: HTTP 404": this claude-mem (CLI or running worker) has no backup support yet, so the worker would ignore the backup settings. Stop. Tell the user that backups are not available in their installed version and that npx claude-mem update brings them once a release includes them. Do not write the settings in step 2, and never say backups are on.
  • Any other failure ("Backup status failed: HTTP" with another status, "Backup request failed: ...", "Backup status failed: invalid JSON response", "Backup status failed: unexpected response") or any output not listed here: stop. Show the user the exact error line, do not write the settings in step 2, and never say backups are on. Do not suggest an update: this is an error in a version that has backups, not a missing feature.

2. Enable snapshots

Ask (or default): interval in hours (default 24, range 1 to 168) and how many snapshots to keep (default 7, range 1 to 100). Then write the settings without echoing anything else in the file:

node - <<'EOF'
const fs = require('fs'), os = require('os'), path = require('path');
const intervalHours = 'PASTE_INTERVAL_HOURS_HERE'; // e.g. '24'
const retainCount = 'PASTE_RETAIN_COUNT_HERE';     // e.g. '7'
const dir = path.join(os.homedir(), '.claude-mem');
const file = path.join(dir, 'settings.json');
fs.mkdirSync(dir, { recursive: true });
const settings = fs.existsSync(file) ? JSON.parse(fs.readFileSync(file, 'utf8')) : {};
const target = settings.env && typeof settings.env === 'object' ? settings.env : settings;
target.CLAUDE_MEM_BACKUP_ENABLED = 'true';
target.CLAUDE_MEM_BACKUP_INTERVAL_HOURS = intervalHours;
target.CLAUDE_MEM_BACKUP_RETAIN_COUNT = retainCount;
fs.writeFileSync(file, JSON.stringify(settings, null, 2) + '\n', { mode: 0o600 });
fs.chmodSync(file, 0o600);
console.log('backups enabled: every ' + intervalHours + 'h, keeping ' + retainCount);
EOF

Restart the worker so the schedule starts, then confirm with step 1. Tell the user backups are on only when that status reports them enabled:

npx claude-mem restart
npx claude-mem backup status

The first automatic snapshot lands about five minutes after the worker starts. To take one now:

npx claude-mem backup run

3. Restore

npx claude-mem backup list
npx claude-mem restore <file>
npx claude-mem backup status

restore stages the snapshot and restarts the worker (it also starts a worker that is not running). The new worker swaps the database in before it opens it, saves the database it replaced in the same folder as claude-mem-<timestamp>-pre-restore.db (restore that file to undo; it counts toward the retain count), and records the outcome. With cloud sync on, the restored database resumes syncing from the snapshot's position and can pull back changes that reached the cloud after it. backup status then prints a "Last restore" line: on success it names the saved copy; on failure it gives the reason, and the worker kept the database it had.

4. Report

Report the snapshot count, the last snapshot time, any error, and the last restore outcome if there was one.

How to install Backup Setup

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit thedotmack/claude-mem/plugin/skills/backup-setup#main ~/.claude/skills/backup-setup

Codex

npx degit thedotmack/claude-mem/plugin/skills/backup-setup#main ~/.codex/skills/backup-setup

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Backup Setup skill do?

Set up, check, or restore local claude-mem database snapshots. Use when the user says "set up backups", "back up my memories", "backup status", or "restore my database".

+How do I install Backup Setup in Claude Code?

Copy the skill folder into ~/.claude/skills/backup-setup, for example with "npx degit thedotmack/claude-mem/plugin/skills/backup-setup#main ~/.claude/skills/backup-setup". Claude Code loads it automatically and uses it when a task matches.

+Does Backup Setup work with ChatGPT or Codex?

Yes. Backup Setup uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/backup-setup. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Backup Setup free?

Backup Setup is published on GitHub by thedotmack under the Apache-2.0 license, which allows free use.

Related devops & cloud skills

  1. Supabase

    Official

    Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron,…

    supabase/agent-skills★ 3.1k
  2. Senior Architect

    System architecture decisions with a written rationale: monolith vs microservices, database choice, scaling limits, ADRs, Mermaid diagrams.

    alirezarezvani/claude-skills★ 30k
  3. Vercel Deploy

    Official

    Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the…

    openai/skills★ 29k
  4. Cloud Sync

    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…

    thedotmack/claude-mem★ 118k
  5. Mem Setup

    This skill should be used when the user asks to "set up claude-mem", "pair claude-mem", "connect cmem", "add my cmem key", "set up cloud…

    thedotmack/claude-mem★ 118k
  6. Connect

    Connect Claude to any app. Send emails, create issues, post messages, update databases - take real actions across Gmail, Slack, GitHub,…

    ComposioHQ/awesome-claude-skills★ 80k
  7. Cellprofiler

    Runs reproducible CellProfiler microscopy pipelines for nuclear segmentation, cell counts, and per-object fluorescence measurements.

    K-Dense-AI/scientific-agent-skills★ 58k
  8. Database Lookup

    Queries documented public database APIs with explicit endpoints, filters, pagination, and provenance.

    K-Dense-AI/scientific-agent-skills★ 58k
  9. Ginkgo Cloud Lab

    Guides protocol selection, input preparation, pricing checks, and browser ordering on Ginkgo Bioworks Cloud Lab (cloud.ginkgo.bio).

    K-Dense-AI/scientific-agent-skills★ 58k

See all devops & cloud skills →

More skills from thedotmack

  1. Build And Release

    Fully automate building and releasing a coding task.

    thedotmack/claude-mem★ 118k
  2. Ccs Align

    Run the CCS Align seat's hourly breathing cycle — prove the local claude-mem worker is healthy, pull needle observations through search →…

    thedotmack/claude-mem★ 118k
  3. Childhood

    Babysit a shipped release after merge, publication, or deployment.

    thedotmack/claude-mem★ 118k

All skills by thedotmack →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.