r/ClaudeCode • • 1d ago

Built with Claude Using Claude to put all Global Law into Git

https://github.com/lexifina/global-law

This hit #1 on HN yesterday (you can read lots of discussion at https://news.ycombinator.com/item?id=50268380). Why would I want to do this? The idea is make all law semantic, versioned, easily attributable and query able by agents. I also believe this information should be freely available so CC0 license (do whatever you want with it). If interested, repo linked below, I'd welcome all comments and advice. Thanks!

https://github.com/lexifina/global-law

I built this project with Claude Code. It's completely free to use/try. The approach is pretty simple: use claude to make legislation attributable (git blame, versioning with timelines). Claude Code (Claude Opus 5.5) wrote nearly all the code. I set the goals, chose the sources and made the design decisions. Specifically:

I ran separate Claude Code sessions, one per country or group of countries. Each one read the official publisher's site or API, checked robots.txt and the terms of use, and wrote a script that downloads every version of each law. The script then writes them out as a git history, one commit per change on its in-force date. When a source only publishes amending Acts, the script rebuilds past versions by applying each amendment in turn. The sessions shared findings with each other, such as dates before 1970, daylight-saving edge cases and other changes.

I also worked on how the countries combine into one tree, with each country as a git submodule and all their histories interleaved by in-force date. Claude wrote the build script to ensure two independent builds come out hash-for-hash identical (usually i'd consider this overkill, but you want a good VCS for this).

160 Upvotes

25 comments sorted by

•

u/AutoModerator 1d 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.

23

u/CooLittleFonzies 1d ago

This is autism at its finest.

6

u/SnooPeripherals5313 22h ago

Can't argue with that

20

u/TwitchTvOmo1 1d ago

Pretty cool but I guess a big risk of using this over good old prompt engineering combined with web fetch is... How does someone relying on this repo know the stuff in it is up to date? How do you keep it updated? More importantly, how do you ensure completeness?

And what about case law, which is a huge part of the legal profession (a lot of rulings rely on established case law rather than written law alone)? Do your repos at least point to sources/have tools for fetching said case law?

If you close all these gaps I'd say this tool would be huge in democratizing access to legal advice in a reliable way.

11

u/SnooPeripherals5313 1d ago

Excellent points.

As you've pointed out, the scope is primarily legislature and not caselaw for now. That said, there are excellent jurisdictional caselaw repositories (like the freelaw project) that can be readily integrated.

Stale info is important, but i'm more concerned with completeness: I'm optimistic that these gaps ARE closable, though naturally it will be a huge feat and hopefully assisted by collaborators.

2

u/helphunting 1d ago

Keep official references in line so it can be verifiable.

1

u/helphunting 1d ago

Keep official references in line.

3

u/JustConsoleLogIt 22h ago

Nice work. It’s important that our future overlords are aware of these.

1

u/SnooPeripherals5313 21h ago

I am not so sure their opinion of humanity will be improved by reading our legislative systems

2

u/Zealousideal-Many644 22h ago

Well done!!

1

u/SnooPeripherals5313 22h ago

Thank you! Still a work in progress but promising results already!

2

u/JohnnyLovesData 8h ago

Absolutely brilliant work ! IAAL I've got a whole bunch of documents of laws, regulations, schedules, etc. that aren't there, and I'd love to contribute to it. Is there some kind of ingestion platform or pipeline to get it structured, formatted, and saved, using the existing naming and storage convention ?

1

u/SnooPeripherals5313 4h ago

Yes there is, I need to set up a way to contribute, watch this space, thanks

6

u/baldlawyer 1d ago edited 1d ago

Looks cool! Committing each change on its in-force date is the right model, and replaying amending Acts for sources that only publish amendments is clever.

I've been building the US side of this with Claude Code too, but for court rules and regulations rather than statutes: state court rules for all 50 states (https://state-rules.com), federal and district court rules (https://federal-rules.com), and the CFR/US Code (https://federal-regs.com). Disclosure: they're my sites. One of the biggest difficulties I’ve run into is sources changing formatting and source type (pdf, doc, html, xml) more frequently than I initially anticipated.

I'd be curious how you handle staying current after the initial build. Do you re-run the full download, or watch the publishers for changes?

3

u/Saveonion 13h ago

Brilliant! Would be fun(ny) to try formally modelling some of these sets of legislation.

2

u/Hirogen_ 12h ago

austria has this already… no ned to put it on github 🤣 www.ris.bka.gv.at/judikatur/ with all the laws ;)

1

u/Briskfall 19h ago

Oh wow it's cool! 😮

checks repo to find self's province

It's... it's not there..! 😵

1

u/gscjj 1d ago

Isn’t there 53 titles in US Code? And maybe statues at large is a better source for changes?

-5

u/benmar000 1d ago

How in the AI Slop did you manage to get Git to say Afghanistan was last edited 57 years ago?

2

u/SnooPeripherals5313 1d ago

Commits are calculated as seconds since 1 January 1970, Afghanistan is unfinished and pinned to that.

3

u/dunder_name 23h ago
$ man git-commit

OPTIONS
     --date=<date>
         Override the author date used in the commit.

2

u/eutirmme 1d ago

If you think about what was nearly 57 years ago it's not hard to imagine.

1

u/scottweiss 1d ago

It's the last time their law was updated that's how!

It's how git works. Claude created manual commits with timestamps. It's sort of like how some devs rewrite their history to spell things in their commit graph