Track your coding agent’s config in a dotfiles repo. I did this using git with GNU Stow, and it helps me in two ways: I can roll back a skill that broke after one edit too many, and I can clone my setup on a new dev machine with one command.
Here’s how you can do the same.
Your AI config is a codebase now
“Claude Code config” used to mean a settings file and maybe a CLAUDE.md. Mine now holds skills, hooks, plugins, slash commands, subagents, workflows, and MCP server definitions. I’m probably forgetting a few. Dozens of files with a new one added every time a new capability is shipped.
Models and coding agents change fast, and naturally your workflow changes with them. Every release means another round of tweaked prompts and updated skills. At some point this stopped being configuration and became a small codebase. Almost all of it is plain text and JSON in one directory, which makes it a perfect candidate to manage with source control.
Rollback when things break
One edit too many and you wish you had a way to roll back the changes you made. Imagine you have your own version of the Lyra prompt, and you make incremental changes, but decide to roll back a few versions – having this setup would save you from losing your work up until that point.
You find a skill someone shared, customize it, and keep tuning it for weeks. One day it starts failing and you can’t remember what it looked like back when it worked. It gets worse when you let AI draft or update the skill itself (Claude editing Claude’s config) and the new version is suddenly broken.
Without version control, you lose your work with the latest update, but with git it’s git diff to see what changed and git revert to get back to the version that worked. This has saved me more than once.
New machine, one command
Easier machine migration is what made dotfiles popular in the first place, and it counts double now. Your shell aliases and editor config already travel this way. Add ~/.claude to the repo and your whole AI setup lands on a fresh machine with a single script, instead of you re-teaching Claude Code your workflow from scratch.
What are dotfiles?
Dotfiles are the hidden config files in your home directory: .zshrc, .gitconfig, and now .claude/. A dotfiles repo is a small git project that holds all of them, plus a script to link or copy them into place. Your machine’s personality, versioned. If you want to see how mine is structured, you can see it on GitHub (yurikoval/dotfiles).
How to manage your dotfiles
There are many ways to do this, and any of them beats nothing.
The simplest is git init inside ~/.claude and committing as you go, but you’re only tracking Claude’s configs. Atlassian recommends a bare repository with your home directory as the work tree, which skips symlinks entirely. If you’d rather have tooling, yadm is a dotfiles manager that wraps git with per-machine alternates and encryption built in.
I stuck with GNU Stow. Stow symlinks packages from your dotfiles repo into your home directory: stow claude links ~/.claude into place, and stow -D claude removes it cleanly.
The tool matters less than the habit. Commit before you experiment, especially before you let AI rewrite its own config, and every failed iteration is one git revert from gone.