Who owns the code Claude Code wrote?

As AI coding tools become ubiquitous, the legal ownership of generated code remains a complex issue involving copyright law, employment contracts, and open-source licensing risks.
Who Owns the Code Claude Wrote?
AI-generated code copyright explained for builders.
TL; DR
Agentic coding tools like Claude Code, Cursor, and Codex generate code that may be uncopyrightable, owned by your employer, or contaminated by open source licenses you cannot see. If you are shipping AI-assisted code and have not thought about any of this, this piece is for you.
Legal Layer Angle: In this piece I will talk about what a developer using AI coding tools needs to document to own what they build, what their employment contract probably says about AI-assisted work product, and what the practical implication is for open source contributions written with AI assistance.
If you shipped code this week, some of it was probably written by an AI. The question of who legally owns that code is less settled than most developers assume, and the answer depends on three things that have nothing to do with how good the code is:
- Whether a human made enough creative decisions to establish copyright,
- Whether your employment contract already assigned it to your employer, and
- Whether the model pulled from GPL-licensed training data and quietly contaminated your codebase.
On March 31, 2026, Anthropic accidentally published 512,000 lines of Claude Code’s source code in a routine software update through a missing configuration file. Before sunrise, the codebase was mirrored across GitHub. Before breakfast, a developer had used an AI tool to rewrite the entire thing in Python, and the “claw-code” repository hit 100,000 GitHub stars in a single day, the fastest in history. Then came the DMCA takedowns, and then came the question nobody had a clean answer to:
If Claude Code was, by Anthropic’s own lead engineer’s admission, predominantly written by Claude itself, does Anthropic even own it? Can you issue a DMCA takedown for code that copyright law may not protect?
That incident compressed every open question about AI-generated code ownership into a single news cycle. The same questions apply to your codebase.
The copyright rule nobody told you
Here is the legal baseline, in plain terms: copyright only protects work created by a human.
The US Copyright Office confirmed this in January 2025, and the Supreme Court declined to disturb it in March 2026 when it turned away the Thaler appeal. Works predominantly generated by AI without meaningful human authorship are not eligible for copyright protection, and that rule is now settled at the highest judicial level available.
What it means for you:
Code that Claude Code or Cursor generated and you accepted without meaningful modification may not be copyrightable by anyone. If a competitor copies it, you may have no legal recourse, because the code sits in the public domain in everything but name.
The phrase that determines whether your code is protected is “meaningful human authorship,” and the Copyright Office has deliberately refused to quantify it with a percentage or a number of edits, because what courts look for is evidence that a human made genuine creative decisions:
- Choosing the architecture,
- Deciding what to reject,
- Restructuring the output to fit a specific design.
Specifying an objective to the model is not enough. Directing how the work is constructed is what counts.
What your employer probably already owns
Before you think about whether your code is copyrightable, there is a more immediate question: even if it is, is it actually yours?
Your employment contract almost certainly says that anything you build at work belongs to your employer. That principle has a name in copyright law: the work-for-hire doctrine. Under it, any code created by an employee within the scope of their employment is owned by the employer, who is treated as the legal author, regardless of whether the code was written by hand, generated by Claude Code, or some combination.
The practical rule: if you are building something on the side, use a personal account, a personal machine, and tools you pay for yourself. Keep your employer’s licensed tools out of that workflow entirely.
The open source contamination problem
Even if you own your AI-generated code, you may have already contaminated it with an open source license you cannot see.
AI coding tools are trained on massive amounts of public code, including code licensed under the GPL, LGPL, and other copyleft licenses. Copyleft licenses carry a specific obligation that travels with the code: If you distribute software that is a derivative of GPL-licensed code, you must release your own source code under the same license. This applies even if you did not know the code you incorporated was GPL-licensed.
Source: Hacker News
















