Use when users want to save, backup, copy, export, or version control their Claude Code configuration files (commands, skills, agents) from ~/.claude/ to another directory...
This skill helps users backup their Claude Code configuration files from ~/.claude/ to a specified target directory. It copies the commands/, skills/, and agents/ directories with options for selective backup.
By default, this skill backs up three directories from ~/.claude/:
These are the user-created configurations that define custom Claude Code behavior.
Use this skill when users want to:
Follow this workflow when performing a backup:
Always confirm the target directory, even though the default is the current working directory. Ask like this:
"Target directory: [current-working-directory]
Is this correct, or would you like to specify a different location?"
Wait for user confirmation before proceeding.
Ask the user which directories to include. Present this interactive prompt:
"Which directories would you like to backup?
- commands/
- skills/
- agents/
Backup all three, or specify which ones to include?"
If the user doesn't specify, backup all three. If they specify a subset, only backup those.
Use the backup script located at scripts/backup.sh within this skill directory. Execute it with appropriate parameters:
~/.claude/skills/config-backup/scripts/backup.sh [target-dir] [directories...]
Parameters:
target-dir: Target directory (default: current directory if not specified)directories...: Space-separated list of directories to backup (commands, skills, agents)The script will:
rsync if available (efficient copying), otherwise fallback to cp -r~/.claude/ doesn't existAfter the backup completes, show the user a detailed list of what was copied:
ā
Backup complete!
Copied directories:
- commands/ (15 files)
- skills/ (8 directories, 42 files)
- agents/ (23 files)
Target: /path/to/target/directory
If any errors occurred during the backup (permission errors, missing source, etc.), report them clearly to the user.
The backup script handles these scenarios:
Creates the directory automatically. No user action needed.
If ~/.claude/ doesn't exist, the script exits with error message:
ā Error: Source directory ~/.claude/ not found
If target directory isn't writable, shows:
ā Error: Permission denied writing to [target-dir]
Automatically falls back to cp -r command. User sees:
ā ļø rsync not available, using cp instead
User: "save my claude settings"
Assistant: "I'll backup your Claude configurations.
Target directory: /Users/choi/work/claude-config Is this correct, or would you like to specify a different location?
Which directories would you like to backup?
Backup all three, or specify which ones to include?"
[User confirms]
[Executes backup, reports results]
User: "backup my commands and skills"
[Asks about target directory, then only backs up commands/ and skills/]
User: "copy ~/.claude to ~/backups/claude-config"
[Asks for confirmation, then backs up to ~/backups/claude-config]
The backup script is at: ~/.claude/skills/config-backup/scripts/backup.sh
rsync -av --delete for efficient copying with deletion of orphaned filescp -rf if rsync unavailablemkdir -pThe backup preserves this structure:
target-dir/
āāā commands/
ā āāā command1.md
ā āāā command2.md
āāā skills/
ā āāā skill1/
ā āāā skill2/
āāā agents/
āāā agent1.md
āāā agent2.md
references/troubleshooting.mdexamples/backup-workflows.mdscripts/backup.sh