2026

April 14, 2026

aig: Version Control Built for How AI Writes Code

Git was designed for humans typing code line by line. AI changed that. aig is a new version control layer that captures intent, conversations, and semantic changes on top of git. Here's why I built it and how it works.

S
Sascha Becker
Author

7 min read

aig: Version Control Built for How AI Writes Code

aig: Version Control Built for How AI Writes Code

A few weeks ago I was reviewing a PR that Claude Code had written for me. Forty files changed. The diff was a wall of green and red. The commit message said "refactor auth module." I knew what changed. I could read the code. But the reasoning was gone. Why JWT over sessions? Why HS256 over RS256? The conversation where we discussed those tradeoffs was closed. The decision architecture that produced the code had evaporated.

This happens every day now. AI writes code fast. Git records what changed. But nobody records why.

So I built aig.

The Problem

Git was designed in 2005. Humans typed code, thought about it, and committed it with a message. That model held up for 20 years. But AI-assisted development breaks three assumptions git depends on:

AI changes are too big to review. When an AI restructures 30 files in eight seconds, the diff is useless for human review. You can't tell what matters and what's mechanical. You end up rubber-stamping it because the cognitive load is too high.

Commit messages are even more useless. They were already an afterthought when humans wrote every line. With AI, they're completely disconnected from reality. "refactor auth module" tells you nothing about why JWT was chosen over sessions, why HS256 was picked over RS256, or what alternatives were considered.

The conversation is lost. The richest context in AI-assisted development is the human-AI dialogue. The constraints you stated, the approaches you rejected, the tradeoffs you accepted. All of that disappears when the chat window closes. git blame tells you who changed a line six months ago. But that person was prompting an AI. They barely remember the conversation.

What aig Does

aig layers on top of git. Every aig repo is still a valid git repo. You can push, pull, branch, merge. But aig adds three things git doesn't have:

Intent tracking

Before you write code, you declare what you want to accomplish:

bash
aig session start "Add JWT authentication"

This creates an intent record before any changes are made. The "commit message" is written first, not after the fact. When you're done, you checkpoint:

bash
aig checkpoint

No message needed. aig auto-generates it from the semantic diff: "added generate_token, added validate_token, added AuthMiddleware". The code tells its own story.

Semantic diffs

Instead of line-based red/green, aig shows what changed in the code's structure:

--- src/auth.py (semantic)
  + added `generate_token`
  + added `validate_token`
  ~ modified `authenticate`
--- src/middleware.py (semantic)
  + added `require_auth`

Functions added, classes removed, parameters modified. Supports TypeScript, Python, Rust, Go, Java, C#, C++, and Ruby. All powered by tree-sitter AST parsing.

Conversation capture

aig auto-captures AI conversations into the version history. Claude Code is detected automatically. For other tools (Cursor, Copilot, etc.), export the conversation to a JSONL file and run aig capture --file chat.jsonl. When you end a session, any detected conversation is saved alongside the code. No manual effort.

Later, anyone can ask:

bash
aig why src/auth.py:42

And get the full chain: the intent, the semantic changes, and the conversation notes that explain the reasoning.

How I Built It

I built aig in a single Claude Code session. The irony is not lost on me: the tool designed to track AI-assisted development was itself AI-assisted from the first line.

The stack:

  • Rust for the core CLI. Fast, cross-platform, single binary.
  • Tree-sitter for multi-language AST parsing and semantic diffing.
  • SQLite for the intent graph, sessions, checkpoints, and conversations.
  • Git notes for remote sync. aig push and aig pull transfer metadata alongside your code.
  • TypeScript for the LLM integration layer (Anthropic SDK for smart import).

The session that built aig itself was captured by aig. 98 conversation entries from this very dialogue are stored in the version history. That's the proof of concept: the tool works on itself.

Real Output From aig's Own Repo

Here's what it actually looks like. This is real output from running aig on the repo that contains aig itself.

aig log instead of git log

Where git log gives you a flat list of commit hashes, aig log groups by intent:

[44d3ab98] Rewrite docs for first-time visitors (active)
         7 checkpoint(s) | 2026-04-14
           (120ab1ee) Rewrite docs for first-time visitors
           (3e8142a2) Add Daily Workflow guide
           (ed3a9c5c) Add aig repair for rebase/cherry-pick
           (635eb923) Add Related Tools page
           (d802ad6a) Make checkpoint message optional
           (c0b46ad4) Update docs: checkpoint message is optional
           (2528a1a0) Fix CI: configure git identity for sync tests

[479d2692] Initial commit (active)
         12 checkpoint(s) | 2026-04-14
           (43ed4568) Initial commit
           (fd990ede) Add aig MVP: intent-based version control with docs site
           (6b42cef6) Add auto-generated CLI reference and CI sync check
           (7564dcaa) Complete the core loop: semantic changes, IPC, 18 tests
           (6bdca120) Add conversation capture, file watching, cargo install
           (7975e6d3) Add remote sync: aig push/pull via git notes
           (9ee934f1) Add 4 languages, aig review, incremental import
           ...

Two intents instead of 19 flat commits. You can see the narrative: first the MVP was built, then the docs were rewritten for visitors.

aig why instead of git blame

Ask why any file exists:

$ aig why crates/aig-core/src/capture.rs:1

crates/aig-core/src/capture.rs:1

  Intent:     [479d2692] Initial commit
  Checkpoint: Add conversation capture, file watching, and cargo install support
  Commit:     6bdca120
  Time:       2026-04-14T01:06:24+00:00

Compare that to git blame capture.rs which would just show 6bdca120 (Sascha Becker 2026-04-14). Same data, zero context.

aig checkpoint with auto-generated messages

No more writing commit messages. aig reads the semantic diff and writes it for you:

$ aig checkpoint

  auto-message: added generate_token, added validate_token, added AuthMiddleware
  semantic:
    + added generate_token (auth.py)
    + added validate_token (auth.py)
    + added AuthMiddleware (auth.py)
Checkpoint created
  message:    added generate_token, added validate_token, added AuthMiddleware
  intent:     Add authentication
  git commit: 8d5b5ff9
  checkpoint: 1d88ab07ccc1

The code describes its own changes. You just type aig checkpoint.

aig diff --semantic instead of line diffs

Instead of 300 lines of red and green:

$ aig diff --semantic

--- auth.py (semantic)
  + added `generate_token` -- added function `generate_token`
  + added `validate_token` -- added function `validate_token`
  ~ modified `authenticate` -- modified function `authenticate`
--- middleware.py (semantic)
  + added `require_auth` -- added function `require_auth`

Four lines that tell you everything. Functions added, functions changed. No noise.

The Workflow

Here's what daily development looks like with aig:

bash
aig session start "Fix payment timeout bug"
# ... work with AI ...
aig checkpoint # auto: "modified connect, added pool_limit"
aig checkpoint # auto: "added test_payment_timeout"
aig session end # auto-captures Claude Code conversation
git push && aig push # share code + context

Your teammate later:

bash
git pull && aig pull
aig why src/payments.py:87
# Intent: "Fix payment timeout bug"
# Semantic: modified `connect`, added `pool_limit`
# Conversation: "Root cause was missing connection pool limit..."

No Slack archaeology. No guessing. The reasoning is right there.

Try It

aig is open source and works on any existing git repo:

bash
cargo install --git https://github.com/saschb2b/ai-git.git aig-core
cd your-repo
aig import # builds intent graph from git history
aig log # browse intents instead of flat commits
aig why src/app.py:42 # trace any line to its intent

Four commands. Non-destructive. Your git history is untouched.

What's Next

aig today is an MVP with 17 commands, 8 languages for semantic diff, remote sync, Claude Code integration, and file watching. The roadmap includes semantic merging, trust scoring, a TUI review interface, and IDE extensions.

But the core thesis is proven: version control needs to capture why code changes, not just what changed. The AI writes the code. The human provides the intent. The tool's job is to make sure the connection between the two is never lost.


S
Written by
Sascha Becker
More articles