If you use Cursor, Claude Code, or Codex, you probably have user-level rules, skills, and commands you’ve built up over time. The stuff that makes your setup yours.
Project-level configs are fine. Your .cursor/rules folder gets committed to the repo. Same with AGENTS.md. But user-level configs? They live in ~/.cursor, ~/.claude, ~/.codex. They don’t get backed up anywhere.
I realized this when I was thinking about what would happen if my laptop died. All my custom skills and commands would be gone.
How I do it
I added these to my existing dotfiles repo. A simple Python script copies the configs to the repo, and a launchd job runs it daily. If there are changes, it commits and pushes.
./sync.py backup # copy configs to dotfiles
./sync.py restore # copy from dotfiles to system (new machine)
The gotcha
Some of these files have secrets or machine-specific stuff. ~/.cursor/mcp.json stores MCP server configs with API keys. ~/.codex/config.toml has project trust paths that won’t make sense on another machine. I gitignore those and set them up manually on new machines.
Took maybe 5-10 minutes to set up using Cursor CLI. I should really sleep now. Goodnight!
Want to set this up?
Paste this into your coding agent:
Add my AI tool configs (~/.cursor/rules, ~/.cursor/skills-cursor, ~/.cursor/commands, ~/.claude/skills, ~/.codex/skills, ~/.codex/rules) to my dotfiles repo. Create a Python sync script with backup/restore commands. Skip files with secrets (mcp.json, auth.json, config.toml). Set up daily auto-backup with launchd (macOS) or cron (Linux).