Global Law Turns the World's Statutes Into Git History Your AI Agent Can Check
A new open repo stores law as commits ordered by the day each change took effect, then hands it to Claude Code or Cursor through an MCP server. Here is how to use it and where it stops.
Law changes on a schedule, and language models do not keep the schedule. A model trained on years of legal text has seen a provision as it read in 2019, as amended in 2022, and as quoted in a blog post that got it slightly wrong. Ask it what the rule said on a particular day and you get a confident answer from the blur.
The hard question in legal research is rarely "what does the law say?" It is "what did it say on that date, and what changed since?" That is a version control question. Software engineers solved it decades ago with git.
lexifina/global-law, which climbed onto Trendshift's daily board on October 31 (#22 when we read it), applies that solution literally. It stores many countries' law as one git history, ordered by the date each change took effect, and serves it to AI agents through a local MCP server (the Model Context Protocol, a standard way for tools like Claude Code and Cursor to call outside programs).
The result: your agent can look up the law on a given day from a dated record, show you exactly which act changed which words, and tell you when it does not know. Coverage is partial, so that last part matters more than it sounds.
The idea in one picture
Imagine a stack of photographs of a country's statute book, one photo for every day a change took effect. Flip to any photo and you see the law as it stood that day. Put two photos side by side and the differences jump out.
That is what global-law builds with git. Per its README:
- Each commit moves one body of law (a "corpus," such as the German federal acts in the record) forward to its next change.
- Commits are ordered by in-force date, the day a change took effect, not the day someone typed it in.
- The commit author is the law itself, and trailers (small labeled lines at the bottom of a commit message) record the corpus, the law, and the in-force date.
- Each country's text sits in its own repository, pulled in as a git submodule (a repo nested inside another, pinned to an exact commit).
So "show me the law of every covered country on May 1, 2022" becomes a question git already knows how to answer.
What is in it
The manifest.json file lists dozens of corpora. Read the entries closely, because many are narrow. Austria's corpus holds selected federal acts (including its constitution) with dated official versions back to 1930. Australia's holds two federal acts, the Constitution Act and the Privacy Act 1988, back to 1900. Canada's holds two English-language federal acts, PIPEDA and the Access to Information Act, from 2002.
Coverage is uneven, and the project says so. The README warns that some corpora hold a country's whole statute book "while others hold a few acts or a sample." The manifest also labels how each history was built:
- in-force: dated official versions published by the government.
- replayed: rebuilt by applying each amending act in order, with a
verificationfield showing which dates were checked against official text. - current-only: just today's version, no history.
That distinction matters more than the country count. A replayed history is a reconstruction. It can be very good, but it is not the same as an official consolidated text, and the manifest is where you find out which one you are reading.
Why an agent needs this
When an agent answers a legal question from model memory, there is nothing to check. When it answers through global-law, every answer points at a commit, a file path and the law that last changed the text.
The MCP server exposes 18 read-only tools. The ones you will reach for first:
read_lawreturns a provision's text on a date, plus the law that last changed it, sources, and limits.compare_datesgives a word-level diff between two dates and lists the laws that took effect in between.provision_historylists every law that changed a provision, with in-force, enacted and published dates.who_wroteattributes each line or word to the law that wrote it, likegit blamefor statutes.resolve_citationstakes a block of text, finds each citation, and reports what that provision said on a date.applies_to_caseshows which later changes reach a case that began on a given date.
The design detail worth copying is how the tools handle what they do not know. MCP.md states "coverage is partial" and says an empty result means nothing in the record, not that the law is silent. Answers carry notes when a date falls outside a corpus's record, and read_law adds "not the whole answer" notes when a later law reaches back over the date. For pending cases, applies_to_case reports the default rule on whether a new law reaches back to cases already underway (for the US, the presumption against retroactivity) and states that the tool "does not decide the question."
The server itself runs locally over stdio, is read-only, and makes no network calls, per the README. That covers the server, not your whole setup: your agent and its model provider still see your prompts and the tool results under their own terms. MCP.md also notes the server can write an audit log if you set GLOBAL_LAW_AUDIT_DIR.
Put this into practice
You need git and Python 3.10 or later. Each country's law is its own submodule, so the first clone pulls many repositories.
1. Clone with the submodules. The MCP server needs the country repos present:
git clone --recurse-submodules https://github.com/lexifina/global-law
cd global-law
2. Connect it to your agent. For Claude Code, from inside the folder:
claude mcp add global-law -- python tools/mcp_server.py
For Claude Desktop, Cursor and other clients, the README gives a JSON block for the MCP settings file that points command at python and args at the full path to tools/mcp_server.py.
3. Start with the boring tool. Ask the agent to run list_jurisdictions first. It returns each corpus with its date coverage and an example path. That one call tells you whether the country and period you care about are in the record at all, before you trust any answer.
4. Ask date-shaped questions. Prompts that play to its strengths look like: "What did this provision say on 2022-05-01, and which law changed it by 2022-07-01?" or "Which laws took effect in Germany during 1990?" Ask the agent to quote the coverage notes in its answer. MCP.md says the tool instructions ask for these to be passed on; make it a habit to check that they were.
5. Or skip the agent entirely. The same answers are available from the command line, which is useful for checking what the agent told you. The README's examples:
python tools/law.py show 2022-05-01 united-states/federal/usc/title-11/1182.md
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
6. Use a worktree to visit the past. The README warns against git checkout on an old commit, because it removes the tools and the folders of corpora that did not exist yet. Instead:
git worktree add ../then <commit>
cd ../then && git submodule update --init
Honest limitations
Coverage is partial, and uneven. Some countries have a full statute book, others a sample. Many manifest entries in the slice we read carry no history type at all. An empty answer is a gap in the record, not proof the law is silent.
Pre-1970 dates break plain git. Git cannot store commit dates before 1970. The README explains that early changes to Germany's Grundgesetz therefore carry 1970 commit dates, one second apart, in the right order. Use the In-force trailer, which the tools read. A command like git log --before=1960-01-01 returns wrong results "without warning."
The history gets rewritten. The build is deterministic, and when a corpus is corrected, the repository "is rebuilt and force-pushed." If you cite a commit in your own work, keep a local copy or record the corpus commit from the trailer, because the top-level hash can change.
The license has two layers. The repo itself is CC0, free to fork and ship without credit. The law text stays under each country repository's own terms. Check those before you bundle text into a product.
It is a record, not a lawyer. The README carries no legal-advice disclaimer, so here is one: this tells you what the recorded text said on a date. It does not tell you how a court reads it, whether a regulation or court ruling changes the picture, or whether a retroactive law reaches your situation. The tools say as much in their own notes.
It is new. About 1.3k stars as of October 31, and no GitHub releases yet, though the repo carries tags tied to individual laws in its data. There is no stable version to pin, so pin a commit and expect changes.
The shift
Most attempts to make AI useful for legal questions add more retrieval: bigger document stores, better search. Global-law adds a clock. Every answer is pinned to a date and a commit, and the tool tells you when the record runs out.
That is a pattern worth stealing beyond law. Any domain where "what was true on that date?" matters (pricing rules, internal policies, API contracts, compliance checklists) can be stored the same way, with an MCP server that refuses to guess past the edge of its record. Clone it, run list_jurisdictions, and see whether your corner of the world is covered.
Sources: lexifina/global-law README, MCP.md, manifest.json and LICENSE.md, main branch as read October 31, 2026; star count from shields.io, October 31, 2026; Trendshift daily board, read about 15:15 ET October 31, 2026; Model Context Protocol.