skills/backup/SKILL.md
Run Kopia-based backups of key Windows files and config to an external drive. Use when the user says "back up", "run a backup", "snapshot", "the backup drive is plugged in", or wants to set up / configure backups for the first time. Handles initial repo setup, drive detection by volume label, source enumeration, and snapshot creation with structured exclusions.
npx skillsauth add rdfitted/claude-code-setup backupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Primary backup workflow. Handles setup (first-time repo init) and run (snapshot the configured sources to the connected external drive).
For verify / maintain / mirror / restore / top-up operations, use the backup-ops skill instead.
The user may say:
If unclear, default to run if a config exists, otherwise setup.
Kopia must be installed. Check with kopia --version. If missing:
winget install --id Kopia.KopiaUI (bundles GUI + CLI; CLI binary lives at %LOCALAPPDATA%\Programs\KopiaUI\resources\server\kopia.exe and must be added to user PATH manually). For CLI-only, use Kopia.KopiaCLI.Config file: ~/.claude/backup-config.json (see template at end of this file). If missing, run setup first.
Backup drive must be plugged in. Detection is by volume label, not drive letter — letters are not stable.
Get-Volume to see current labelsSet-Volume -DriveLetter X -NewFileSystemLabel "RyanBackup" (X = current letter)$vol = Get-Volume -FileSystemLabel "RyanBackup" -ErrorAction Stop
$drive = "$($vol.DriveLetter):"
kopia repository create filesystem --path "$drive\KopiaRepo" --password "..."
Use --persist-credentials so future connects don't need the password interactively. Kopia stores it in Windows Credential Manager.~/.claude/backup-config.json (see template below) with the drive label and source list.~/.claude/backup-config.json. If missing, route to setup.kopia repository connect filesystem --path "<drive>:\KopiaRepo"
(Credentials should be persisted; if not, prompt user.)kopia snapshot create "<path>" --description "auto-backup <ISO timestamp>"
Run snapshots sequentially, not in parallel — Kopia handles its own parallelism internally and concurrent snapshots can lock the repo.~/.claude/backup-logs/<ISO date>.log:
/backup-ops verify after every Nth backup (e.g., weekly)kopia snapshot list --all --max-results 20 — show recent snapshotskopia repository status — show repo size, last maintenance, etc.~/.claude/backup-logs/ and surface last-run timingSuggest these for the config — let the user accept/reject each:
High-value, low-volume (always include):
C:\Users\USERNAME\.claude — Claude Code config, hooks, commands, client memoryC:\Users\USERNAME\.ai-docs — global wiki + mainbrainC:\Users\USERNAME\.ssh — SSH keys (critical, encrypted in repo)C:\Users\USERNAME\.aws — AWS credentialsC:\Users\USERNAME\.azure — Azure credentialsC:\Users\USERNAME\.gemini — Gemini config (shared by gemini + antigravity CLIs)C:\Users\USERNAME\.codex — Codex configC:\Users\USERNAME\.cursor — Cursor configC:\Users\USERNAME\.config — generic dotconfigC:\Users\USERNAME\.gitconfig — git config (single file — Kopia handles files fine)C:\Users\USERNAME\CLAUDE.md — personal personaC:\Users\USERNAME\AGENTS.md, GEMINI.md — other persona filesC:\Users\USERNAME\.claude.json, .claude.json.backup — active Claude configMedium-volume:
C:\Users\USERNAME\DocumentsC:\Users\USERNAME\DesktopC:\Users\USERNAME\plansC:\Users\USERNAME\scriptsC:\Users\USERNAME\binLarge but worth it (project work):
C:\Users\USERNAME\Code ProjectsC:\Users\USERNAME\CodeProjects (duplicate of above? — ask user)D:\Code ProjectsAudit and ask the user:
C:\Users\USERNAME\dev, app, src, ai, archon, big-3-super-agent, ccflare, goose, mcp-replicate, nanoclaw — top-level project-ish dirs at home rootC:\Users\USERNAME\Proposal Creation Platform, Applegate — looked work-relatedAlready cloud-synced (probably skip but ask):
Dropbox, OneDrive, Creative Cloud Files...Credential files at home root (sensitive — include but flag):
.cli-m365-*.json (M365 CLI tokens, per memory notes).replitcli.json, .npmrc, .botoKopia uses .kopiaignore files and policy-based excludes. Configure in setup via:
kopia policy set --global \
--add-ignore "node_modules" \
--add-ignore ".venv" \
--add-ignore "__pycache__" \
--add-ignore ".pytest_cache" \
--add-ignore "dist" \
--add-ignore "build" \
--add-ignore ".next" \
--add-ignore ".turbo" \
--add-ignore ".cache" \
--add-ignore "*.pyc" \
--add-ignore ".DS_Store" \
--add-ignore "Thumbs.db" \
--add-ignore "*.log" \
--add-ignore "tmp" \
--add-ignore "*.tmp"
Never back up at root:
~/.cache, ~/.npm, ~/.pnpm, ~/.bun, ~/.cargo, ~/.rustup, ~/.m2, ~/.gradle, ~/.nuget, ~/.electron-gyp, ~/.local, ~/npm-cache~/.docker, ~/.minikube, ~/.skaffold~/.playwright-mcp, ~/.browser-driver-manager, ~/.wdm~/.pytest_cache, ~/IntelGraphicsProfiles~/tmp, ~/scratch, ~/logs~/tmpclaude-* files~/node_modules (yes, there's one at home root — exclude it)kopia policy set --global \
--keep-latest 10 \
--keep-hourly 24 \
--keep-daily 14 \
--keep-weekly 8 \
--keep-monthly 12 \
--keep-annual 3
~/.claude/backup-config.json){
"tool": "kopia",
"repo": {
"type": "filesystem",
"drive_label": "RyanBackup",
"repo_subdir": "KopiaRepo"
},
"secondary": {
"enabled": false,
"type": "s3",
"bucket": "",
"endpoint": "",
"drive_label": ""
},
"sources": [
"C:\\Users\\RDuff\\.claude",
"C:\\Users\\RDuff\\.ai-docs",
"C:\\Users\\RDuff\\.ssh",
"C:\\Users\\RDuff\\.aws",
"C:\\Users\\RDuff\\.azure",
"C:\\Users\\RDuff\\.gemini",
"C:\\Users\\RDuff\\.codex",
"C:\\Users\\RDuff\\.config",
"C:\\Users\\RDuff\\.gitconfig",
"C:\\Users\\RDuff\\CLAUDE.md",
"C:\\Users\\RDuff\\.claude.json",
"C:\\Users\\RDuff\\Documents",
"C:\\Users\\RDuff\\Desktop",
"C:\\Users\\RDuff\\plans",
"C:\\Users\\RDuff\\scripts",
"C:\\Users\\RDuff\\Code Projects",
"D:\\Code Projects"
],
"hot_sources_for_top_up": [
"C:\\Users\\RDuff\\.claude",
"C:\\Users\\RDuff\\.ai-docs",
"C:\\Users\\RDuff\\plans"
],
"restore_mappings": {
"source_paths": []
},
"log_dir": "C:\\Users\\RDuff\\.claude\\backup-logs"
}
restore_mappings for cross-machine restoresConsumed by the restore skill (/restore wikis) to handle source/target path differences and project name drift when restoring from a backup created on a different machine. Leave source_paths: [] (the default) for same-machine restores or when source and target naming are identical.
Example for a target machine (ryanlaptop) restoring from a source machine (mainframe) that named projects differently:
"restore_mappings": {
"source_paths": [
{
"source": "D:\\Code Projects",
"target": "C:\\Users\\RDuff\\Code Projects",
"project_name_map": {
"GVB ERP": "gvb",
"Ultra Building Solutions": "ultrabuildingsolutions",
"TOG - ERP": "tog-erp",
"the og main brain": "ogmainbrain",
"TOG PM Assistant": "ogpmbrain"
}
}
]
}
See skills/restore/SKILL.md § "Cross-machine name mapping" for the full semantics. This block is only read by restore; backup ignores it.
backup-ops maintain.~/.claude/backup-logs/ with ISO-date filenames.development
Restore from the Kopia backup repo in one of two opinionated modes. **wikis** (frequent, default) syncs per-project `.ai-docs/` directories from backup to local project trees — used to move compound-knowledge wikis between machines via the backup drive as sneakernet. **full** (rare) restores all sources to original paths for greenfield machine rebuild. Use when the user says "restore wikis", "sync wikis from backup", "pull the wikis", "I plugged in the backup drive on this machine", "rebuild this machine", "greenfield restore", or "restore everything". For ad-hoc single-file restores, use `backup-ops restore` instead.
documentation
# /bp-iterate Iterate the Fitted Business Plan(s). Manages the **internal canonical** and the **external partner/investor variant**, snapshot-on-version-bump lineage, redaction enforcement between variants, and cross-document coupling. ## When this runs - User says `/bp-iterate`, "iterate the BP," "bump the BP," "update the business plan," "version up the BP," "create / update / refresh the external variant" - A material trigger fires per the BP's own Iteration Log (first 2 new closes / fundi
testing
Secondary backup operations against the Kopia repo — verify integrity, run maintenance/prune, mirror to a second destination, restore files/folders, or run a quick top-up snapshot of hot directories. Use when the user says "verify backups", "check backup integrity", "prune old snapshots", "restore from backup", "mirror backups to cloud", "quick backup", "top up the backup", or asks about backup health. For the primary backup run, use the `backup` skill instead.
development
Session-start ritual that establishes a learning heartbeat. Detects Tier 1 (code project with .ai-docs/) vs Tier 2 (home directory / institutional mode), loads minimal context, then schedules a recurring CronCreate heartbeat that periodically captures learnings to the appropriate target — project-level learnings.jsonl OR the global wiki at ~/.ai-docs/wiki/. Invoked automatically at session start (after the wiki/project-dna read in ~/CLAUDE.md) or manually via /start.