kit/plugins/settings-sync/skills/settings-restore/SKILL.md
Restores Claude Code settings from a backup git repo. Pulls the latest config to ~/.claude/ with a confirmation step before overwriting. Use when the user asks to restore or import settings.
npx skillsauth add shawn-sandy/agentics settings-restoreInstall 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.
Restore Claude Code user settings from a dedicated backup git repository.
Pulls latest changes, shows a diff summary, and copies files back to
~/.claude/ after user confirmation.
settings-backup instead.Load references/file-manifest.md from the plugin root for the complete list
of files to restore, opt-in targets, and exclusions.
Determine the source repo using this priority order:
$ARGUMENTS or in their
message), expand ~ and use it directly.~/.claude/settings-sync.json. If it exists and
contains a "repoPath" key, use that value.AskUserQuestion to ask the user for the repo
path.If no path can be resolved, output an error and STOP.
Verify the directory exists and is a git repo:
git -C <repo-path> rev-parse --is-inside-work-tree. If it fails, output:
"Not a git repo: <repo-path>. Run settings-backup first to initialize." and
STOP.
Path safety: always quote the resolved repo path in all shell commands (git, rsync, cp, rm) to handle spaces and special characters.
Check if a remote exists: git -C "<repo-path>" remote get-url origin 2>/dev/null.
If a remote exists, run git -C <repo-path> pull --ff-only.
git -C <repo-path> pull manually to sync."
Continue with the local state.Read ~/.claude/settings-sync.json to check for "includeLocalSettings".
Build the list of files to restore from the repo. For each target in the
manifest, check if it exists in <repo-path>:
Always restored (skip if not in repo):
<repo-path>/settings.json → ~/.claude/settings.json<repo-path>/CLAUDE.md → ~/.claude/CLAUDE.md<repo-path>/keybindings.json → ~/.claude/keybindings.json<repo-path>/rules/ → ~/.claude/rules/<repo-path>/commands/ → ~/.claude/commands/<repo-path>/skills/ → ~/.claude/skills/Conditionally restored:
<repo-path>/settings.local.json → ~/.claude/settings.local.json — only
if "includeLocalSettings": trueTrack which files exist in the repo and which are missing.
For each file/directory that exists in the repo, compare against the local
~/.claude/ target:
Files — compare each file:
+ addeddiff -q) → label as ~ modified= unchanged- deletedDirectories — list local and repo files, then classify each:
find on both the repo subdir and the local ~/.claude/ subdir to get
complete file lists, then compare to derive added/modified/unchanged/deleted
counts. (diff -rq alone misses unchanged files and local-only deletions.)rules/ — 5 files (1 new, 1 modified, 2 unchanged, 1 deleted)Present the summary:
Restore preview:
+ settings.json (new)
~ CLAUDE.md (modified)
= keybindings.json (unchanged)
~ rules/ — 5 files (1 new, 1 modified, 2 unchanged, 1 deleted)
+ commands/ — 2 files (2 new)
skills/ — not in backup (skipped)
Important: the --delete flag (rsync) and rm -rf (cp fallback) mean
files that exist locally in rules/, commands/, or skills/ but are not
in the backup will be removed. Always surface these as - deleted in the
preview so the user knows what will be lost.
Use AskUserQuestion:
"Restore these settings to
~/.claude/? This will overwrite existing files and delete local files not present in the backup (see deleted items above)."
Options:
unchangedThis step is always interactive. If running in a context where prompting is not possible, output: "Restore requires interactive confirmation. Run this skill manually." and STOP.
Ensure ~/.claude/ exists: mkdir -p ~/.claude.
Determine the copy method:
command -v rsync >/dev/null 2>&1
If rsync is available:
rsync -aL <repo-path>/settings.json ~/.claude/settings.json
rsync -aL <repo-path>/CLAUDE.md ~/.claude/CLAUDE.md
rsync -aL <repo-path>/keybindings.json ~/.claude/keybindings.json
rsync -aL --delete <repo-path>/rules/ ~/.claude/rules/
rsync -aL --delete <repo-path>/commands/ ~/.claude/commands/
rsync -aL --delete <repo-path>/skills/ ~/.claude/skills/
If rsync is not available (cp fallback):
For each file target: cp -fL <repo-path>/<file> ~/.claude/<file>.
For each directory target, remove then replace to mirror rsync --delete:
rm -rf ~/.claude/<dir> && cp -aL <repo-path>/<dir> ~/.claude/<dir>
If the cp fails after rm -rf, report the error immediately — the user can
re-run restore to recover from the backup repo.
Skip any source that does not exist in the repo — do not error.
If includeLocalSettings is true and settings.local.json exists in the repo,
copy it as well.
If the user chose "Restore new and modified only", skip files/directories where
the diff status was unchanged.
If ~/.claude/settings-sync.json does not exist or repoPath differs, write
it:
{
"repoPath": "/absolute/path/to/repo",
"includeLocalSettings": false
}
Preserve any existing keys.
Output a summary:
Settings restored from <repo-path>.
Restored: <count> files (<list>)
Skipped (not in backup): <list or "none">
Skipped (unchanged): <list or "none">
NOTE: Restored settings take effect after restarting Claude Code.
Restart your session or run `claude` again to pick up the changes.
STOP after this step.
data-ai
Craft-prompt: interviews users and assembles a structured AI prompt using Anthropic best-practice techniques. Use when the user runs /plan-agent:craft-prompt or asks to craft a prompt.
development
Generates a SOCIAL.md project sharing config by analyzing the codebase. Use when asked to set up social sharing preferences or create a SOCIAL.md file.
development
Explains how any project file, component, or concept works. Reads source files and synthesizes developer-friendly principles, social copy, and a dark-mode card. Use when asked 'how does X work' or 'explain X'.
development
Generate an HTML implementation-plan document. Produces a self-contained .html plan file with steps, acceptance criteria, and metadata. Use when the user asks to create a plan document, generate an HTML plan, or write a plan file — not for general planning questions.