Safe, cross-platform backup & restore for Claude Code.
It snapshots your global and per-project config — settings, MCP, slash commands,
agents, hooks, skills, and conversation history — into a single .tar.gz you
control, and restores it on the same or a new machine.
- Pure
bash+tar/gzip— nojq, Python, Node or Homebrew. - macOS & Linux (works under macOS's system bash 3.2).
- No network, no uploads, no telemetry. Works even without Claude Code installed.
One-liner (downloads sources, installs to ~/.local):
curl -fsSL https://raw.githubusercontent.com/dberuben/claude-code-backup/main/install.sh | bashOr from a checkout:
git clone https://github.com/dberuben/claude-code-backup.git
cd claude-code-backup
./install.sh # → ~/.local (use --prefix to change)Make sure ~/.local/bin is on your PATH, then check your setup:
claude-backup doctorclaude-backup # back up → ~/Backups/claude-code
claude-backup --dry-run # preview only, writes nothing
claude-backup list # list existing backups
claude-backup verify # check the latest archive (gzip + checksum)
claude-restore # restore the latest backup (asks first)Handy flags: --no-history (skip the large projects/ history), --full
(everything), --no-project, --dest <dir>, --strict-secrets, --json.
Full reference: claude-backup --help.
Every backup writes a <archive>.sha256 sidecar; claude-backup verify
re-checks the gzip stream, the checksum and the path safety of an archive.
Backups are local by default. Push them anywhere with a command of your choice —
{} is replaced by the archive path (no extra dependency required):
claude-backup --remote 'cmd:rclone copy {} mydrive:claude/'
claude-backup --remote 'cmd:rsync -a {} nas:/backups/'
claude-backup push --remote 'cmd:aws s3 cp {} s3://bucket/claude/' # push the latestSet CLAUDE_BACKUP_REMOTE to make it the default. A failed push never deletes
the local backup.
claude-backup schedule --daily --at 02:30 # launchd / systemd timer / cron
claude-backup schedule --status
claude-backup unschedulePass options to each scheduled run after --, e.g.
schedule --daily -- --no-history --remote 'cmd:rclone copy {} d:/'.
claude-restore --list-contents # what's inside an archive
claude-restore --only agents,commands # restore just those
claude-restore --only settings --home-onlyCategories: settings agents commands hooks skills mcp claude-md history plugins.
By default a backup includes your config and conversation history, but prunes big regenerable data (plugin code, caches, venvs). Plugin code is not stored — the install manifests are, so you know what to reinstall.
git clone https://github.com/dberuben/claude-code-backup.git
cd claude-code-backup && ./install.sh
claude-restoreRestore validates the archive, shows a plan, asks to confirm, and takes a pre-restore backup first. Some credentials (Keychain / OAuth / env vars) may need re-login afterwards. Details: docs/restore-safety.md.
/plugin marketplace add https://github.com/dberuben/claude-code-backup
/plugin install claude-code-backup@claude-code-backup
Adds /backup, /restore, /backup-status, /backup-doctor. It's a thin
layer over the CLI — the CLI works fine on its own. See docs/plugin.md.
Backups can contain secrets (tokens, API keys, MCP auth, private instructions).
Never commit them to git (the repo ignores *.tar.gz) and store them
encrypted. A heuristic scanner warns about likely secrets; --strict-secrets
turns the warning into a hard stop. Full guidance: SECURITY.md.
claude-backup-banner # compact project / backup status lineConfigure via ~/.claude-backup/banner.conf — see docs/banner.md.
Architecture · Restore safety · Banner · Plugin · Contributing · Changelog
MIT © claude-code-backup contributors.
