# Database Backups

Sets up, checks or restores local memory database snapshots.

- 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 backup-setup -g -a claude-code -y`
Codex: `npx skills add thedotmack/claude-mem --skill backup-setup -g -a codex -y`
Cursor: `npx skills add thedotmack/claude-mem --skill backup-setup -g -a cursor -y`
Gemini CLI: `npx skills add thedotmack/claude-mem --skill backup-setup -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add thedotmack/claude-mem`

## Description

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".

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

# 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

```bash
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

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