| name | managing-dotfiles |
| description | Manage dotfiles tracked in ~/.claude/dotfiles/ using GNU Stow. Use when adding config files to dotfiles, stowing/unstowing packages, or troubleshooting symlink conflicts. |
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:
mkdir -p ~/.claude/dotfiles/<pkg>/<path-relative-to-home>
mv ~/<path-to-config> ~/.claude/dotfiles/<pkg>/<path-relative-to-home>/
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 -d ~/.claude/dotfiles -t ~ <pkg>
stow -d ~/.claude/dotfiles -t ~ -D <pkg>
stow -d ~/.claude/dotfiles -t ~ -R <pkg>
stow -d ~/.claude/dotfiles -t ~ -n -v <pkg>
make dotfiles
Installing Stow
brew install stow
apt install stow
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>