Update, 1 November 2026: This article originally reported that the leaked Claude Code source contained x402 micropayment hooks built by Anthropic. That was wrong. The x402 code was added to one widely shared mirror of the leak by the mirror’s owner, who has said so publicly, and it is absent from the archived original source. The headline, opening and analysis have been rewritten, and dates and regulatory details have been corrected.
The leaked Claude Code source contained no x402 payment code
The Claude Code source leak of 31 March 2026 did not reveal a hidden Coinbase x402 payment system, despite viral write-ups that said it did. Anthropic accidentally published the source of its Claude Code tool that day: version 2.1.88 of its npm package shipped with a source map pointing to roughly 512,000 lines of readable TypeScript.
The leak spread within hours, and Anthropic filed copyright takedown requests against copies on GitHub. Anthropic described the incident as a release packaging issue caused by human error rather than a security breach, and said no customer data was exposed.
Within days, several widely read posts claimed the code included a built-in USDC wallet and x402 micropayment hooks that let the agent pay for resources on its own. The developer who ran one of the most copied mirrors, nirholas/claude-code, has since published a correction: “The x402 payment code that circulated with copies of the leak was mine. I wrote it. It was not Anthropic’s, it was not a hidden feature, and it was not in the leak.”
The mirror owner says three checks confirm this. Four Internet Archive captures of the original source archive contain no file or text matching x402. Claude Code versions 2.1.87 and 2.1.89, released either side of the pulled version, contain no x402 strings. And the mirror’s own history shows the eight x402 files arriving about two minutes after the leaked files were imported. An independent forensic comparison of two clean extractions against the mirror found the same thing: zero x402 matches in the clean copies, 24 files in the mirror. One early write-up has also withdrawn its claim that Anthropic built an agent payment system.
The leak itself was real, and so is x402. What was false was the link between them.
x402 is Coinbase’s HTTP 402 protocol for AI agent payments
HTTP has a status code called 402 — “Payment Required.” It was reserved in the original HTTP/1.1 spec from 1997. For nearly 30 years, nobody used it. It just sat there, waiting.
Coinbase built a protocol on top of it. When an AI agent requests a paid resource, the server returns HTTP 402 with payment requirements. The agent reads those requirements, signs a stablecoin payment from a wallet it has been authorised to use, and retries the request with proof of payment in the header.
In that flow there are no card details or API keys to manage, and the spending rules are set in advance rather than approved one payment at a time.
Coinbase’s developer docs describe x402 as “the internet’s payment standard for agentic payments at scale”, built for AI agents that need to “pay and access services autonomously with no keys or human input needed.”
x402 moved to the Linux Foundation on 2 April 2026
The protocol’s real news came two days after the leak, and it had nothing to do with Claude Code. Three announcements landed on 2 April 2026.
1. The x402 Foundation launched under the Linux Foundation. According to the Linux Foundation’s announcement, Coinbase contributed the x402 protocol to a new, vendor-neutral foundation. Initial support came from companies including Adyen, Amazon Web Services, American Express, Circle, Cloudflare, Fiserv, Google, KakaoPay, Mastercard, Microsoft, Polygon Labs, Shopify, Solana Foundation, Stripe and Visa.
The Linux Foundation’s CEO Jim Zemlin called it “an open, community-governed home” for internet-native payments — ensuring “transparency, interoperability, and broad participation across the ecosystem.”
2. Coinbase received preliminary conditional OCC approval for a national trust bank. The Office of the Comptroller of the Currency granted preliminary conditional approval to charter Coinbase National Trust Company in New York. The bank plans to provide digital asset custody as a fiduciary, mainly for institutional clients, plus transactional services for custody customers. The OCC stressed that final approval depends on meeting pre-opening requirements.
Coinbase Institutional’s co-CEO Greg Tusar wrote that “Federal oversight will bring consistency and uniformity to our custody business and create a foundation for new products — including payments and related services.”
3. World announced AgentKit for x402. According to The Block, World (formerly Worldcoin) launched a toolkit that lets World-verified people delegate their World IDs to AI agents using x402, adding a form of identity check to agent payments.
None of these announcements depends on Claude Code. Together they show payment firms, cloud providers and a US bank regulator preparing for agents that pay, but they do not show any AI lab wiring payments into its tools in secret.
What the genuine Claude Code leak did show
Early analyses of the source, such as Alex Kim’s widely shared review, found other internal features. None of them mentions x402 or payments.
Undercover mode strips Anthropic internals from public commits
A module called undercover.ts implements a one-way mode that strips all traces of Anthropic internals when Claude Code operates in public repositories. It instructs the model to never mention internal codenames like “Capybara” or “Tengu,” internal Slack channels, or even the phrase “Claude Code” itself.
There’s no way to force it off. Line 15 of the file reads: “There is NO force-OFF. This guards against model codename leaks.”
According to Alex Kim’s analysis, this means AI-authored commits and pull requests from Anthropic staff in open-source projects would carry no sign that an AI helped write them. In external builds the function is removed, so it applies to Anthropic’s internal use rather than to customers.
Anti-Distillation: Poisoning Copycats
The code includes anti-distillation mechanisms that inject fake tool definitions into API responses. If someone records Claude Code’s API traffic to train a competing model, the fake tools pollute their training data. There’s also a server-side summarization system that replaces full reasoning chains with signed summaries — so anyone scraping traffic only gets incomplete fragments.
These protections are narrowly scoped to the first-party command-line tool. They show how seriously Anthropic treats the risk of model distillation.
Frustration Detection (via Regex, Not AI)
Anthropic uses a regex pattern to detect user frustration, catching phrases such as “wtf” and “this sucks”. A regex is faster and cheaper than an inference call just to check whether someone is swearing at the tool.
Binary Attestation: DRM for API Calls
Native client attestation is the most technical finding. Before an API request leaves the process, Bun’s native HTTP stack (written in Zig) overwrites a placeholder with a computed hash, which the server can check to confirm the request came from a real Claude Code binary rather than a spoofed client.
Alex Kim connected this to Anthropic’s legal threats against OpenCode ten days earlier, which forced that project to remove built-in Claude authentication because third-party tools were using Claude Code’s internal APIs at subscription rates.
The planted x402 code spread because it matched a real trend
The fake x402 files were believable because they fitted a story many people already expected. The author of the withdrawn write-up said the injected code used the same documentation style, utilities and config structure as the rest of the codebase, so “it didn’t look bolted on. It looked native.” x402 was real, its backers were real, and agent payments were a live topic, so a Claude Code integration seemed to confirm a trend rather than invent one.
The forensic comparison lists the warning signs that were there to see. Every other Claude Code feature sits behind a feature flag, logs telemetry and fits the build documentation; the x402 module did none of these, had no tests and loaded through defensive try/require blocks designed to be dropped in. It also generated a wallet and stored a private key in the user’s config directory. That is the real security lesson. Running code from an unofficial leak mirror means trusting whoever controls that mirror, and in this case that code could sign real USDC transactions.
For readers, the test is simple: a claim about leaked code should be checked against a clean copy or an archive before it is repeated. The mirror owner’s own correction suggests running grep -r x402 src/ on any copy of the leak, and treating any match as a sign of a contaminated tree.
The wider picture of how agent payments might work still looks like this:
- Intelligence layer: Anthropic (Claude), OpenAI (GPT), Google (Gemini) — the models that agents run on
- Orchestration layer: Claude Code, OpenClaw, AutoGPT — the tools that decompose tasks and manage workflows
- Identity layer: World (AgentKit), OAuth, KYC — proving who (or what) is transacting
- Payment layer: x402, stablecoins, USDC — how agents pay for resources
- Infrastructure layer: Coinbase (custody + trust), AWS, Cloudflare — where computation and settlement happen
Model makers such as Anthropic sit at the intelligence and orchestration layers. Coinbase is building payment and custody pieces, and the x402 Foundation is meant to standardise how they connect.
The Claude Code leak did not show those layers already joined inside Anthropic’s product. Developers can add x402 to coding agents themselves, for example through the plug-ins and hooks Cloudflare documents, which they install and control, which is a different thing from a hidden feature.
Payments, not capability, are the next test for AI agents
For the past year, the AI agent narrative has been about capability: can an agent write code? Can it browse the web? Can it complete multi-step tasks?
The x402 Foundation shifts the question from capability to economic autonomy: can an agent safely act as a buyer?
x402 is designed to make that possible. When an agent can pay for compute, buy data and settle API calls within limits set in advance, it starts to look less like a tool and more like an economic actor, which raises questions about spending limits, fraud and liability.
The parallels to how the internet evolved are striking. In the 1990s, websites were static pages. Then payment infrastructure (PayPal, Stripe) enabled e-commerce, and suddenly websites became businesses. A similar shift could reach AI agents becoming autonomous economic participants.
Coinbase has built a strategy around this, from the protocol itself to its Agentic Wallets product and the Linux Foundation consortium. If the OCC grants final approval, a national trust charter would add federal oversight to its custody business.
Competitors can now read how Claude Code is built
Anthropic’s anti-distillation measures, from fake tool injection to reasoning summaries, show it is worried about competitors copying its approach. But anyone who has read the leaked source can now see how Claude Code orchestrates agents, manages context and handles multi-step work.
Whether rivals use that is a legal and ethical question. Anthropic’s takedown notices, though partly retracted after they swept up thousands of unrelated forks, show it intends to enforce its copyright.
Meanwhile the x402 payment layer is open to every AI company. The Linux Foundation governance means any developer can integrate it, and Google and Microsoft are among its initial supporters. No AI lab has been shown to have built it into its products in secret.
What to check before trusting agent payment claims
Three questions will decide whether agent payments become routine.
Real agent-to-agent payments at scale. The test is whether services such as Cloudflare or AWS see meaningful volumes of x402 payments from agents, with spending limits that hold up.
Disclosure of AI-written code. Undercover mode raised a fair question about whether AI-assisted contributions to open-source projects should be labelled. For now the answer depends largely on each project’s own contribution rules.
The trust charter race. The OCC’s decisions list shows a run of crypto trust bank applications, with preliminary conditional approvals for Ripple, Paxos, BitGo and Fidelity Digital Assets in December 2025, a decision on Crypto.com operator Foris DAX in February 2026 and Coinbase in April.
The Claude Code leak exposed real internal features. It did not expose a hidden payment system. The x402 story is still worth following, but on its own record rather than through a planted file.
Related Reading
- Autonomy 101: What Are AI Agents & Why They Matter — The fundamentals of the agent economy
- The $10 Billion Question: What Happens When AI Agents Start Spending Real Money — The economics of autonomous spending
- AI Agents Are Learning to Spend Money: The Payments Infrastructure Race — How payment rails are adapting to agents
- The 2026 AI Agent Stack: What’s Actually Working — The current state of agent infrastructure
- IMF 2026: Real-World Asset Tokenization Goes Mainstream — How tokenization connects to agent payments
Sources
- Claude’s code: Anthropic leaks source code — The Guardian
- Anthropic accidentally exposes Claude Code — The Register
- Anthropic leaks its own AI coding tool’s source code — Fortune
- Anthropic leaks part of Claude Code’s internal source code — CNBC
- What the Claude Code source leak reveals — Ars Technica
- The Claude Code Source Leak: fake tools, frustration regexes, undercover mode — Alex Kim
- Coinbase’s AI payments system joins Linux Foundation — CoinDesk
- Linux Foundation and Coinbase Launch x402 Foundation — Bitcoin News
- Coinbase Partners Linux Foundation for Internet-Native Payment Layer — PYMNTS
- Coinbase wins initial OCC nod for trust charter — CoinDesk
- Coinbase gets conditional US approval for trust charter — Reuters
- Sam Altman’s World adds identity toolkit for AI bots on x402 — The Block
- x402 Developer Documentation — Coinbase
- x402 Whitepaper — Coinbase/x402.org
- What actually happened here — nirholas/claude-code mirror owner’s correction (HISTORY.md)
- The x402 That Wasn’t There — forensic comparison of leak mirrors
- Correction: Claude Code Leak Post — Prabal
- Linux Foundation is Launching the x402 Foundation — Linux Foundation, 2 April 2026
- Corporate Decision 1370: Coinbase National Trust Company — OCC, 2 April 2026
- Interpretations and Decisions — OCC
Get TSN’s biggest tech stories, explained.
News and insights across AI, tech, crypto and cybersecurity. Every source linked. Unsubscribe anytime.
Get the newsletterFollow @tsnmediahub on X for breaking AI news as it happens.
Follow on X


