Restore Config
npx machina-cli add skill OhJuhun/claude-backup-sync/restore-config --openclawRestore Config
Restore Claude Code config from GitHub backup repository to local machine.
Trigger
User says: "restore config", "pull config", "sync from backup", "/restore-config"
Steps
1. Read backup config
CONFIG_FILE="$HOME/.claude/scripts/backup-config.json"
REPO=$(python3 -c "import json; print(json.load(open('$CONFIG_FILE'))["repo"])")
BRANCH=$(python3 -c "import json; print(json.load(open('$CONFIG_FILE')).get("branch", "main"))")
CLONE_DIR="$HOME/.claude/backup-repo"
2. Clone or pull latest from backup repo
if [ \! -d "$CLONE_DIR/.git" ]; then
gh repo clone "$REPO" "$CLONE_DIR" -- -b "$BRANCH"
else
git -C "$CLONE_DIR" pull --rebase origin "$BRANCH"
fi
3. Ask user what to restore
Ask the user which categories to restore using AskUserQuestion (multiSelect):
- Claude settings (settings.json, CLAUDE.md)
- MCP config (.mcp.json)
- Agents, Rules, Commands
- Skills
- HUD config
- Scripts
- Dotfiles (.zshrc, .gitconfig, .ssh/config)
- Brewfile
- All of the above
4. Restore selected files
Copy files from $CLONE_DIR/claude/ back to ~/.claude/:
claude/settings.json→~/.claude/settings.jsonclaude/CLAUDE.md→~/.claude/CLAUDE.mdclaude/.mcp.json→~/.claude/.mcp.jsonclaude/agents/→~/.claude/agents/claude/rules/→~/.claude/rules/claude/commands/→~/.claude/commands/claude/skills/→~/.claude/skills/claude/hud/→~/.claude/hud/claude/scripts/→~/.claude/scripts/.zshrc→~/.zshrc.gitconfig→~/.gitconfig.ssh_config→~/.ssh/config
For Brewfile: brew bundle install --file="$CLONE_DIR/Brewfile"
5. Warn about MCP config
IMPORTANT: .mcp.json contains ${ENV_VAR} placeholders instead of real API keys.
Tell the user they need to set the actual environment variables after restore.
6. Report result
Report in Korean:
- Number of files restored
- Source repository
- Any warnings (e.g., MCP env vars need setup)
Source
git clone https://github.com/OhJuhun/claude-backup-sync/blob/main/skills/restore-config/SKILL.mdView on GitHub Overview
Restores Claude Code configuration from a GitHub backup repository onto your local machine. It reads backup-config.json to locate the repo and branch, clones or updates the backup into the home-based directory, and then lets you selectively restore categories like settings, MCP config, agents, rules, skills, HUD, scripts, and dotfiles. It also warns that MCP placeholders require real environment variables after restoration.
How This Skill Works
It reads CONFIG_FILE to extract the repo and branch, defaulting to main. It clones or pulls the backup repo into CLONE_DIR using gh repo clone or git pull, then prompts you to select which Claude configuration categories to restore. It copies the chosen files from CLONE_DIR/claude/ to the corresponding destinations in the home directory and, if present, runs Brewfile restoration with brew bundle install, while flagging MCP env-var placeholders that must be set by the user.
When to Use It
- After reinstalling your workstation to rehydrate Claude Code settings from the backup repository.
- When you need to pull the latest configuration from the backup to keep settings up to date.
- When you want to selectively restore categories such as settings, MCP, agents, rules, and scripts instead of a full overwrite.
- When you want to restore dotfiles and HUD scripts for a personalized environment.
- When you also want to install Brewfile dependencies from the backup with brew bundle install.
Quick Start
- Step 1: Read backup config from $HOME/.claude/scripts/backup-config.json to determine REPO, BRANCH, and CLONE_DIR.
- Step 2: Clone or pull the backup repo into CLONE_DIR using gh repo clone or git pull while respecting the BRANCH.
- Step 3: When prompted, select categories to restore and copy files from CLONE_DIR/claude to their destinations; review the MCP env var warning.
Best Practices
- Back up your current ~/.claude before restoring to avoid overwriting work.
- Verify backup-config.json accurately points to the correct repo and branch.
- Review the category selections in the multiSelect prompt before restoring.
- After restore, check MCP placeholders and set the corresponding environment variables.
- Test Claude Code after restore to confirm settings, agents, and skills load correctly.
Example Use Cases
- Restore claude/settings.json and CLAUDE.md after a clean install.
- Sync MCP config and agents from backup to a new workstation.
- Restore dotfiles like .zshrc and .gitconfig to a personalized environment.
- Restore scripts and HUD settings from backup and install Brewfile.
- Pull the latest backup and update claude/skills to align with team standards.