谁拥有Claude代码编写的代码?
Who owns the code Claude Code wrote?

原始链接: https://legallayer.substack.com/p/who-owns-the-claude-code-wrote

## AI 生成代码:谁真正拥有它? 像 Claude、Cursor 和 Codex 这样的人工智能编码工具正在迅速改变软件开发,但由此产生的代码的法律所有权却出乎意料地不明确。 如果您正在发布人工智能辅助代码,了解风险至关重要。 版权法要求*人类*作者。 主要由人工智能生成的代码可能无法获得版权保护,如果您被复制,将没有任何法律途径。 即使存在版权,您的**雇佣合同**很可能将所有权分配给您的雇主——使用公司工具或时间完成的任何工作通常被视为“受雇创作”。 尤其要小心使用雇主授权的人工智能工具进行副项目。 一个隐藏的危险是**开源许可污染**。 人工智能模型在庞大的数据集上进行训练,包括带有 copyleft 许可(如 GPL)的代码,这些许可*要求*如果您分发衍生作品,则必须发布您的源代码。 人工智能可能会不知不觉地合并授权代码,从而产生法律责任。 **为了保护自己:** 1) 定期扫描您的代码库以查找开源许可。 2) 记录您的*创造性*贡献——架构决策、拒绝和重组——以证明有意义的人类作者身份。 3) 审查您的雇佣合同中的知识产权条款。 4) 如果要商业部署人工智能辅助代码,请使用具有适当赔偿条款的商业人工智能计划。 忽视这些问题可能导致法律纠纷,尤其是在法院努力应对这些新挑战时。 积极的文档记录和意识是关键。

## AI 生成代码的版权归属:Hacker News 讨论 一篇质疑 Claude Code 等 AI 生成代码版权归属的文章在 Hacker News 上引发了讨论。核心问题是,AI 生成的代码,特别是人类输入极少的情况下,是否具备版权。 目前的美国法律理解认为,“主要”由 AI 生成的作品缺乏版权保护,但人类修改可以产生新的、可版权的材料——类似于更新后的公共领域作品。然而,获得版权所需的人类贡献量尚不明确。其他国家,例如中国,*确实*授予未经修改的 AI 输出版权。 讨论要点包括,声称不“编写”代码,完全依赖 AI 的工程师的角色,以及 AI 处理代码开发所有阶段的潜力。许多评论者认为,实际问题——例如雇主对使用公司工具完成的工作的所有权——超过了法律上的细微差别,并且代码在实践中通常不被视为有价值的知识产权。另一些人指出了 GPL 许可和逆向工程的复杂性,暗示代码*通常*被认为是受版权保护的。最终,法律环境尚不确定,并且可能因国家/地区而异。
相关文章

原文

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:

  1. whether a human made enough creative decisions to establish copyright,

  2. whether your employment contract already assigned it to your employer, and

  3. 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.

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.

In an agentic workflow, this distinction is harder to establish than it sounds. Consider a typical Claude Code session:

  • You write a one-line prompt: “build a rate limiting module for the API”

  • Claude Code plans the approach, generates five files, and iterates through three versions

  • You review the output, run the tests, and merge

Your contribution in that sequence is your architectural intent and your final approval. Whether that constitutes meaningful human authorship in a courtroom is an unresolved question with no definitive court ruling yet.

The honest answer is: probably yes for modules you substantially redirected, probably no for code you accepted verbatim, and unclear for everything in between.

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. Using an AI coding tool during work hours, on a work project, on a work machine, does not change who owns the result.

Most employment contracts go further than the doctrine’s defaults. Look for a section in yours called “Intellectual Property,” “IP Assignment,” or “Work Product.” Open the contract, search for those terms, and read that section. A clause that says any of the following almost certainly covers your AI-assisted code:

  • “any work product created using company equipment or resources”

  • “any invention or development made during the term of employment”

  • “any software created with the assistance of company-licensed tools”

The third one is the one to watch. If your employer licenses Claude Code, Cursor, or Copilot for the team, and you use those same tools to build a side project, a broad IP assignment clause may give the employer a claim over that project, even if you built it on your own time.

A senior developer in San Francisco described exactly this situation earlier this year. He had used Claude Code for work projects and for a personal fitness tracking app built on evenings and weekends. His company updated its IP policy and claimed everything he had built with AI assistance, including the personal app, arguing that because Claude had access to open work files in the IDE, any AI output was a derivative work of company IP.

The argument does not hold up legally, because context visibility in an IDE does not make AI output a derivative work of files that were open nearby, and the connection between what Claude can see and what it generates is probabilistic pattern completion, not copying. But the argument illustrates what employers are starting to claim. If the clause is broad enough, it has surface validity regardless of what the AI actually did.

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.

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

  • “I did not know” is not a defense to a copyleft violation

🚨 When an AI tool generates code that closely resembles GPL-licensed code from its training data, and you ship that code in a commercial product without releasing source, you may have created a copyleft violation without ever touching the original repository.

The chardet dispute made this concrete in early 2026. A developer used Claude to rewrite chardet, a Python character encoding library, and re-released it under an MIT license, arguing that the AI rewrite was a “clean room” implementation free of the original LGPL license.

The legal question the community fought over: if Claude was trained on the LGPL-licensed codebase and its output reflects patterns learned from that code, can the output be treated as license-free? The emerging legal consensus is probably not, and assuming it can creates significant liability for anyone shipping that code commercially.

The Doe v GitHub litigation, still working through the Ninth Circuit as of April 2026, is asking whether GitHub Copilot reproduces licensed code without attribution in violation of copyright law and DMCA Section 1202. The district court dismissed most claims but the appeal is live. Whatever the outcome, the litigation has already changed industry behavior: GitHub Copilot added duplicate detection filters, and acquisition due diligence now routinely includes an AI codebase license scan.

Four concrete actions, none of which require a lawyer.

1. Run a license scan on your AI-assisted codebase

Tools that do this well:

  • FOSSA — most comprehensive, widely used in enterprise

  • Snyk Open Source — good for dev-team workflows, integrates with GitHub

  • Black Duck — standard in M&A due diligence

Each will scan your codebase, flag code that matches known open source libraries, and identify the licenses attached. If you are shipping a commercial product and have never run one of these, you are operating on assumption. The scan takes an afternoon and costs less than the first hour of a copyright dispute.

2. Document your human creative contributions as you go

The evidence that establishes meaningful human authorship is the same evidence you already produce in a normal engineering workflow. You just have to keep it deliberately rather than letting it disappear.

What to preserve:

  • Commit messages that describe what you changed and why, not just what the AI generated. “Restructured Claude’s module architecture, rejected initial state management approach, rewrote error handling from scratch” is evidence. “Add rate limiting module” is not.

  • Prompt logs. Claude Code and Cursor both retain interaction history. Export or screenshot the sessions where you made significant architectural decisions.

  • Design documents, ADRs, or any notes that predate the generated code and show you specified the structure before the AI built it.

The second commit message versus the first is the difference between a defensible authorship claim and a clean “Claude wrote this” record.

3. Read the IP clause in your employment contract before you build anything on the side

Open your contract, search for “intellectual property,” “IP assignment,” or “work product,” and read that section carefully. The specific language determines your exposure:

  • “Work product created during employment hours” is narrower than “work product created using company resources”

  • “Relating to the company’s business” is narrower than “any software development”

  • “Company-licensed tools” is the phrase that captures AI coding tools even on personal projects

If the clause is broad and you want to build something independently, you have three realistic options: negotiate a written carveout before you start (easier at the start of a new role than mid-employment), use entirely personal tools on entirely personal time on a personal machine, or accept that the claim exists and decide whether the risk is worth it.

4. Check which Anthropic plan you are on before shipping for commercial use

Go to anthropic.com/legal and compare the consumer terms against the commercial terms. The difference that matters:

  • Consumer terms (free and Pro plans): Anthropic assigns outputs to you, but the IP indemnification is narrower and covers fewer scenarios.

  • Commercial terms (API and enterprise): Anthropic assigns outputs to you and will defend you against copyright infringement claims arising from your authorized use of the service and its outputs.

If you are shipping AI-assisted code in a commercial product using the free or Pro plan, the indemnification gap is real. The API or enterprise agreement is the appropriate tier. Note that neither indemnification covers a downstream GPL violation from license contamination in your codebase. That is your governance problem to solve with the license scan in action 1.

Anthropic’s own lead engineer publicly stated that his recent contributions to Claude Code were written entirely by the AI, and the leaked codebase that Anthropic issued 8,000 DMCA takedowns to suppress may be predominantly AI-authored. Whether Anthropic’s copyright claims over that codebase are legally valid remains an open question no court has yet resolved.

If the company that built the tool cannot cleanly assert copyright over its own AI-assisted code, the question of whether you can is worth taking seriously before it becomes relevant in a transaction, a dispute, or an acquisition conversation. The developer who documents their creative contributions from the start is in a meaningfully different legal position than the one who accepted three thousand lines of Claude output and merged without review, even if both shipped the same product.

1. US Copyright Office — Copyright and Artificial Intelligence (Part 2: Copyrightability)

The primary regulatory source on what qualifies as meaningful human authorship in AI-assisted works. Part 2 covers the specific tests the Office applies when reviewing AI-generated content registrations. Essential if you want to understand exactly where the legal line sits.

2. Andersen v. Stability AI, Midjourney, DeviantArt — Ninth Circuit docket

The foundational case on AI training data and copyright infringement, currently shaping how courts think about what AI models learn and reproduce. Relevant to the GPL contamination question in a way most developers have not connected yet.

3. Doe v. GitHub, Inc. — Ninth Circuit appeal

The live litigation on whether Copilot reproduces licensed code without attribution. Track this one: the Ninth Circuit decision will set the standard that determines whether AI-generated code carrying open source patterns constitutes copyright infringement.

4. GitHub — Copilot and copyright: what you need to know

GitHub’s own legal position on why Copilot outputs are not infringing. Worth reading as a counterpoint: understanding the argument they make helps you understand where it is strong and where it has limits, particularly on the GPL training data question.

5. FOSSA — Understanding open source license obligations

A developer-friendly reference to how copyleft obligations actually work in practice: what triggers the source disclosure requirement, what constitutes a derivative work, and how the GPL, LGPL, and AGPL differ in their reach. The clearest plain-language guide available on this topic.

6. Anthropic — Usage Policy and Terms of Service

The actual document that determines your IP rights and indemnification scope when you use Claude commercially. Read sections 7 and 8 specifically: output ownership and IP indemnification. The difference between the consumer and commercial terms is stated plainly and takes ten minutes to understand.

I write about legal architecture for AI products at Legal Layer. This piece is informational and does not constitute legal advice.

联系我们 contact @ memedata.com