Claude Settings Split
Base claude/.claude/settings.json must remain profile-neutral. Machine-specific configs belong in claude-profiles/claude_personal.json, claude-profiles/claude_work.json, or claude-profiles/claude_homelab.json.
Mergeable keys (hooks, enabledPlugins, permissions) combine automatically across base and profile settings.
This skill assumes the preset-based file-naming convention (claude_personal.json, claude_work.json, claude_homelab.json) and will not apply as-is to a repository that uses a different naming scheme for profile settings.
Procedure
- Target: Ask user if target is
personal,work, orhomelab(don't guess). - Diff: Check
git diffandgit diff --stagedforclaude/.claude/settings.json. Identify what moves vs. what stays. - Merge: Edit
claude-profiles/claude_<target>.json(treat{}as valid base). Copy fragments verbatim:hooks.<Event>: Append new blocks to the array. Do not overwrite existing entries.enabledPlugins: Add new keys. Leave existing alone.permissions/ scalars: Set key. If conflict exists, ask user.- Changed existing keys: Ask user (not a pure additive move).
- Clean Base:
- Entire diff moving:
git checkout -- claude/.claude/settings.json - Partial move: Manually remove the moved fragment (reference
git show HEAD:claude/.claude/settings.json).
- Entire diff moving:
- Validate:
python3 -m json.tool claude/.claude/settings.json >/dev/null python3 -m json.tool claude-profiles/claude_<target>.json >/dev/null - Show Results: Run
git diffon both files.
Gotchas
- Paths: Rewrite hardcoded
/home/<user>/...to"$HOME/..."(requires double quotes for expansion). - Git: Leave results unstaged. Never commit unless explicitly asked.
- Stow: No need to re-run stow (files are stowed folded).