Manage Your Claude Code Config with Dotfiles and GNU Stow

yurikoval1 pts0 comments

Manage Your Claude Code Config with Dotfiles and GNU Stow – Yuri Kovalov

Manage Your Claude Code Config with Dotfiles and GNU Stow

Jul 2, 2026

3 minute read

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.

One warning before you push anything: dotfiles repos are exactly how API keys end up on GitHub. MCP server definitions and .zshrc exports love to collect them. Keep secrets out of the files you track – I wrote up how I manage development secrets on a Mac with Keychain, the 1Password CLI, and direnv.

Written by Yuri Kovalov

Hey There! I'm a software engineer from Ukraine. I specialize in full-stack, API, and test-driven development of web-based applications. I am currently focusing on creating automations using generative AI.

Get in touch

Related posts

Lyra Prompt: A Simple Way to Write Better AI Prompts<br>The Lyra prompt turns ChatGPT or Claude into a prompt optimizer that interviews you, then rewrites your request. An easy way to write better AI prompts.

Monitor Claude Code Token Usage & Cost in the Status Line (Before the AI Bubble Pops)<br>Monitor Claude Code's token usage, rate limits, and cost right in your terminal status line — using a custom statusline script and ccusage.

Improve your Github + Pivotal workflow with git_tracker<br>Pivotal Tracker has a cool feature where it adds your git commit messages related to your story as comments.

claude dotfiles config stow code manage

Related Articles