Claude Code audited 302,982 sections of US federal law and found 393 logic errors
A Reddit user fed the entire US Code and Code of Federal Regulations through Claude Code and the Lean proof kernel. The 39-second video lays out the haul: 393 logic defects, from a pig-drug rule that can't decide on a withdrawal time to a Medicare definition with two different end dates.
- Who: Reddit user u/SnooPeripherals5313, posting on r/ClaudeAI on December 5, 2026.
- What: 302,982 sections of the US Code and Code of Federal Regulations parsed from official XML, compiled into Lean, and scanned for logical errors by Claude Code-coordinated subagents.
- Result claimed: 393 logical defects — 165 numeric, 90 conflicting definition, 81 contradiction, 40 circular, 9 impossible condition, 8 undefined term.
- Traction: 422 upvotes and 67 comments as of the morning of December 6, with the top-voted reply framing the exercise as Congress finally getting a compiler.
- Caveat: no repository or code has been published, and the poster has not replied to requests for one — the full count has not been independently reproduced.
▶
Somebody finally ran the law through a compiler — or the closest thing to one. A Reddit user has parsed the whole of the US Code and the Code of Federal Regulations, translated the lot into the Lean proof assistant, and set Claude Code loose on it looking for logic errors. The reported haul: 393 defects hiding in 302,982 sections of federal law.
The project surfaced on r/ClaudeAI on Saturday morning, December 5, as a 39-second silent video, and it struck a nerve: by Sunday morning it had drawn 422 upvotes and 67 comments, with readers already asking whether the same treatment could be applied to their own countries' laws — and to the tax code. Federal law is two centuries of amendments layered on amendments, written by thousands of hands, with no test suite. Treating it like a codebase, and letting a machine check it the way a compiler checks code, is the kind of idea that sounds inevitable the moment someone does it.
How the audit worked#
The poster lays out the pipeline in six steps: take the US Code and the Code of Federal Regulations in their official XML formats; parse out every section, subdivision and cross-reference; compile that structure into Lean, so its proof kernel can check references against the law as it stands; translate each section into typed rules that preserve the exact statutory language; scan those rules for logical errors, with Claude Code coordinating specialized subagents for each analysis; then independently review every suspected defect and check the published examples against the official legal text. That fourth step — turning legal prose into formal rules without changing its meaning — is the one doing the heavy lifting, and the one that drew the most scrutiny in the comments.
What the 393 breaks down into#
The video opens with a bar chart splitting the 393 defects into six categories:
| Category | Count | What it means |
|---|---|---|
| Numeric | 165 | Dates, thresholds and ranges that contradict each other |
| Conflicting definition | 90 | The same term defined two different ways |
| Contradiction | 81 | Two provisions that can't both be true |
| Circular | 40 | Definitions or rules that refer back to themselves |
| Impossible condition | 9 | Conditions that can never be satisfied |
| Undefined term | 8 | Terms used but never defined |
The poster adds that there are many more mechanical defects besides — typos, broken references — but that the logical ones are the interesting find.

Three examples from the video#
The video doesn't just give a number — it shows its work, with on-screen citations for each example.
The first is a contradiction in a veterinary drug rule. One sentence says animals treated with a drug must not be slaughtered for food within five days of treatment; the next says that for one specific drug number, the wait is 24 hours. A commenter looked the citation up and confirmed it as 21 CFR 520.441(d)(4)(iii)(C). Commenters argued over whether that is a genuine contradiction or a general rule with a narrower exception — waiting five days satisfies both instructions.
The second example is a conflicting definition in Medicare rules. Under 42 CFR 418.75, the video says, the same 'extended flexibilities period' for hospice care is defined twice — once as a six-year period running to the end of 2029, and again as a four-year period ending in 2027. The 2027 date matches the current position: the Consolidated Appropriations Act, 2026 extended the hospice telehealth flexibility through December 31, 2027, per the Centers for Medicare & Medicaid Services. The video's point is that the older definition is still sitting in the text alongside it.
The third is a numeric gap in tax paperwork: the handover between two information-return forms for controlled foreign corporations, Form 2952 and Form 5471, leaves a stretch of tax years around 1982–1983 with, as the video presents it, no form covering them at all.
The reality check: law isn't code#
Not everyone in the thread is ready to declare the statute books buggy. The strongest objection is that law is not a program: it is interpreted by courts, shaped by precedent, and often deliberately vague, because no legislature can spell out every situation in advance. On that view, a conflict between two provisions is not necessarily a defect — it is a question for a judge. One commenter relayed a lawyer's warning that vagueness is sometimes a feature, not a bug, and that 'fixing' it could hand more leverage to whoever can afford the best reading of the new text.
There is also a simpler problem: the work cannot be checked yet. Several commenters asked for the repository so they could run the same audit on other countries' laws, and the poster has not replied to any of them — not to the repo requests, not to the questions about method, not to anything. Until the code and the full list are public, the count is one person's claim, backed by three worked examples. The examples that can be checked do check out as citations; the other 390 remain on trust.
Even the skeptics, though, mostly concede the narrower point. Obvious drafting slips — a definition with two end dates, a cross-reference pointing at a repealed section — are worth catching at scale, and a machine that reads 300,000 sections without getting tired is a reasonable way to find them.
What to watch#
Three things decide whether this becomes more than a viral video. First, whether the poster publishes the code and the full list — without them, nobody can reproduce the count or use the findings. Second, whether anyone with legal standing takes the examples up: a confirmed drafting error in a live regulation is the kind of thing an agency can quietly fix. And third, whether the approach spreads to state codes, which are messier than the federal ones, and to the tax code. If the method holds up on a second jurisdiction, the compiler analogy starts to look less like a joke and more like a job description.
Sources: r/ClaudeAI, “Pulling up explicit logic errors in US law” (December 5, 2026); Centers for Medicare & Medicaid Services, Hospice News & Announcements (telehealth flexibility extended through December 31, 2027); AI Frontier Post, “Google DeepMind releases AI-generated Lean formalizations of nearly 28,000 math papers” (December 5, 2026); AI Frontier Post, “A Claude-built archive of 300,000 military board decisions is now evidence in a federal lawsuit against Trump and the Pentagon” (November 11, 2026)