Claude Code Source Code Just Leaked. Here Is What It Reveals About How Most People Use AI.

    ·
    Claude Code Source Code Just Leaked. Here Is What It Reveals About How Most People Use AI.

    TL;DR

    • Anthropic accidentally leaked Claude Code's full source: 1,900 files, 512,000 lines of TypeScript
    • The architecture shows 11 layers. Most users interact with two or three
    • Three immediate wins: CLAUDE.md config, /plan command, permission wildcards
    • The gap between how the tool is built and how people use it is the competitive advantage

    Anthropic accidentally shipped Claude Code's full TypeScript source to npm. A security researcher found it. Business Insider reported it. Within hours, the code was mirrored on GitHub and forked 60,000 times before Anthropic could issue DMCA takedowns. The codebase: 1,900 files, 512,000 lines of production code.

    Here is what matters. Not the leak itself. What the architecture reveals about how most people are using the tool.

    VentureBeat confirmed the scale of the exposure. The source covered everything: the tool system, memory system, multi-agent coordinator, permission engine, command system, and more. This was not a snippet. This was the whole thing.

    It Is Not a Chatbot

    Most people use Claude Code like a smarter terminal autocomplete. Type a request, get a response, repeat.

    That is not what was built.

    The leaked source shows 11 distinct architectural layers. There is a full agent runtime underneath. It has a task system, a permission engine, lifecycle hooks, session persistence, and a multi-agent coordinator designed for parallel workstreams. Claude Code is closer to an operating system for AI work than anything resembling a chat interface.

    The average user is accessing roughly 10% of it.

    We broke down all nine architectural insights in our interactive guide. But three of them will change how you work immediately.

    Three Things That Change Immediately

    1. CLAUDE.md is loaded every single turn.

    Not just at session start. Every turn. This means every instruction you put in that file is re-read constantly. The source confirms a 40,000 character limit and a four-level hierarchy: global user instructions, project-level instructions, subfolder instructions, and inline instructions.

    Most people have about 200 characters in their CLAUDE.md. Or none at all.

    This is where your business context lives. Your tone of voice. Your approval workflows. Your client names. Your brand rules. The AI does not remember these things automatically. You have to install them. CLAUDE.md is the installation mechanism, and most people are leaving it empty.

    2. The /plan command changes the quality of everything downstream.

    There are 85+ slash commands in the source. Most users know about four of them. The six that matter for non-developers are /plan, /compact, /review, /context, /cost, and /init.

    /plan is the most important. It puts Claude into a planning-only mode where it reasons through the full approach before touching anything. The difference in output quality between planning first and jumping straight to execution is not marginal. It is the difference between a professional brief and a first draft written at speed.

    Think of it as the difference between a strategist who maps the campaign before briefing the team, versus one who books the media buy before finishing the creative.

    3. Permissions can be set once for entire categories of work.

    The permission engine supports wildcard approvals. Instead of approving individual actions one by one, you can approve categories. This matters less for one-off tasks. It matters enormously for repeatable workflows where you want the AI operating autonomously within defined boundaries.

    If you are running any kind of content production system, client reporting process, or marketing workflow through Claude Code, this is how you stop babysitting it. If you are wondering why Claude Code changes the game for non-developers, this permission model is a big part of the answer.

    Each of these has a full walkthrough in the full guide.

    What This Means for Your Business

    The agencies and founders who win from here are not the ones with early access to new models. They are the ones who have already done the hard work of extracting their IP and building it into systems an AI can operate from.

    That is the actual gap. Not model capability. Not tool access. It is whether you have installed your thinking into the system.

    Claude Code, used properly, becomes a runtime for your expertise. Your positioning frameworks, your client communication standards, your content approval process. All of it can live in CLAUDE.md and in structured context that the agent reads every time it works. For the full technical breakdown, see the AI Orchestrators analysis.

    The businesses that figure this out first will not just be more efficient. They will be structurally harder to compete with. Because their AI is not running on generic instructions. It is running on proprietary ones.

    What to Do Now

    Four actions. In order.

    Update your Claude Code installation. Around the same time as the source leak, a malicious axios package was briefly published to npm. This appears to be an unrelated supply-chain attack, but the timing matters. Run npm update and check your package-lock.json if you have not done so in the past two weeks.

    Write a proper CLAUDE.md. Start with your company name, your tone of voice, your primary audience, and your non-negotiables. Fifty well-chosen lines will change your output quality overnight.

    Use /plan before every non-trivial task. Make it a habit. One week of doing this and you will not go back.

    Read the power user guide. It covers all nine architectural insights from the leaked source, with concrete examples for marketing and business workflows. Not developer tutorials. Business applications.

    This is also why most AI agent deployments fail when businesses skip the architecture step. The tool is not the problem. The setup is.

    The source code leak was an accident. But it handed anyone paying attention a complete map of a tool most people are using blind.

    Start with the guide and close the gap before your competitors do.


    Frequently Asked Questions

    What exactly leaked from Claude Code?

    Anthropic published an npm package for Claude Code that included a source map file. Source maps are normally used for debugging. They pointed to the full readable TypeScript source behind the compiled package. A security researcher discovered this, and the complete source, approximately 1,900 files and 512,000 lines of production code, was mirrored on GitHub within hours.

    Is it safe to keep using Claude Code after the leak?

    Yes. The leak was of Anthropic's source code, not your data. Your conversations and files were not exposed. The separate concern is a malicious axios package that appeared on npm around the same time. That is a supply-chain risk unrelated to the leak itself. Update your dependencies and check your package-lock.json as a precaution.

    What is CLAUDE.md?

    CLAUDE.md is a context file that Claude Code reads at the start of every session, and in fact at every turn within a session. It is where you install persistent instructions: your brand voice, project context, approval workflows, client names, and any standing rules you want the AI to follow. Think of it as the briefing document your AI reads before it does anything. Most users either do not have one or have a minimal one. That is one of the biggest missed opportunities in the tool.

    What is the /plan command?

    /plan is a slash command that puts Claude Code into a planning-only mode. Instead of immediately starting to execute a task, the AI maps out its full approach first: what it will do, in what order, and why. You review and approve the plan before any action is taken. For anything beyond a simple request, this dramatically improves output quality and reduces wasted work. It is the closest thing to having the AI think before it acts.