logoalt Hacker News

Git for the US Code

237 points • by alansaber • today at 1:47 AM • 117 comments • view on HN

Comments

kfogel • today at 4:42 AM

NYT, 2007:

"... Think of what version control software could mean for the Congress [...]. If bills were created under a system where strike-throughs and additions were carefully tracked, the public would know which legislator made which change to a proposed piece of legislation as it made its way through the Capitol.

At last, there would be transparency in the legislative process. Best-case scenario, it would shame legislators from inserting language against the public interest and only meant to reward political contributors; at worst, it would make such insertions public and allow the voters to punish the politicians who made them. ..."

(from https://www.nytimes.com/2007/07/23/business/media/23link.htm... )

➕ show 4 replies
Ericson2314 • today at 3:14 AM

The Hacker News Community (hah) needs to lobby hard to pass a law (what boostrapping!) to require the https://en.wikipedia.org/wiki/Office_of_the_Law_Revision_Cou... to maintain the repo as part of their duties, and do it retroactively for the entire history of the US Code.

It's a simple idea; it's cheap; there are no outstanding technical questions; it benefits almost everyone. Let's get this done.

➕ show 2 replies
TomAbel • today at 2:55 AM

Reminds me of a similar project for french law

French bills evolution versioned in git and visualized The Law Factory: french bills as git, opendata and dataviz https://www.lafabriquedelaloi.fr/

"Law is Code" on The Law Factory: french bills as git, opendata and dataviz - https://news.ycombinator.com/item?id=7817357 May 2014 (0 comments)

➕ show 1 reply
pcblues • today at 3:14 AM

I hadn't thought of using git to track the changes in legislation. This is a cool idea.

In Australia, I spent a bit of time trying to work out how to find which politician voted for what (both at state and federal level), so that when elections come, you can single out the individuals who voted for what legislation. I think AI may make this easier, but the challenge is in not spamming the "free and open" access to the online record of our legislation.

So far, it's probably a one-person $50K per year job to do this task manually, and the language of the public legislation record didn't lend itself easily to determining the laws or rights that actually changed when bills were passed into legislation. They are explicitly stated, but hard to distill with regexes, filters or other analysis tools (e.g. "Who voted to stop electric scooters going over 25km/h?") If you try reading the legislation, you will know what I mean.

"A complete and open record of the proceedings of our parliament" still needs people spend a good chunk of time interpreting and summarising it (e.g. the media, commentators, etc) which means it's a time-consuming hobby or a paid gig.

➕ show 3 replies
demibabs • today at 5:06 AM

When I read AI-generated text, my eyes just start glazing over… it really is hard to read.

The idea is cool though.

➕ show 2 replies
aizk • today at 4:23 AM

If you're like me and also eager for cool uses for git, I'll share a cool one I use -- try out git for your resume! Commits change as you progress in life, and make branches for individually tailored resumes.

Blew my mind when I realized I could do that.

ekns • today at 7:34 AM

I'm doing this as open source for all amendment-driven law for the world. Finnish/Estonian law basically solved now but US/UK are a lot more complex to do correctly for some reason.

Now major version coming within 1 month probably with many architectural changes. The thesis is that it's basically all doable as a compiler but there may be certain cases which are irreducibly ambiguous and need human/AI to adjudicate them. The rest must be deterministic.

https://github.com/eliask/lawvm

holtwick • today at 7:11 AM

German Constitution "Grundgesetz" on Github with proper time stamps https://github.com/c3e/grundgesetz

burnJS • today at 3:02 AM

I had this idea over 10 years ago but never finished it. I hope this takes off. I do fear it's not very practical for many big pieces of legislation which are often written in secret.

➕ show 3 replies
alancm • today at 8:21 AM

there's such a system that's been deployed in various jurisdictions in the US called the archive framework: https://github.com/openlawlibrary/taf

it was built by academics deeply familiar with the security and usability of git and secure tools.

scronkfinkle • today at 7:00 AM

I've been working on this problem for several months now: https://www.wordstodata.com/

A surprising amount of tracking and diffing in legal texts is actually very different to git. It's a trap to assume software version control fits the needs for legal work.

barrrrald • today at 3:11 AM

Cool idea but I can't find anywhere on the linked page to try it? It reads like a neat concept but it's not clear if this is a thing they've actually made or not (or am I just missing something super obvious?)

LPisGood • today at 3:31 AM

Wow! This is very cool. I had an idea for something very similar to this when I found out the US federal government offered API keys, maybe three or four years ago. I found that while Congress did list bill revisions as they were made the format and retrieval of these was not an easy task. The idea was that I wanted to look at any line of any bill and see who proposed it that particular line’s inclusion.

For the record, and feel free to steal it if you like it, I called it “G(overnm)it-blame”

➕ show 1 reply
mushufasa • today at 2:33 AM

I'm not an expert in this domain but I'm aware there has been prior work to attempt this. I'd appreciate if someone knowledgeable could post some of that context.

➕ show 2 replies
cco • today at 7:19 AM

Given that chicken scratch in the margins gets into bills that are voted upon, it seems unlikely that this would be accepted by Congress. Love it though.

timwis • today at 6:39 AM

DC did this years ago, too: https://github.com/DCCouncil/law-xml

Someone set it up for Philly and Baltimore too, but I can't seem to find it.

nico • today at 4:33 AM

I love this, and I feel every legal document (of which there are many, for example, a random one: insurance companies' policies) should have something like this (and no, Word is not good for it)

Does it already exist?

zoobab • today at 6:44 AM

I proposed Git and Markdown instead of XML for EU law making in the European Parliament, they went with their own custom web editor to manupilate XML. And failed.

xlayn • today at 3:01 AM

YES PLEASE, but I suspect it will degenerate into another paid service with 1000 tiers... I think you cannot access the US law without paying for it? odd... I will wait for claude law to appear and hope they share the torrent...

➕ show 1 reply
7kago_yomi • today at 2:46 AM

Unlike code, natural language laws have many exceptions and context dependencies, so trying to manage them cleanly with Git seems like it would be tough as data structuring costs and exception handling (hardcode-style responses) increase.

➕ show 3 replies
bad_username • today at 6:35 AM

Law is programs running on humans.

alanwreath • today at 5:14 AM

I wonder if there are any public sources for any of this data at a federal level? And do any of them still hold the older now versions?

omoikane • today at 4:40 AM

See also:

https://news.ycombinator.com/item?id=47625366 - United States Code (federal laws) in Git (2026-04-03, 15 comments)

https://news.ycombinator.com/item?id=47621591 - Every Law a Commit – US Law in GitHub (2026-04-02, 32 comments)

I think it's parsing this data:

https://uscode.house.gov/download.html

Which was discussed here:

https://news.ycombinator.com/item?id=6135504 - The entire US Code is now online in XML (2013-07-31, 237 comments)

adamdennis • today at 3:55 AM

Wasn’t this one of the original pitches for blockchain?

➕ show 1 reply
jcranmer • today at 3:39 AM

I think it's useful to link to a lawyer's take on the utility of a similar tool that was built by somebody else here: https://bsky.app/profile/questauthority.bsky.social/post/3mj...

The tl;dr is that doing git-style change-tracking of the legislation isn't as helpful in practice as you'd think (especially because a lot of the very basic change-tracking is already available in the existing tools that lawyers use!).

layla5alive • today at 3:53 AM

Being able to git blame politicians and such would be very useful indeed (at first..) :-)

➕ show 1 reply
AustinDev • today at 5:06 AM

AI explainer videos are actually pretty good. Good usage.

counters • today at 3:10 AM

Major party foul for not calling this "legitslate"

noja • today at 4:47 AM

It’s a nice idea, but isn’t it a bit pointless if the law is not being applied?

yieldcrv • today at 3:55 AM

I put a lot of thought into this last decade, I find that some bills are big blocks of new text, and other bills are convoluted instructions to modify other blocks of existing law, sometimes saying "strike this word and that word" other times referencing just a subsection of another law. hyperlinks to that other law or a model of what the legal code would look like is necessary

Agentically this could be done now, but it would still just be the tip of the iceberg

You're looking at quantum states of law and regulations, and that's just for one jurisdiction

NoMoreNicksLeft • today at 4:30 AM

Without 64-bit time though, can't use it historically. Since current legislation is always changes built upon legislation from long before unix epoch, it kind of falls flat.

nomilk • today at 6:24 AM

Brilliant! Now do it for companies' T&Cs please!

bottled_poe • today at 5:09 AM

> Deepseek, refactor this repo to simplify the code. Make no mistakes.

ericfrederich • today at 5:03 AM

... And the tax code written in Python

octoberfranklin • today at 2:29 AM

Fraudulent title, you can't git-clone this.

➕ show 2 replies
iAMkenough • today at 3:03 AM

Sounds neat, but not something a private company should be responsible for.

If transparency is the goal, the entire codebase for this should be public domain and not profitable. Otherwise there's a profit motive to rewrite history.

sundayexport • today at 3:43 AM

[flagged]

miltonlaxer • today at 6:47 AM

[dead]

orliesaurus • today at 4:09 AM

[flagged]

reserve • today at 3:45 AM

[dead]

infogulch • today at 2:44 AM

[dead]

lily121 • today at 5:38 AM

[dead]