How should Chinese AI companies "copy Claude Code’s homework"?
What leaked and why it matters
Anthropic’s developer tool Claude Code was effectively exposed when a 59.8MB source map published to npm pointed to a Cloudflare R2 archive containing roughly 1,900 TypeScript files — about 512,000 lines of source — for the Claude Code client. Security researcher Chaofan Shou discovered the pointer; mirror repositories appeared on GitHub within hours. It has been reported that one mirror, dubbed “claw-code,” gathered tens of thousands of stars very quickly. Last week Anthropic also reportedly leaked references to its next‑generation model “Mythos,” making this a rare two‑hit embarrassment for a company that markets itself on safety.
What’s actually useful in the leak
The code is more than a thin API wrapper. It reveals a finely engineered plugin system where each tool (file I/O, shell, web fetch, LSP integration) carries detailed, guarded prompt instructions — not just a function signature but step‑by‑step guidance on when and how to use the tool, how to handle retries and errors. There’s a three‑tier “self‑healing memory” design: a hot MEMORY.md kept in context, topic files loaded on demand, and raw dialogue indexed for grep retrieval. There are also 44 feature flags for multi‑agent coordination, voice, long planning sessions and playful features like a terminal pet. In short: this leak exposes engineering patterns that boost assistant behaviour under real limits (limited context windows, latency and cost).
Should Chinese teams copy the code?
No — and yes. No, because this is a leaked proprietary asset: directly reusing the 51.2万行 TypeScript would carry clear copyright risk and reputational danger. Yes, because the real value is the design thinking. Chinese teams such as ByteDance (字节跳动) with Trae and Zhipu AI (智谱) with CodeGeeX should study the trade‑offs revealed here — layered memory, explicit tool prompts, cheap fallbacks like regex for emotion detection — and reimplement them to suit their own models and deployment constraints. Which raises the question: fork the code or copy the ideas? Copy the ideas. Tailor the implementation to models that may have shorter context windows or different instruction‑following behavior.
Legal, technical and geopolitical caveats
Be mindful of legal boundaries: leaked source is not open source, and building a commercial product on leaked proprietary code is risky. Technically, many of Claude Code’s choices were made for Claude’s model characteristics — long context, strong instruction following — and won’t translate directly to smaller, locally deployed models that Chinese firms often prefer because of regulatory and data‑sovereignty pressures. Geopolitics matters too: export controls, sanctions and supply‑chain frictions shape which models and cloud services are practical in China. The smartest approach is forensic: analyze the leak to extract architectures and heuristics, then rebuild them from first principles for local models and legal environments.
