← Back to blog
AiAbout 6 min read

Someone put the world's law into git, so you can blame a statute

Published Nov 21, 2026
Someone put the world's law into git, so you can blame a statute

A version control system for legislation sounds like a joke about lawyers until you try to answer a simple question: what did this clause say in May 2022, and which act put it there?

Most legal publishers answer with a PDF and a date. global-law answers with git log. The project, from lexifina, appeared on 28 October 2026 as an expansion of the same idea applied to the US Code, which had reached the top of Hacker News on the same day. It had 2,155 stars by 21 November.

One commit, one law

The design is strict and it is the whole idea. In a country's repository, each commit represents one law taking effect, written by that law. In case law repositories, each commit is one decision on the day it was decided. Git's own model, where a commit has an author, a message and a position in history, maps onto legislation better than a database row does.

The tree is organised by jurisdiction:

global-law/
├── manifest.json          every corpus: path, repo, history, coverage, dates
├── jurisdiction.json      the world, and the jurisdictions in it
├── germany/bund/acts/     a country's law (submodule)
├── germany/brandenburg/acts/
├── argentina/buenos-aires/salto/acts/
├── germany/bgh/caselaw/
└── tools/                 law.py, the MCP server, countries.py

Each body of law is its own repository, and global-law holds them as submodules, moving each forward to its latest commit. That is why a city can have its own acts folder and a court can have its own caselaw folder without the main repository becoming a monolith.

The subtle part is ordering. Commits are not necessarily made in the order laws took effect, because a publisher may add historical text later. So the tools read an In-force date from each commit and order versions by that, not by commit time. Anyone who has tried to reconstruct a legal timeline from a document management system will recognise this as the correct fix.

Five commands that answer real questions

The README lists the questions and the commands side by side, which is the fastest way to understand what this is for.

QuestionCommand
Every change to 11 U.S.C. §1182, with the law that made eachlaw.py log united-states/federal/usc/title-11/1182.md
Which law wrote each line of it today?law.py blame 2026-01-01 …/1182.md
The text as in force on 1 May 2022law.py show 2022-05-01 …/1182.md
What changed between two dateslaw.py diff 2022-05-01 2022-07-01 …/1182.md
The last law in force in every country on a daylaw.py world 1990-10-03

That last one is the demo that sells the project. world 1990-10-03 asks for the last law in force in every country on the day of German reunification. Whether the data is complete enough to answer it well is a separate question; the fact that the question can be phrased as a command tells you what the structure buys.

blame is the other one worth thinking about. In code, blame tells you who last touched a line, which is often useless and occasionally decisive. In law, blame tells you which act introduced the phrase you are arguing about. That is the actual research task, done in one command, with a commit you can open.

A long row of identical cloth-bound statute volumes on a shelf, one volume pulled out slightly, a thin paper slip marking a page.

Git is the API

The tools are a convenience. The repository is the product, and it works without them:

git -C united-states/federal/usc log -- title-11/1182.md

That sentence matters for longevity. A bespoke legal database dies when its vendor does. A git repository survives as a tarball, a clone, a mirror on someone's NAS. Because the aggregate repo is CC0, you can fork it, ship it in a product, and never ask permission, though the law text inside each country repository stays under that repository's own terms.

The assistant hook

There is a public MCP server at https://global-law.lexifina.com/mcp. Add it to Claude or ChatGPT and the assistant can search the record, pull a provision as of a date, and compare versions. The site also offers prefilled "ask Claude" and "ask ChatGPT" links, a plain search page with no account, and a JSON search endpoint with no key.

Locally, opening the clone in Claude Code, Cursor, VS Code or Codex starts an MCP server with the same tools. So the same corpus can answer a lawyer's question through a chat window and a developer's question through a script, without a second copy of the data.

Self-hosting in two commands

All it takes is git and Python:

git clone --depth 1 https://github.com/lexifina/global-law && cd global-law
python3 tools/countries.py add united-states/federal/usc
python3 tools/law.py show 2022-05-01 united-states/federal/usc/title-11/1182.md

countries.py add initialises a submodule for the jurisdiction you want. You do not have to clone the world; you can clone the countries you care about, which is the difference between a 50 GB problem and a 200 MB one.

What the project admits

The manifest carries a history field per corpus, and the README says plainly that where a publisher keeps only today's text, or only each law as first enacted, the corpus says so.

That honesty is the most important thing on the page, because coverage is the whole value proposition. A jurisdiction whose publisher only offers consolidated current text gives you a single commit and a blame that tells you nothing. A country with no machine-readable source might not be there at all. The dates in manifest.json are the first thing to read before trusting any answer.

Three other limits.

This is not legal advice, and no amount of tooling changes that. A confident show output is a text retrieval, not a legal opinion; whether that text governs your situation depends on amendments, repeals, court decisions and jurisdiction.

Model output on top of legal text is a known hazard. An assistant that can cite a provision will also sometimes cite one that does not say what it claims. The commit hash makes a citation verifiable, which is better than a bare quote, and verification is still your job.

Translation is not in scope. The corpus is the text as published, in the publisher's language. Cross-border research still runs through a human or a model that you have to check.

Why this is a good shape

Legal tech has spent two decades building proprietary databases with proprietary query languages and proprietary citation graphs. This project takes the opposite position: the law is public, so store it in the most boring, most forkable format available, and let the diff do the work.

Git was built for source code that changes line by line while the artifact has to keep working. Legislation is exactly that. The fact that nobody shipped this earlier is a comment on how legal publishing is funded, not on whether it is possible.

Related articles