Why I Version Control My AI Experiments
aigitexperiments

Why I Version Control My AI Experiments

Marcus Webb
Marcus Webb
July 7, 2026·
3 min

I used to run a dozen propmt variations, find one that worked, and have no idea which change actually did it. So now I version control my AI experiments with git, the same way I version code. Every tweak gets committed, and that audit trail turned a pile of lucky guesses into something I can retrace on purpose. The win is not tidiness, it is being able to answer why a result happened.

The problem with untracked tweaks

AI work is full of small edits: a reworded prompt, a different model, a nudged temperature. Without history, a result you cannot reproduce is just a rumor you tell yourself. Git gives every version a hash, so I can point at the exact state that produced a given output and return to it later. The hash is the difference between a story and a fact, and AI work has far too many stories already.

What I commit

  • The prompt files, organized in a dedicated directory by task
  • The config that ran them: model, temperature, and any seed I set
  • A meaningful commit message, never just "updated prompt" with no context

The seed matters more than people expect. Setting one makes runs consistent, and logging it next to the commit hash means I can rebuild a result months later. (When two runs disagree, the common advice is to diff the logs, and the cause is usually a version or config change hiding in plain sight.)

Branches make experiments cheap

I spin up a branch for each line of experimentation. If it works, I merge it; if it flops, I throw the branch away with zero guilt and no mess left behind. That single habit removed my fear of breaking a setup I liked, because the good version is always one checkout away. Cheap experiments mean I run more of them, which is the whole point, and more attempts is how you find the good ones.

Reproducibility as a feature

Linking each result back to a commit creates an honest record of what produced what. It is the same instinct behind letting AI run my workflow for a week and actually being able to explain the outcome afterward. A result I cannot reproduce is not a result. It is a coincidence I got lucky with exactly once, and luck is a terrible thing to build a workflow on. Git turns the lucky version into a permanent one I can return to whenever I need it.

This content was created with the help of AI. Contact TXTrepo if you find inaccuracies.