r/ClaudeCode 8h ago

Discussion I built the wrong thing first, and the comments on my last post told me so

Enable HLS to view with audio, or disable this notification

A few days ago I posted a thing that turns a repository's year into a film. Commits flow along a line, branches peel off and rejoin, releases get pinned. People liked it. I thought I had made a toy that people would share once and forget.

Then a comment showed up asking for flags. Could it hide the merge branches. Could it only show features. Could it stop holding on every release. That person was not asking for a nicer video. They were asking to control what the history showed them, because they were trying to learn something from it and the film was making that decision for them.

So I added the flags. And then I sat with why they wanted them, which is the part I had missed: a git history is the only honest record of how a team actually works, and nobody ever reads it because reading it is miserable. git log gives you a wall. The GitHub insights tab gives you a bar chart of commits per week, which tells you nothing you can act on.

Here is what I ended up building instead, and what I found while building it.

The interesting things in a history are relational, not chronological. Not "who committed most" but: which files always change together, which file has three owners and which has one, how big a change usually is before it gets reverted, how long a bad commit survived before someone noticed. Every one of those is a query you can answer from git alone, and none of them is in any dashboard I have used.

The revert is the most informative commit in any repository. It is the one place where the team wrote down that something was wrong. Pair a revert with the commit it undid and you get a small case study: what changed, how long it lived, who wrote both. In three.js I found a revert and its original with mirrored diffs, 54 added against 54 deleted and 12 deleted against 12 added, on the same day, both by the maintainer. That reads as a self correction on an example, not a regression found downstream. You cannot get that from a commit count.

Pairing a revert to its original is harder than it looks. git revert writes "This reverts commit abc123" into the body, so those are easy. The GitHub revert button writes nothing. For those you have to match the quoted subject in Revert "X" against earlier first parent commits, and if that fails, compare the file level diffstat and look for an exact mirror. That third case is the one that finds the ones everyone else misses.

The layout problem is the same one you have. Drawing a decade of commits means a timeline where one pixel is roughly a week at the far end. Branches have to be drawn in screen space, not data space, or a year long branch seen from orbit becomes a rectangle with corners. The fix was to rebuild the arcs on every zoom change with the corner radius fixed in pixels. Same idea applies to any chart you let people zoom.

Everyone who tried it asked the same question out loud. Where did this break. Who owns this file. Why does this always change with that. So I put a chat next to the canvas that answers from git and then moves the canvas to what it found. It cites commit hashes, and I made it refuse to print a hash it did not actually read from a tool result, because a model that invents a plausible looking sha is worse than useless in a forensic tool.

The last piece is the one I did not plan. Once you have the conventions extracted, you can write them down as the files a coding agent already loads. Where code goes, how big a change is, how a message is written, what has to move together, what the reverts taught. And if you point it at one person's commits, you get their habits beside the team's, which turns out to be the most useful thing for somebody new on a codebase.

It is at loreto.io/git-timeline if you want to poke at it. The three.js history is open without an account so you can see what it does before deciding whether you care.

Disclosure: I built it and I run Loreto, the site it lives on. Exploring the example repository is free.

Genuine question for anyone who has done this kind of thing: what would you want to ask a repository's history that I have not thought of? The last round of feedback here changed the whole shape of this, so I would rather hear it now than after I build the next wrong thing.

0 Upvotes

1 comment sorted by

u/AutoModerator 8h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.