Sync files from ~/.claude to claude-code-config repository
Scanned 8/31/2026
Install to Claude Code
npx -y skills add twikus/claude-configuration --skill sync-with-claude --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Sync With Claude?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/twikus-sync-with-claude)More formats (shields.io, HTML) on the badges page.
---
name: sync-with-claude
description: Sync files from ~/.claude to claude-code-config repository
allowed-tools: Bash(cp :*), Bash(diff :*), Bash(ls :*), Bash(cat :*), Bash(mkdir :*), Bash(git status*), Bash(find :*), Bash(date :*), Bash(rsync :*), Bash(rm :*), Bash(bash :*), Bash(chmod :*), Bash(sed :*), Read, Write, Edit
---
# Sync ~/.claude to Repository
Sync configuration files from ~/.claude to claude-code-config folder in this repository.
## Configuration
- **Source**: `~/.claude`
- **Target**: `$CWD/claude-code-config`
## Directories to Sync
1. **commands/** - Slash commands (.md files and subdirectories)
2. **skills/** - Skills (subdirectories with SKILL.md)
3. **agents/** - Agent definitions (.md files)
4. **scripts/** - All script projects (statusline, command-validator, auto-rename-session, claude-code-ai, etc.)
5. **settings.json** - Claude Code settings (hooks, permissions, env)
## Exclusions
Always exclude:
- `node_modules/` - Dependencies (reinstall locally)
- `data/` - Runtime data
- `*.db` - Database files
- `*.log` - Log files
- `bun.lockb` - Lock files
- `.DS_Store` - macOS files
- `melvyn/` - Personal commands (NEVER sync this folder)
**Additional exclusions**: See [references/do-not-copy.md](references/do-not-copy.md) for personal/private paths that must NEVER be copied.
**Protected paths**: See [references/do-not-change.md](references/do-not-change.md) for paths in the target that must NEVER be updated or deleted.
## Process
### Step 1: Read Exclusions
Read both exclusion lists before syncing:
- [references/do-not-copy.md](references/do-not-copy.md) - paths to not copy from source
- [references/do-not-change.md](references/do-not-change.md) - paths to preserve in target
### Step 2: Dry-Run Preview
Run rsync with `--dry-run` to list ALL changes without applying them:
```bash
# Preview commands sync (preserve setup-tmux in target)
rsync -avn --delete --exclude 'melvyn' --exclude 'prompts/setup-tmux.md' ~/.claude/commands/ $CWD/claude-code-config/commands/
# Preview skills sync
rsync -avn --delete \
--exclude 'melvyn-dub-cli' \
--exclude 'melvyn-softcompact' \
--exclude 'variations-generator' \
--exclude '__disabled__' \
~/.claude/skills/ $CWD/claude-code-config/skills/
# Preview agents sync
rsync -avn --delete ~/.claude/agents/ $CWD/claude-code-config/agents/
# Preview scripts sync (preserve .claude/ in target)
rsync -avn --delete \
--exclude 'node_modules' \
--exclude 'data' \
--exclude '*.db' \
--exclude '*.log' \
--exclude 'bun.lockb' \
--exclude '.DS_Store' \
--exclude '.claude' \
~/.claude/scripts/ $CWD/claude-code-config/scripts/
# Preview settings.json diff
diff ~/.claude/settings.json $CWD/claude-code-config/settings.json || true
```
### Step 3: Show Summary & Ask for Confirmation
Present a clear summary of what will be:
- **Added**: New files to be copied
- **Updated**: Modified files to be overwritten
- **Deleted**: Files in target that don't exist in source (due to --delete)
**ASK USER FOR CONFIRMATION** before proceeding. Do NOT sync without explicit approval.
### Step 4: Execute Sync (only after approval)
```bash
# Sync commands (exclude melvyn/ folder, preserve setup-tmux in target)
rsync -av --delete --exclude 'melvyn' --exclude 'prompts/setup-tmux.md' ~/.claude/commands/ $CWD/claude-code-config/commands/
# Sync skills (exclude paths from do-not-copy.md)
rsync -av --delete \
--exclude 'melvyn-dub-cli' \
--exclude 'melvyn-softcompact' \
~/.claude/skills/ $CWD/claude-code-config/skills/
# Sync agents
rsync -av --delete ~/.claude/agents/ $CWD/claude-code-config/agents/
# Sync scripts (with exclusions, preserve .claude/ in target)
rsync -av --delete \
--exclude 'node_modules' \
--exclude 'data' \
--exclude '*.db' \
--exclude '*.log' \
--exclude 'bun.lockb' \
--exclude '.DS_Store' \
--exclude '.claude' \
~/.claude/scripts/ $CWD/claude-code-config/scripts/
# Sync settings.json
cp ~/.claude/settings.json $CWD/claude-code-config/settings.json
```
### Step 4.5: Fix hooks paths in settings.json
**ALWAYS** run the after-sync script to replace hardcoded absolute paths (e.g. `/Users/melvynx/.claude/`) with the portable `{CLAUDE_PATH}/` placeholder:
```bash
bash $CWD/.claude/skills/sync-with-claude/scripts/after-sync.sh $CWD/claude-code-config/settings.json
```
### Step 5: Review & Finish
1. **Review changes** with `git status`
2. **DO NOT COMMIT** - Let the user review and commit manually
## Success Criteria
- All directories synced without errors
- Exclusions properly applied (no node_modules, data, melvyn/, etc.)
- Show git status at the end for user to review
---
User: Sync now #$ARGUMENTS
No comments yet. Be the first to comment!