Back up and migrate your Claude Code setup (~/.claude) safely across machines and accounts. Cross-platform, pure Python stdlib, MIT licensed.
SaferSkills independently audited claude-vault (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A cross-platform, zero-dependency tool that snapshots Claude Code's ~/.claude and safely restores conversation history and config to a new environment after an account ban, machine move, or account switch.
claude --resume can't find / no longer shows my past sessions"The script lives at scripts/vault.py. Run it with the system Python (3.8+; nothing to pip install):
python3 scripts/vault.py <subcommand> [options]
python3 scripts/vault.py --help # overview
python3 scripts/vault.py status # current snapshots + auto-backup statusSymlink the repo into~/.claude/skills/to use it as a skill in any session; the script itself runs from anywhere. UI language follows the system locale (English default, Chinese on azh*locale); override withCLAUDE_VAULT_LANG=en|zh.
After the new account is signed in to Claude Code:
# 1) Preview first (dry-run by default — never touches ~/.claude)
python3 scripts/vault.py restore /path/to/claude-vault-XXXX.tar.zst
# 2) Check the on-screen summary and the manifest (~/.claude-vault/manifests/), then apply
python3 scripts/vault.py restore /path/to/claude-vault-XXXX.tar.zst --apply
# 3) Restart Claude Code; `claude --resume` should now list the historyRestore automatically:
.credentials.json, and keeps the new machine's accountfields in .claude.json (oauthAccount / userID), so it won't break the new login or re-link the banned account.
slug from the real cwd recorded inside the session, rewriting that cwd when needed so claude --resume finds it.
python3 scripts/vault.py backup # snapshot now
python3 scripts/vault.py schedule --time 03:00 # daily at 03:00 (macOS launchd / Linux cron)
python3 scripts/vault.py schedule --uninstall # turn it offSnapshots go to ~/.claude-vault/snapshots/, keep the newest 14, and exclude login credentials by default (no tokens shipped to git/cloud).
Non-ASCII project paths often collapse several directories into one slug, so claude --resume mixes them up or loses them. Fix it without any backup:
python3 scripts/vault.py rehome # dry-run: list what would move where
python3 scripts/vault.py rehome --apply # apply after review| Subcommand | Purpose | Safe defaults |
|---|---|---|
backup | Pack ~/.claude into a snapshot | no credentials; keep newest 14 |
restore | Restore from a snapshot to a new machine / account | dry-run; protects login; auto pre-restore snapshot |
rehome | Re-file mislocated sessions by real cwd | dry-run; writes a manifest |
status | Show snapshot & auto-backup status | read-only |
schedule | Install / remove daily auto-backup | — |
restore and rehome are dry-run by default — they only print a plan + write a manifest; --apply performs it.restore --apply snapshots the current ~/.claude first, so it's reversible.backup --include-credentials (same account, same user, just a new machine) includes them.~/.claude-vault/manifests/ for line-by-line auditing..tar.* files private.Claude stores each conversation as ~/.claude/projects/<slug>/<id>.jsonl, where <slug> is the working directory with every non-[A-Za-z0-9] character (including / and CJK) replaced by -. Moving machines or using non-ASCII paths makes the slug mismatch or collide, so sessions become "unfindable" — the tool repairs this using the real cwd recorded inside each session. See README.md and scripts/vault.py --help for details.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.