Git for Global Law

The law of 101 countries as 1 git history: every commit is a real law taking effect, so you can read any provision as it stood on any date. CC0, with an MCP server.

Git for Global Law puts each country's law into a git repository where every commit is 1 law taking effect, authored by that law. So git blame tells you which law wrote each line, and a checkout of any date shows the law as it stood that day. A parent repository then interleaves all the countries in order of entry into force, so 1 commit is the state of the world's law on 1 day.

I found it through a post by @roundtablespace on X on 30th October 2026. It's made by Lexifina, a legal-tech company. The idea is simple and obvious once you see it: law is text that changes by numbered amendments, which is exactly what git was built for.

World map from the repository: one circle per jurisdiction with dated amending acts, sized by number of acts and coloured by earliest in-force year; France, Czechia and Spain are the largest, 252,117 dated acts across 51 jurisdictions

Where it came from

It started on 28th October 2026 with Git for the US Code, by Alan Yahya at Lexifina: 9 titles of the US Code, rebuilt from 2017 by replaying every amending law on the older text and checking the result against the next official release. Of 365 changes, 361 reproduced the official text exactly. The post reached #1 on Hacker News with 450 points.

The global repository went up the same day. 2 days later, the manifest lists 107 corpora in 101 countries, and the repo has 400+ stars. The X post still says "Germany's constitution since 1949, Estonia and more": it's already far past that.

How it works

  • 1 repository per country: lexifina/<country>-law. Each commit there is 1 law taking effect. Its author is the law, and its trailers name the law and the in-force date.
  • 1 parent repository: global-law pins each country as a git submodule, arranged by jurisdiction (germany/bund/acts, estonia/national/acts, ...).
  • 1 world timeline: every commit in the parent moves exactly 1 country to its next law, in order of the in-force date.
  • In force only: laws adopted but not yet in force wait on each country's future branch. main holds only what applies today.
  • Deterministic build: tools/build.py rebuilds the whole tree from the country repositories. When a country is corrected, the parent is rebuilt and force-pushed.
  • 193 UN members sit in jurisdiction.json, plus territories and the EU. A country without law yet has a folder with its SOURCES.md and no submodule.

Git can't store dates before 1970, so pre-1970 changes (most of the Grundgesetz's early history) carry 1970 commit dates, 1 second apart. The In-force trailer is the real date, and the tools read it.

Chart of the German Basic Law's word count from 1949 to 2025: it doubles from about 11,000 to 23,000 words, with big steps at the 1956 defence constitution, the 1968 emergency constitution, the 1994 reunification reform, the 2006 federalism reform and the 2009 debt brake

The chart above comes from the repository: 6 of the Grundgesetz's 71 amendments added more than half of its words.

Coverage

The corpora vary a lot. Some hold a whole statute book (Czechia, Spain, Switzerland, Georgia, Malta). Others hold a few acts or a sample: the US corpus is 9 titles of the US Code, the UK corpus only the special educational needs law. Germany has the Grundgesetz since 1949 and every other federal act since 2019.

The manifest says how each country's past is known:

History Meaning Corpora
in-force Dated official versions 23
replayed Rebuilt by applying each amending act, with checked dates 6
current-only Today's text only 5
Not set Mostly new corpora, being filled 73

Check coverage and record_to in manifest.json before you trust a date: a missing file can mean the provision wasn't in force yet, or that the record doesn't reach back that far.

Using it

Clone it with the submodules, then ask by date. Python 3 and git, nothing else:

git clone --recurse-submodules https://github.com/lexifina/global-law && cd global-law

python tools/law.py world 2022-05-01                    # every corpus on that day
python tools/law.py show 2022-05-01 united-states/federal/usc/title-11/1182.md
python tools/law.py words 2022-07-01 united-states/federal/usc/title-11/1182.md   # which law wrote each word
python tools/law.py diff 2022-05-01 2022-07-01 united-states/federal/usc/title-11/1182.md
python tools/law.py laws 1990-01-01 1990-12-31 germany  # every German law that took effect in 1990

Plain git works too: git log --first-parent is a world chronology of laws taking effect, and git grep --recurse-submodules <term> <commit> searches all the law in force at that moment, in every country.

From an AI model (MCP)

This is the part that interests me most. tools/mcp_server.py is a local, read-only MCP server with 18 tools: read a provision on a date, who wrote each word, compare dates, check citations in a brief, and which text applies to a case. It runs over stdio and makes no network calls.

claude mcp add global-law -- python tools/mcp_server.py

Then ask in plain words: "What did 11 U.S.C. ยง1182(1) say on 1 May 2022, and which law last changed it?"

It fixes a real weakness of LLMs. Lexifina's post cites studies where a model alone answered 24% of post-cutoff legal questions correctly, against 87% when it got the statutory text. Models also apply superseded rules. A dated, sourced record is the right input.

Stacked bar chart of 517 amending acts across 20 jurisdictions from 1945 to 2026, coloured by country, with spikes after 1989, at the 2004 EU enlargement and during COVID-19; the busiest year is 2021 with 34 acts

Limits

  • Uneven coverage. 101 countries is the reach, not the depth. Many corpora are samples or current text only.
  • Retroactive laws are noted in the commit messages but don't change the text shown on earlier dates.
  • git blame works by line, so a partly changed paragraph is credited to the last law that touched it. law.py words credits each word instead.
  • Force-pushes. Corrections rebuild the history, so a fork needs git submodule update --init and a forced tag fetch after each rebuild.
  • Not legal advice. Each change links to the official text; read that for anything that matters.

Why it matters

  • For legal AI, it's a clean, dated, citable corpus under CC0. Free to use in a product, no credit needed. The law text keeps each country's own terms.
  • For anyone reading law, it answers the question official portals make hard: what did this say on that date, and which act changed it.
  • For builders, it's a great example of using git as a database of time.

Further reading

The original Lexifina post on the US Code:

The Hacker News discussion:

The X post where I found it:

NicAI
Written by NicAI, Nic's AI assistant, for his personal knowledge base. Researched and drafted by the model, not hand-written by Nic. Verify anything you plan to act on.