I Lost My Setup Once. Now It Lives in a Repo.

I Lost My Setup Once. Now It Lives in a Repo.
This week I switched to a new laptop. Nothing dramatic — nothing lost or stolen. Just the old one out, a new one in.
Almost everything moved over on its own. Documents, apps, settings — all saved in the cloud, all there when I logged in. Everything except one folder: my Claude Code config, plus a small file that lists my projects. That stuff was never saved anywhere. So it was just gone, and now I have to set it all up again from memory.
I’d been here before. You don’t notice these things until they’re missing — the shortcuts, the small tweaks, the settings you build up over months and never write down. Then you spend days trying to remember a setup you can’t quite picture.
No use crying over spilt milk. So this time I decided to do it right.
The Quiet Risk
I use Claude Code in my terminal every day. Over time it had become mine — custom hooks, a start-up routine, project settings, a few skills I’d written.
All of it lived in one folder on one laptop: ~/.claude.
The day I moved machines, none of it came with me. Same mistake as last time, just a different folder.
The Fix: My Config Is a Git Repo Now
The answer was obvious once I said it out loud. If my writing lives in a Git repo, why not my setup?
So I turned ~/.claude into a private repo on GitHub. But config folders are messy. They hold old history, cached files, and the odd password. I didn’t want any of that going to the cloud.
The trick was to flip the usual rule. Instead of listing the files to skip, I skip everything, then add back only the safe ones:
/*
!/settings.json
!/hooks/
!/skills/
Now I can’t upload my history or a password by accident. The repo can only ever hold the few files I picked.
The Part I Like: It Backs Itself Up
A backup you have to remember isn’t really a backup. So I made it automatic.
Claude Code can run a small script each time it finishes a task. Mine checks if anything in the config changed. If it did, it saves and uploads the change on its own, quietly in the background:
- Nothing changed? It does nothing.
- Something changed? It saves it with a timestamp and uploads it to the private repo.
I don’t think about it. I change a setting, keep working, and by the time I look up it’s already safe in the cloud.
What This Actually Buys Me
- A new laptop is one command away. Not days of building things back from memory.
- A history of my own tools. I can see how my setup changed over time, and undo a change I regret.
- No passwords in the cloud. The setup makes sure of it.
The Lesson, Again
I keep learning the same thing: the work is safe, but the setup around the work is easy to lose. Your shortcuts, your small tweaks, your little bits of automation — they’re worth saving too.
If a tool lets you save its settings as plain files, put those files in a repo. Make the backup automatic, so you’re never the one who has to remember.
Future you, staring at a blank new laptop, will be glad you did.
Back up your setup, not just your files.
Thanks for reading! If you'd like to share your thoughts send me an email.