This skill should be used when users want to restore, reload, or copy their Claude Code configuration files (commands, skills, agents) from a backup directory back to ~/.claude/...
Restores Claude Code configuration files from a backup directory back to ~/.claude/. Restores the commands/, skills/, and agents/ directories with user confirmation before overwriting existing files.
By default, this skill restores three directories to ~/.claude/:
These are the user-created configurations that define custom Claude Code behavior.
Use this skill to:
Follow this workflow when performing a restore:
Always confirm the source directory, even though the default is the current working directory. Ask this:
"Source 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 restore. Present this interactive prompt:
"Which directories would you like to restore?
- commands/
- skills/
- agents/
Restore all three, or specify which ones?"
If the user doesn't specify, restore all three. If they specify a subset, only restore those.
Critical: Before copying, check if target directories already exist in ~/.claude/. If they do, ask for confirmation:
"ā ļø Target directory commands/ already exists with X files
ā Overwrite commands/ in ~/.claude/?"
Wait for user response (yes/no) before proceeding. If user declines, skip that directory.
Use the restore script located at scripts/restore.sh within this skill directory. Execute it with appropriate parameters:
~/.claude/skills/config-restore/scripts/restore.sh [source-dir] [directories...]
Parameters:
source-dir: Source directory containing backup (default: current directory if not specified)directories...: Space-separated list of directories to restore (commands, skills, agents)The script will:
~/.claude/ exists (error if not)rsync if available (efficient copying), otherwise fallback to cp -rAfter the restore completes, show the user a detailed list of what was restored:
ā
Restore complete!
Restored directories:
- commands/ (15 files)
- skills/ (8 directories, 42 files)
- agents/ (23 files)
Total: 80 files in 31 directories
Target: /Users/username/.claude
If any directories were skipped (either missing from source or declined by user), report them clearly.
The restore script handles these scenarios:
Exits with error message:
ā Error: Source directory /path/to/source not found
If ~/.claude/ doesn't exist, the script exits with error:
ā Error: Target directory ~/.claude not found. Claude Code may not be installed.
This prevents accidentally creating ~/.claude/ in unexpected situations.
If user says "no" to overwrite confirmation, the directory is skipped:
ā Overwrite commands/ in ~/.claude/? no
Skipping commands/
If a requested directory doesn't exist in the source backup:
ā ļø Skipping agents/ (not found in source)
Automatically falls back to cp -r command. User sees:
ā ļø rsync not available, using cp instead
Common restore patterns:
See examples/restore-workflows.md for detailed walkthroughs with complete dialogue.
~/.claude/ doesn't exist rather than creating itThe restore script is at: ~/.claude/skills/config-restore/scripts/restore.sh
rsync -av for efficient copyingcp -rf if rsync unavailablemkdir -pThe restore preserves this structure:
source-dir/
āāā commands/
ā āāā command1.md
ā āāā command2.md
āāā skills/
ā āāā skill1/
ā āāā skill2/
āāā agents/
āāā agent1.md
āāā agent2.md
All files are copied to ~/.claude/ maintaining the same structure.
references/troubleshooting.mdexamples/restore-workflows.mdscripts/restore.sh