--- sidebar_position: 2 --- # backup Create, list, and manage backups of target directories. ```bash skillshare backup # Backup all skill targets skillshare backup claude # Backup specific target skillshare backup agents # Backup all agent targets skillshare backup --all # Backup skills + agents skillshare backup --list # List all backups skillshare backup --cleanup # Remove old backups skillshare backup --delete 2026-01-19_10-00-00 # Delete one backup skillshare backup files # Versions of single files skillshare rewrote ``` ## When to Use - Create a manual backup before risky changes - List existing backups to check recovery options - Clean up old backups, or delete one you no longer need - Get back an earlier version of a file such as `AGENTS.md` or `CLAUDE.md` ## Automatic Backups Backups are created **automatically** before: - `skillshare sync` (skill targets and agent targets) - `skillshare sync agents` (agent targets only) - `skillshare target remove` Location: `~/.local/share/skillshare/backups//` (global), `.skillshare/backups/` (project mode, agents only) Retention is applied automatically after each automatic backup, using the same policy as `--cleanup`. You do not need to prune snapshots by hand. ## Commands ### Create Backup ```bash skillshare backup # All targets skillshare backup claude # Specific target skillshare backup --dry-run # Preview ``` ### List Backups ```bash skillshare backup --list ``` ``` All backups (15.3 MB total) 2026-01-20_15-30-00 claude, cursor 4.2 MB ~/.local/share/.../2026-01-20_15-30-00 2026-01-19_10-00-00 claude 2.1 MB ~/.local/share/.../2026-01-19_10-00-00 2026-01-18_09-00-00 claude, cursor 4.0 MB ~/.local/share/.../2026-01-18_09-00-00 ``` ### Cleanup Old Backups ```bash skillshare backup --cleanup # Remove old backups skillshare backup --cleanup --dry-run # Preview cleanup ``` Default cleanup policy: - Keep last 10 backups - Remove backups older than 30 days - Cap total size at 500 MB The newest snapshot is always kept, even when it alone exceeds the size cap — you are never left without a restore point. This same policy runs automatically after every `sync`, so `--cleanup` is only needed to prune on demand. ### Delete a Backup ```bash skillshare backup --delete 2026-01-19_10-00-00 # Delete one snapshot skillshare backup --delete 2026-01-19_10-00-00 --dry-run # Show what would be deleted skillshare backup --delete 2026-01-19_10-00-00 -p # From the project's .skillshare/backups/ ``` The timestamp is the folder name shown by `--list`. The whole snapshot is deleted, including every target in it. ### File History {#file-history} Before skillshare rewrites or replaces a single file — an instruction file such as `AGENTS.md` or `CLAUDE.md`, or a location of a [shared file](/docs/how-to/daily-tasks/sharing-instructions#backups) — it saves the old content. `backup files` lists and restores those versions. ```bash skillshare backup files # Files with saved versions skillshare backup files show ~/.claude/CLAUDE.md # Versions of one file, newest first skillshare backup files restore ~/.claude/CLAUDE.md origin skillshare backup files restore ./CLAUDE.md 1769000000000000000.shim --dry-run ``` ``` Versions of /Users/me/.claude/CLAUDE.md 1769000000000000000.edit 2026-01-21 12:53:20 history/edit 2.1 KB # Team rules drift:1768900000000000000.mode 2026-01-20 09:06:40 drift/mode 1.9 KB # Team rules origin 2026-01-10 08:00:00 origin 1.2 KB # My notes ``` Each version has an ID: | ID | Kind | Meaning | |----|------|---------| | `