Manages dotfiles using chezmoi's three-state model (source/destination/target). Covers file attributes, templates, run scripts, ignore rules, and safe dry-run verification.
Ships in supermodel-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
chezmoi manages dotfiles using a three-state model: source (declared in ~/.local/share/chezmoi), destination (current home directory), and target (computed desired state). Running chezmoi apply updates destination to match target.
# IMPORTANT: Always use --dry-run --no-pager with the following commands
# They print to stdout so without --no-pager they'll hang indefinitely in a subshell that the user has to clean up
# And they can drastically affect the system (especially `apply`) so agents can only dry-run
# These flags are hard required in settings
chezmoi diff # Preview changes, large changesets will hang in pager so use flag
chezmoi apply # Apply changes to home directory [agents can only dry-run]
chezmoi data # Show template variables
chezmoi doctor # Diagnose issues
chezmoi managed # List managed files
# The following are generally user managed commands
chezmoi add ~/.bashrc # Add file to management
chezmoi edit ~/.bashrc # Edit source file
[!IMPORTANT] Always use dry-run and no-pager flags, even if you think they might not be necessary. They are harmless if not needed, and they will save destructive changes or hanging shells leftover for the user to fix. Commands that start with
chezmoi --dry-run --no-pagerare automatically approved, while others are gated.
dot_, private_, executable_, .tmpl, etc.). See attributes reference..chezmoi* files control chezmoi behavior. See special files reference.Key principle: Only symlink files that are modified by external tools (package managers, plugin systems, app settings auto-writers). Everything else should use normal chezmoi copy workflow.
Ask: "Will something other than me edit this file?" If yes → symlink. If no → copy.
lazy-lock.json (updated by :Lazy sync), package-lock.json~/.claude/settings.json (edited by Claude Code itself)~/.agents/skills/ + agent-specific paths (targets for skill installation)lazyvim.json (updated by LazyVim framework)init.lua, config.fish, starship.toml~/.claude/rules/*.md{{ if eq .chezmoi.os "darwin" }}Place symlink_ entries at their natural target path. Source files live at repo root in .chezmoiignore.
# Directory structure
dot_config/nvim/
├── init.lua # copied normally
├── lua/plugins/... # copied normally
├── symlink_lazy-lock.json.tmpl # → source-managed lockfile
└── symlink_lazyvim.json.tmpl # → source-managed state file
nvim/ # repo root, in .chezmoiignore
├── lazy-lock.json # actual file (symlink target)
└── lazyvim.json # actual file (symlink target)
Each symlink_*.tmpl file contains a single line:
{{ .chezmoi.sourceDir }}/nvim/lazy-lock.json
The .chezmoiignore prevents chezmoi from also deploying nvim/ as ~/nvim/:
nvim/
This approach keeps the bulk of the config in normal chezmoi workflow while only the specific externally-modified files get symlink treatment. Attributes nest freely — symlink_ works inside dot_config/ or any other prefix directory.
Avoid symlinking a whole directory (e.g., ~/.config/nvim → source) just because one or two files in it are externally modified. This bypasses chezmoi's state management for the entire tree and prevents template processing on any file in that directory.
chezmoi's strength is declarative file management. Prefer static files over dynamic scripts, and copy over symlink.
Decision hierarchy:
dot_ prefix. Use .tmpl for OS/machine branching.symlink_ prefix inline.Scripts are a surface to minimize. Each script is an imperative action that can fail, has ordering concerns, and complicates debugging. If something can be a file, make it a file. Reserve run_once_ and run_onchange_ for truly imperative operations like brew bundle or chsh.
Plugin managers with file-based output (like Fisher for Fish shell) don't need install scripts in chezmoi. If the plugin manager just puts files into a tracked directory, track the output files directly and treat the plugin manager as a manual tool the user runs occasionally.
Templates use Go text/template with the expanded sprig library of functions.
Scripts in .chezmoiscripts/ run during apply. Format: run_[once_|onchange_][before_|after_]<order>-<name>.<ext>[.tmpl].
Hooks run before/after chezmoi commands (not during apply like scripts).
Pull from git repos/archives via .chezmoiexternal.yaml. Refresh with chezmoi apply -R.
chezmoi doctor # Check setup
chezmoi diff # Show pending changes
chezmoi cat ~/.bashrc # Show what would be written
chezmoi execute-template '{{ .chezmoi.os }}' # Test template
chezmoi state delete-bucket --bucket=scriptState # Reset run_once_ tracking
.chezmoi* files and directoriesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/supermodel-skills:chezmoifrom supermodel-skills
npx claudepluginhub gwenwindflower/dotfiles --plugin supermodel-skills22 skills in this plugin
/agent-configCoding agent harness config - Claude Code hooks and settings, Codex config.toml layers, sandbox and approvals, permission profiles, MCP, plugins./analytics-engineeringAnalytics engineering - dbt projects, maintainable SQL as CTE pipelines, event patterns (funnels, sessions, retention, window functions, MATCH_RECOGNIZE)./ascii-animationsASCII and Unicode terminal animations - spinners, logo reveals, particles. Frame loops, character grids, per-character state, performance./browser-automationBrowser automation with agent-browser - navigating, forms, screenshots, scraping, web app QA and dogfooding, Electron apps. Version-matched guides served by the CLI./bunBun runtime - native APIs over Node, bun build --compile, single-file HTML bundles, tsconfig. For repos with bun.lock or bun imports./context-engineeringAgent context - AGENTS.md, CLAUDE.md, rules, memory, skills, subagents. Session capture, codebase and package mapping, zg and ast-grep code search, agentsview history.Other plugins' skills for the same job