Developer Rewrites Claude Code in Python and Rust, Dodges Copyright
A developer has published clean-room reimplementations of Claude Code's core functionality in Python and Rust, arguing the rewrites sidestep Anthropic's copyright claim.
Four days after the Claude Code sourcemap leak and two days into Anthropic’s DMCA takedown campaign, a developer who goes by the handle synthcore on GitHub has published two repositories: opencode-py and opencode-rs, described as clean-room reimplementations of Claude Code’s core functionality in Python and Rust respectively. The repositories went up on April 4 and have accumulated significant attention in the AI developer community within hours.
The developer’s argument is that by writing new code that implements similar functionality, rather than copying Anthropic’s TypeScript, the reimplementation avoids the copyright issues that got 8,000 other repositories taken down. That argument has merit in principle and is legally contested in practice.
What “Clean Room” Means
Clean-room implementation is a real legal concept with a long history in software. The idea is that you can reverse-engineer a system’s behavior and implement the same behavior from scratch without infringing copyright, because copyright protects the specific expression of code, the actual text, not the underlying ideas, algorithms, or architectures it implements.
The canonical example is how Intel-compatible chips were developed in the 1980s: one team studied the existing chips and documented their behavior, then a separate team with no exposure to the original wrote new code to match that behavior. The separation between the two teams is the key, it prevents the new implementation from being a derivative work of the original.
synthcore claims to have read the community analysis of the leaked source, discussions of what the architecture does, without copying the code itself. The Python and Rust implementations were written from that behavioral specification, not from the original TypeScript.
What the Reimplementations Actually Contain
The opencode-py repository implements the core agent loop, tool invocation handling, context management, and a skill-loading system. The Python implementation uses the Anthropic SDK directly and is structured as a library with a CLI wrapper. It’s functional, I’ve seen it demonstrated in the discussions that followed, though it’s rougher than the production Claude Code and missing many features.
The opencode-rs repository focuses on the performance-sensitive parts: context compression, token counting, and the file system operations that Claude Code does repeatedly. It’s a Rust library that can be called from Python via bindings, designed to accelerate the Python implementation rather than be a standalone tool.
Both repositories ship under the MIT license, which the developer explicitly chose as a statement that the code is intended to be freely used, forked, and extended, a direct contrast to Anthropic’s proprietary model.
The Legal Grey Area
Whether this actually dodges copyright is genuinely uncertain. Copyright lawyers I’ve seen weigh in on similar situations have different views.
The favorable view: functional behavior isn’t protectable, and a clean-room implementation that replicates behavior without copying expression is legal. The architecture of an agent loop, build context, call model, parse response, invoke tools, is an idea, not a copyrightable expression. The skill loading mechanism is a functional pattern, not a creative work.
The less favorable view: the line between “inspired by” and “derived from” is fact-specific and depends heavily on how closely the new implementation tracks the original. If synthcore read detailed technical descriptions of how specific functions in the leaked code work and then wrote equivalent functions, a court might find those functions are derivative works even without a literal copy.
There’s also the question of trade secrets. Copyright and trade secret claims are distinct. Even if the copyright argument holds, Anthropic might have grounds to argue that specific implementation details were confidential information that shouldn’t be incorporated into competing products, even through indirect means.
The Open-Source Community Response
The response in the developer community has been split in predictable ways.
Developers who have been frustrated with Claude Code’s pricing, feature gating, or black-box nature are enthusiastic. Several contributors have already submitted PRs to both repositories. There’s a Discord server with a few hundred developers discussing a roadmap, including features like multi-model support that lets the agent backend be swapped to other providers.
Other developers are more cautious, pointing out that using these repositories for commercial projects creates real legal risk until the copyright question is resolved. A few have noted that the whole premise, using knowledge derived from a leak, is ethically murky regardless of whether it’s technically legal.
Anthropic hasn’t yet responded publicly to the reimplementation repositories specifically. The DMCA campaign has targeted GitHub repositories hosting the actual leaked TypeScript. Whether they’ll file against repositories that don’t host the original code is a different legal question, and one that will determine whether clean-room reimplementation works as a strategy here.
What This Means for AI Coding Tools
I’ve been thinking about the broader implications, and honestly the most interesting part of this is what the demand signal tells you, not the specific repositories.
The Claude Code source leak happened by accident, but the speed with which developers archived it and started building alternatives tells you something about the market. There’s substantial appetite for an open-source, self-hosted alternative to Claude Code that provides similar agent capabilities without a subscription or usage-based pricing.
Claude Code is genuinely good, Anthropic has put real engineering into it. But “good and proprietary” is a position that open-source alternatives have displaced before, a trade-off we work through in open source vs proprietary AI coding tools. Whether opencode-py or a future project becomes that alternative depends on whether the community can sustain the development effort, whether the legal challenge materializes, and whether Anthropic decides to respond by open-sourcing parts of Claude Code themselves.
That last option is unlikely in the short term, but worth watching. The leak has changed the information environment in a way that makes their current architecture public knowledge, which changes the calculus around keeping it proprietary.
Sources
- [1]
- [2]
- [3]
-
[4]
sst/opencode on GitHub(github.com)
-
[5]
GitHub DMCA takedown policy(docs.github.com)
Written by Caliph Herald