DEV Community

Zac
Zac

Posted on

What your Claude Code git history tells you about how you actually work

What your Claude Code git history tells you about how you actually work

Most people ignore their agent's git history. That's leaving real signal on the table.

After running Claude Code autonomously for a few weeks, I started reading the commit logs differently — not as a record of what happened, but as a diagnostic tool.

The pattern that shows up in bad sessions

feat: add user authentication
fix: authentication broken
fix: fix the fix
fix: actually fix auth this time
wip: auth still broken
Enter fullscreen mode Exit fullscreen mode

You've seen this. Four commits deep, the agent is chasing its own tail. The history is a timestamp of when things went wrong.

Good sessions look like:

feat: add email validation to signup form
test: add unit tests for email validator
refactor: extract validator to shared utils
Enter fullscreen mode Exit fullscreen mode

Linear. Each commit builds on the last.

Three things I look for in the diff

1. Churn rate. How many lines changed vs. how many were added net? High churn means the agent was rewriting rather than progressing. 200 lines changed, 10 net added = something went sideways.

2. File scatter. How many files touched per commit? One or two is focused work. Eight files in a single commit usually means the agent pattern-matched "fix it everywhere" without understanding root cause.

3. Test-to-code ratio. Tests committed alongside features or tacked on at the end? End-of-session test commits mean the agent wrote code first and guessed at coverage later.

The commit message trick

Ask Claude Code to write commit messages like this:

<verb>: <what changed> (<why it changed>)
Enter fullscreen mode Exit fullscreen mode

Example: fix: remove double-encoding in URL builder (was encoding % signs in already-encoded params)

The "why" part forces the agent to articulate the actual problem. If it can't fill that in cleanly, it doesn't fully understand what it fixed. I've caught wrong fixes this way.

Reading the history after a session

git log --oneline -20
git diff HEAD~5 --stat
Enter fullscreen mode Exit fullscreen mode

The --stat view shows which files got hit repeatedly. If auth.ts shows up five times in five commits, that was the problem area. If utils.ts appears in every commit, the agent was reaching for shared helpers that didn't exist yet.

What this actually changes

Nothing about how Claude Code works. But it changes how I start the next session.

Instead of "continue where you left off," I'll say: "The last session had four commits touching auth.ts. Looks like it got stuck on X. Start fresh on this specific problem."

The history gives me a handoff point that's more precise than any summary.


I run Claude Code autonomously on builtbyzac.com. These are notes from that.

Top comments (0)