managing-dotfiles
Dotfiles Management with GNU Stow
Manage dotfiles tracked in ~/.claude/dotfiles/ using GNU Stow — a symlink farm manager that mirrors directory structure from a source package into $HOME.
Directory Convention
Each package under dotfiles/ mirrors the home directory structure:
dotfiles/
├── tmux/.config/tmux/tmux.conf → ~/.config/tmux/tmux.conf
├── git/.gitconfig → ~/.gitconfig
├── nvim/.config/nvim/init.lua → ~/.config/nvim/init.lua
└── zsh/.zshrc → ~/.zshrc
The package name (e.g. tmux, git) is just an organizational label. The internal directory structure determines where symlinks land.
Adding a New Package
Three steps:
# 1. Create the package directory mirroring $HOME structure
mkdir -p ~/.claude/dotfiles/<pkg>/<path-relative-to-home>
# 2. Move the existing config into the package
mv ~/<path-to-config> ~/.claude/dotfiles/<pkg>/<path-relative-to-home>/
# 3. Stow to create the symlink
stow -d ~/.claude/dotfiles -t ~ <pkg>
Example — adding starship config:
mkdir -p ~/.claude/dotfiles/starship/.config
mv ~/.config/starship.toml ~/.claude/dotfiles/starship/.config/starship.toml
stow -d ~/.claude/dotfiles -t ~ starship
Common Commands
# Stow a package (create symlinks)
stow -d ~/.claude/dotfiles -t ~ <pkg>
# Unstow a package (remove symlinks)
stow -d ~/.claude/dotfiles -t ~ -D <pkg>
# Re-stow (unstow + stow, useful after restructuring)
stow -d ~/.claude/dotfiles -t ~ -R <pkg>
# Dry run (see what would happen without doing it)
stow -d ~/.claude/dotfiles -t ~ -n -v <pkg>
# Stow all packages at once
make dotfiles
Installing Stow
# macOS
brew install stow
# Debian/Ubuntu
apt install stow
# Fedora/RHEL
dnf install stow
Troubleshooting
Conflict: existing target is not a symlink
Stow won't overwrite real files. Use --adopt to pull the existing file into the package, then stow:
stow -d ~/.claude/dotfiles -t ~ --adopt <pkg>
Warning: --adopt replaces the package file with the existing target file. If your package version is newer, back it up first or use git diff after adopting.
Conflict: target is a symlink managed by another package
Two stow packages can't own the same target path. Check which package owns it:
ls -la <conflicting-path>
Then decide which package should own the file and remove the duplicate.
Stow created a directory symlink instead of file symlinks
Stow uses "tree folding" — if a package is the only owner of a directory, it symlinks the directory itself rather than individual files. This is usually fine. If you need file-level symlinks (e.g., because the directory has other non-stowed files), use --no-folding:
stow -d ~/.claude/dotfiles -t ~ --no-folding <pkg>
More from trevors/dot-claude
jj-workflow
Jujutsu (jj) version control, load skill when hook output shows vcs=jj-colocated or vcs=jj in the system-reminder.
93notion-formatter
Format markdown content for Notion import with proper syntax for toggles, code blocks, and tables. Use when formatting responses for Notion, creating Notion-compatible documentation, or preparing markdown for Notion paste/import.
47using-jj
Advanced jj/jujutsu workflows — revsets, absorb, evolog, op restore/undo, immutable_heads bypass, divergent-change resolution, jj split, parallel jj new, conflict-after-rebase, force-push recovery. Contains non-obvious rules (e.g., always `-m` to avoid editor) that prevent broken workflows. Skip for simple commit/push/rebase.
44book-reader
Read and search digital books (PDF, EPUB, MOBI, TXT). Use when answering questions about a book, finding quotes or passages, navigating to specific pages or chapters, or extracting information from documents.
44svelte5
Svelte 5 syntax reference. Use when writing ANY Svelte component. Svelte 5 uses runes ($state, $derived, $effect, $props) instead of Svelte 4 patterns. Training data is heavily Svelte 4—this skill prevents outdated syntax.
39maintaining-claude-code
Create, validate, and improve Claude Code configuration — SKILL.md files, CLAUDE.md, rules, hooks, and settings.json. Use when creating a new skill, writing a SKILL.md, adding a hook, editing rules, auditing skill descriptions, checking config quality, debugging hook behavior, or deciding between skills vs rules vs CLAUDE.md. Also auto-loads when working in ~/.claude/ on skills, rules, hooks, or settings.
32