Settle what your agent can reach before it rewrites copyleft code
I think the control to settle first in an agent rewrite is what the session can reach: a low score and a transcript report afterwards, and reach stops short of training data. Maintainers sometimes cite a low token-similarity score as evidence that an LLM-assisted rewrite of a copyleft project is independent of the original 1. Chardet 7.0.0 came out on March 2, 2026 46; its maintainer cited a score close to 1% as evidence of independence 18, while the original author objected that a rewrite by people exposed to the LGPL code remains bound by that licence 13. If you are asked to replace a copyleft dependency with an agent-written one, or to review a vendor who did, the decision is what to set up before the first run, what to keep, and what a score may be used for.
What the study already settles
The argument about a low score is already won, and the credit belongs to a study. It is a single preprint, so every figure below is its own report. Moumoula et al. 31 report on 69 rewrites of six copyleft Python projects 3, and every controlled rewrite passes the harness after repair, usually within half an hour for the initial rewrite 2.
In the study, rewrites of different projects score up to 10.5% against each other, and 22 of its 54 rewrites score no higher than that against their own original 7. The 1.29% reported for chardet 12 lies in this range, so the study reads it as compatible with both an independent implementation and a rewrite made with the original at hand 8.
The study also reports that run-to-run variation dominates project and agent effects, and that in more than a third of configurations the three repeats straddle the threshold 4: an identical configuration repeated accounts for 61% of the variance, against 14% for the project and under 1% for the agent 32, and in all 18 configurations at least one of the three runs scores below 25% 28.
For the study, a published score may be the minimum of several draws, and a reader has no means to know it 23. A low score on one rewrite is weak evidence of independence 5: a high score is evidence of copying, a low score of neither copying nor independence 25, and all it shows is that two trees differ on the surface 51.
On access, the study goes furthest. In its runs, neither token similarity nor retention revealed that the agent had the original 19. Only the record of the session did: the prompts, the logs and the content of the workspace 20. Hence its conclusion: evidence about the process is worth more than evidence about the output 52.
All of that is the study’s work, and I add nothing to it. What I can add comes from the one case it cites and did not run: its agents had the original, and on chardet a maintainer had told the agent not to look at it.
The chardet record is a second case
I think the chardet record teaches more than the score it is remembered for. Dan Blanchard, whom Willison’s post credits with every release since 1.1 in July 2012 44, said, as quoted on Simon Willison’s Weblog 45, that the new code was structurally independent of the old code 42, and that he could show it through direct measurement rather than process guarantees alone 43.
He deserves credit for the setup. His instructions to Claude were explicit: do not use LGPL or GPL source code, do not look at the existing chardet code, start from an empty repository 11. He set up Claude Code with restrictive permissions in the rewrite repo, and only git commands were pre-approved 53.
His account rests on evidence from the raw conversation transcripts 35. It prints 1.30% max for JPlag, which strips variable names and formatting, so it would catch renamed copies 10. The score close to 1% and the 1.29% above point the same way. I count those figures as one origin, his own, restated.
The same account says that Claude has chardet in its training data, and that despite his instructions, its subagents read old source code in three sessions 33.
The read I keep returning to is the one the agent chose. He did not tell Claude to read the old source for this: its subagents decided on their own that they needed to check how the parameters behaved 38. He writes that they read universaldetector.py and init.py at the 6.0.0 tag in full via the GitHub MCP tool 39. He adds that the full contents of universaldetector.py (~567 lines) were in Claude’s context window while it generated code 54. He calls this the biggest exposure event, and says the entire detection engine was already written and committed 37.
Where the boundary belongs
An instruction only asks, and I think the access log shows what ended the local search. By his account he denied a permission request and interrupted Claude entirely 56. He blocked every attempt to look at the old code on day one, and after he moved the blank repository to a folder that shared no parent with his local checkout, Claude stopped trying to search for it that way 36. I read the move as the stronger control: a denial answers one attempt, and the move removed the path.
The study reports that the agent did not always follow the constraints of its prompts 29, and the maintainer’s own conclusion is that he should have set up stricter guardrails 41.
The same loop that writes the new code can read the original whenever it is public, named in the prompt or present in the workspace 30. With agents, the study says, the separation has to be enforced on the workspace and recorded 21.
Here is the gap I care about. The study names three ways to the original and writes its remedy on the third. In my reading the folder move closed the local route, and the MCP read went by another, the public one. His account does not say how that call was permitted, so I draw no lesson about the pre-approval list from it; whichever way it went, the instruction and the list together did not keep the file out.
I would carry the study’s enforcement from the workspace to everything the session can reach, MCP servers included, and treat a public original as reachable by default.
In my reading, each kind of evidence answers this much:
| Question | A low score | The session record |
|---|---|---|
| Was text carried over? | Evidence of neither copying nor independence 25 | Shows what was open and what was written; the comparison is still yours to make |
| Did the agent read the original? | Silent: two trees differ on the surface 51 | Yes or no for what reached the session, from prompts, logs and workspace 20 |
| Did training data shape the result? | Silent | Silent: separation stops at the training data 22 |
The strongest case against
The first objection says I am answering the wrong question. A technology licensing lawyer’s post 49 reports that Richard Fontana saw no current basis for concluding that Chardet 7.0.0 was required to be released under the LGPL, noting that no one had identified copyrightable material in the new code 14. The same post reads the similarity analysis as suggesting that nothing protectable had been retained 47, and says there is no way to completely insulate any developer of exposure to public code 17. The study calls derived-work status a legal question it does not address 27, and it takes no position on the dispute 50.
I concede it. As I read Fontana’s comment, it turns on what is in the new code, so a score keeps a job there, and a high one is a stop signal 25. The question I am answering is what the session could reach.
His own defence is the second objection. He says none of the core detection code entered Claude’s active context during the rewrite 40, that every direct exposure was API surface or files primarily authored by him 34, and that the roles were separated, while spec writer and implementer both had some latent knowledge of the original code 16. The same account calls the universaldetector.py read exactly the kind of exposure he was trying to avoid 55, so I read core detection code as his scoping. I think he can say any of this only because he kept the transcript.
The fact that cuts hardest against me is the order: by his account the entire detection engine was already written and committed when that read happened 37. So this is exposure and no finding of derivation. I read that order as luck, since nothing in the setup depended on it.
Scope comes next. The study warns that results may differ for projects whose value lies in their own algorithms, of which chardet is an example 9, and it has no runs from a specification alone 26, so I make no claim about what an empty-repository agent scores. The licensing post argues that AI can help clean room development by interposing a neutral actor between the two developers 48. I think that actor is neutral only while it cannot read.
One limit stands whatever the setup. The study says the separation cannot be enforced on the training data of the model, a limit a clean-room claim based on an agent should state 22. Claude has chardet in its training data, so reach control narrows exposure without proving independence, and a transcript clears nothing on its own. The controversy was probably only partly about copyright and also about community expectations, the licensing post adds 15, and no session record ends that part.
What I would do before the first run
I would treat the setup as the evidence, because it is the only part I can still change. Six steps:
- Enumerate what the session can reach, beyond the pre-approval list. In Claude Code I would start with
claude mcp list, and configure no tool that reaches the original: repository MCP servers, web fetch and network access from a shell all count. - Keep the original outside any path the agent can walk, including the site-packages of an old version installed for benchmarks.
- Keep the raw transcripts, subagent turns included.
- Run the score anyway, as a stop signal.
- Report repeated generations and check provenance signals against same-task independent implementations 6, with the run count and selection rule beside the score 24.
- Write the training-data limit into the claim, and leave the derived-work question to counsel.
Nothing I set up before the first run proves independence, and I think a claim that says so is worth more than one that does not.
Sources
06-11-2026
- 1 Moumoula et al., source-conditioned rewriting (arXiv 2611.07887)
read on 05-11-2026 - 2 Moumoula et al., source-conditioned rewriting (arXiv 2611.07887)
read on 05-11-2026 - 3 Blanchard, account of the chardet v7 rewrite (JPlag maximum against the previous release)
read on 29-03-2026 - 4 Willison, coding agents and clean room relicensing
read on 05-03-2026 - 5 Meeker, The Chardet Controversy
read on 09-04-2026