How was the Claude Code source code exposed?
An Enthropic NPM package included a source map pointing to readable TypeScript; a security researcher followed the breadcrumb and the repo was mirrored publicly.
Video Summary
The Claude Code source was exposed via an NPM package source map, revealing the full TypeScript codebase.
Claude Code is a full agent runtime (tools, commands, memory, permissions, task manager), not just a terminal chatbot.
Use hidden slash commands like /init, /plan, /compact, /context, /cost, and /review to save tokens and control behavior.
Maintain a concise cloud.md to shape runtime behavior and onboarding context.
Configure permissions in local JSON to reduce repetitive prompts and speed up execution; decompose work to exploit multi‑agent execution and MCP integrations.
An Enthropic NPM package included a source map pointing to readable TypeScript; a security researcher followed the breadcrumb and the repo was mirrored publicly.
Key commands include /init (create project cloud.md), /plan (map approach before edits), /compact (compress conversation history), /context (manage files in scope), /cost (show session spend), and built-in /review workflows.
cloud.md acts as an onboarding/operational manual that shapes runtime behavior; keep it concise with rules, constraints, important decisions, and project structure to improve future sessions.
Configure permissions via local JSON (use wildcard permissions for routine tasks) so the permission engine doesn't repeatedly ask during common operations.
Decompose complex tasks into smaller sequential or parallel phases (search, plan, execute, verify). Leverage Cloud Code's multi‑agent design and MCP integrations to run agents and background tasks concurrently.
"Claude Code's source code has just been leaked, revealing 2,000 files and over half a million lines of production code."
The source code was accidentally exposed when Enthropic published an MPM package that included a source map file, making it accessible.
A security researcher discovered this leak, traced it back, and within hours, the full source was available on GitHub.
The leak went viral, prompting a review of the codebase to extract practical insights that can significantly enhance user experience with Cloud Code.
"Claude Code is not just a chatbot; it’s a full agent runtime, equipped with sophisticated systems for managing tasks and permissions."
Contrary to popular belief, Claude Code is a comprehensive application rather than a simple terminal-based chatbot.
It comprises several integral systems, including a tool system, command system, memory system, and an execution pipeline that integrates everything seamlessly.
Most users may only engage with about 10% of its capabilities by using it in a superficial way. Understanding its layered architecture could unlock much more value.
"The source code reveals 85 slash commands in Cloud Code, of which most users are likely unaware of more than five."
While users often rely on basic commands like /help, there are powerful commands that can greatly enhance productivity, such as /init, which establishes project context.
Commands like /plan help explicitly outline tasks before execution, minimizing the risk of unwanted changes in complex projects.
Additionally, commands like /compact can save tokens by compressing the conversation history, which is particularly beneficial for long-running sessions.
"The cloud.md file isn’t just for documentation; it’s crucial for maintaining operational context in your project."
The cloud.md file acts as an onboarding document for Claude Code, shaping its behavior based on rules and conventions outlined within.
Users should maintain concise and operational notes in this file, focusing on essential decisions, constraints, and project structure guidelines.
It’s important to understand that cloud.md influences how Claude Code performs in future sessions, making it a high-leverage input.
"Permissions can significantly affect Claude's responsiveness; setting them up correctly alleviates unnecessary prompts."
Users frequently encounter slowdowns due to Claude Code prompting them for permissions repeatedly during tasks.
The source code indicates that a sophisticated permission system exists, allowing for more efficient setups through wildcard permissions for common tasks.
By configuring settings in the local JSON files, users can manage permissions at various levels, facilitating a smoother workflow and reducing the need for constant permission checks.
"The architecture is designed to support decomposition, splitting work across multiple agents that can run in parallel."
Cloud Code is architected to enable the splitting of tasks among various agents, which allows for parallel execution. This means that one agent can explore the codebase, another can implement changes, and a third can validate tests simultaneously.
The architecture also accommodates background tasks, ensuring that certain work continues processing while the user focuses on other tasks. Rather than trying to manage everything with a single, comprehensive command, users should structure their requests into smaller, manageable parts that can be handled by the cloud code effectively.
The recommendation is to decompose complex tasks into clear sequential or parallel steps, leading to better performance and satisfactory outcomes compared to sending a single, broad instruction to a large, generalized agent.
"Cloud code is both an MCP client and an MCP server; it connects external tools through MCP and allows other systems to connect to it."
The source code confirms that Cloud Code integrates with the Model Context Protocol (MCP), enhancing its functionality. It can act as both a client and a server, making it capable of linking with external systems and tools.
Beyond simply supporting MCP, there is an added layer for skills and plugins. This functionality allows users to create repeatable workflows, custom capabilities, and extensions specific to their domain, thereby building a more intelligent ecosystem surrounding Cloud Code.
This expansion transforms Cloud Code from merely a coding tool into a robust integration platform capable of connecting to various systems such as databases, APIs, and documentation systems.
"The source code indicates features that are gated behind internal feature flags, suggesting varying levels of access for different users."
The codebase of Cloud Code contains checks for different user types, including references to features that may not yet be publicly accessible. These include modes like voice mode and daemon mode.
The presence of feature flags means that some capabilities may only be available to specific users based on their access levels or the environment in which they are operating. This variability can significantly influence the user experience with the platform.
Users are advised to stay informed about updates to Cloud Code, as flagged capabilities are likely to be rolled out in the future. Those who understand the architecture will be better prepared to utilize these new features once they become available.
"Top users design a better operating environment for their Cloud Code, treating it like a force multiplier."
Successful Cloud Code users prioritize creating an optimized environment, keeping their command files concise, clear, and frequently updated. This practice enhances the efficiency of interactions with Cloud Code.
Learning key commands such as /plan, /review, and /compact can significantly improve daily workflows. Users should focus on configuring permissions for routine tasks to reduce overhead in their operations.
Decomposition of tasks into phases—search, plan, execute, and verify—aligns with how Cloud Code is designed to operate and enhances user productivity by leveraging the tool's architecture.
Context management is crucial; users should manage conversational context carefully as it's directly tied to costs. Unnecessary files increase token usage, which has financial implications.
Encouraging integration with a variety of tools, alongside treating Cloud Code as a foundational infrastructure rather than just an application, can lead to greater leverage and improved workflow personalization.