claude-code

skill
Guvenlik Denetimi
Uyari
Health Uyari
  • No license รขโ‚ฌโ€ Repository has no license file
  • Description รขโ‚ฌโ€ Repository has a description
  • Active repo รขโ‚ฌโ€ Last push 0 days ago
  • Community trust รขโ‚ฌโ€ 58 GitHub stars
Code Uyari
  • process.env รขโ‚ฌโ€ Environment variable access in src/QueryEngine.ts
  • network request รขโ‚ฌโ€ Outbound network request in src/assistant/sessionHistory.ts
  • process.env รขโ‚ฌโ€ Environment variable access in src/bootstrap/state.ts
  • network request รขโ‚ฌโ€ Outbound network request in src/bridge/bridgeApi.ts
  • process.env รขโ‚ฌโ€ Environment variable access in src/bridge/bridgeConfig.ts
  • network request รขโ‚ฌโ€ Outbound network request in src/bridge/bridgeDebug.ts
  • process.env รขโ‚ฌโ€ Environment variable access in src/bridge/bridgeEnabled.ts
Permissions Gecti
  • Permissions รขโ‚ฌโ€ No dangerous permissions requested
Purpose
This repository is an unauthorized backup of Anthropic's official "Claude Code" CLI source code, which was leaked via an npm sourcemap. It is a read-only archive intended for research rather than an installable, functional tool.

Security Assessment
Overall Risk: High. The codebase makes multiple outbound network requests (in session history, bridge API, and bridge debug modules) and frequently accesses environment variables (likely seeking API keys). While the scan found no hardcoded secrets, no dangerous shell execution permissions, and the tool itself is passive, the context presents severe risks. This is leaked proprietary code. By using or contributing to this, developers risk violating Anthropic's copyright and terms of service. Furthermore, because this is an unofficial redistributor's repository, it lacks the standard security guarantees of the official package and could easily be modified to include malicious payloads in future commits.

Quality Assessment
The repository is highly active (updated today) and has garnered 58 stars, showing strong community interest in the leak. However, it fundamentally fails quality and compliance checks. There is no software license included, meaning there are no legal permissions granted to use, modify, or distribute the code. Because it is a leaked copy rather than an open-source project, it inherently lacks the transparency and reliability of a properly maintained tool.

Verdict
Not recommended for integration or active development due to severe legal, ethical, and potential supply-chain security risks associated with using leaked proprietary code.
SUMMARY

๐Ÿš€ Open source Claude Code CLI source code. Advanced AI Agent for developers. Includes TypeScript codebase for LLM tool-calling, agentic workflows, and terminal UI. Remember this is just the skeleton not the brain itself. Found by Chaofan Shou.

README.md

Claude Code's Entire Source Code Got Leaked via a Sourcemap in npm, Let's Talk About It

PS: This breakdown is also available on this blog with a better reading experience and UX :)

Note: There's a non-zero chance this repo might be taken down. If you want to play around with it later or archive it yourself, feel free to fork it and bookmark the external blog link!


โš ๏ธ Important Disclaimer

I did not leak these files. I have simply provided an easy, documented way to access and study this codebase for research purposes. All files and information originate from public findings shared on Twitter/X. All credit for the discovery goes to the original source.


Earlier today (March 31st, 2026) - Chaofan Shou (@Fried_rice) discovered something that Anthropic probably didn't want the world to see: the entire source code of Claude Code, Anthropic's official AI coding CLI, was sitting in plain sight on the npm registry via a sourcemap file bundled into the published package.

The tweet announcing the leak

This repository is a backup of that leaked source, providing a full breakdown of what's in it, how the leak happened, and the internal systems that were never meant to be public.


๐Ÿง How Did This Even Happen?

When you publish a JavaScript/TypeScript package to npm, the build toolchain often generates source map files (.map files). These files bridge minified production code and the original source for debugging.

The catch? Source maps contain the original source code embedded as strings inside a JSON file under the sourcesContent key.

{
  "version": 3,
  "sources": ["../src/main.tsx", "../src/tools/BashTool.ts", "..."],
  "sourcesContent": ["// The ENTIRE original source code of each file", "..."],
  "mappings": "AAAA,SAAS,OAAO..."
}

By forgetting to add *.map to .npmignore or failing to disable source maps in production builds (Bun's default behavior), the entire raw source was shipped to the npm registry.

Claude Code source files exposed in npm package


๐Ÿ›  What's Under the Hood?

Claude Code is not just a simple CLI. It's a massive 785KB main.tsx entry point featuring a custom React terminal renderer (Ink), 40+ tools, and complex multi-agent orchestration.

๐Ÿฃ BUDDY - The Terminal Tamagotchi

Inside src/buddy/, there is a full Tamagotchi-style companion system.

  • Deterministic Gacha: Uses a Mulberry32 PRNG seeded from your userId.
  • 18 Species: Ranging from Common (Pebblecrab) to Legendary (Nebulynx).
  • Stats & Souls: Every buddy has stats like DEBUGGING, CHAOS, and SNARK, with a "soul" description written by Claude.

๐Ÿ•ต๏ธโ€โ™‚๏ธ Undercover Mode - "Do Not Blow Your Cover"

Anthropic employees use Claude Code to contribute to public repos. Undercover Mode (src/utils/undercover.ts) prevents the AI from leaking internal info:

  • Blocks internal model codenames (e.g., Capybara, Tengu).
  • Hides the fact that the user is an AI.
  • Confirms that "Tengu" is likely the internal codename for Claude Code.

๐ŸŒ™ The "Dream" System

Claude Code "dreams" to consolidate memory. The autoDream service (src/services/autoDream/) runs as a background subagent to:

  1. Orient: Read MEMORY.md.
  2. Gather: Find new signals from daily logs.
  3. Consolidate: Update durable memory files.
  4. Prune: Keep context efficient.

๐Ÿš€ KAIROS & ULTRAPLAN

  • KAIROS: An "always-on" proactive assistant that watches logs and acts without waiting for input.
  • ULTRAPLAN: Offloads complex tasks to a remote Opus 4.6 session for up to 30 minutes of deep planning.

๐Ÿ“‚ Architecture & Directory Structure

src/
โ”œโ”€โ”€ main.tsx                 # CLI Entrypoint (Commander.js + React/Ink)
โ”œโ”€โ”€ QueryEngine.ts           # Core LLM logic (~46K lines)
โ”œโ”€โ”€ Tool.ts                  # Base tool definitions
โ”œโ”€โ”€ tools/                   # 40+ Agent tools (Bash, Files, LSP, Web)
โ”œโ”€โ”€ services/                # Backend (MCP, OAuth, Analytics, Dreams)
โ”œโ”€โ”€ coordinator/             # Multi-agent orchestration (Swarm)
โ”œโ”€โ”€ bridge/                  # IDE Integration layer
โ””โ”€โ”€ buddy/                   # The secret Tamagotchi system

โš™๏ธ How to Use & Explore

๐Ÿ“ฆ Prerequisites

  • Bun Runtime (Highly Recommended) or Node.js v18+
  • TypeScript installed globally

๐Ÿš€ Getting Started

  1. Clone the repository:

    git clone https://github.com/your-username/claude-leaked.git
    cd claude-leaked
    
  2. Install Dependencies:

    npm install
    
  3. Build the Project:

    npm run build
    
  4. Run the CLI:

    node dist/main.js
    

๐Ÿ” Explore with MCP

This repo includes an MCP Server to let you explore the source using Claude itself:

claude mcp add code-explorer -- npx -y claude-code-explorer-mcp

๐Ÿ“ˆ SEO & Rankings

Keywords: Claude Code Leak, Anthropic Source Code, AI Agent Framework, Claude 3.5 Sonnet CLI, Tengu Anthropic, npm sourcemap leak, Open Source AI Agent.


๐Ÿ“œ Credits & Legal

Disclaimer: All original source code is the proprietary property of Anthropic PBC. This repository is for educational and archival purposes only. This is not an official Anthropic product.


๐Ÿ“ฉ Contact

For spamming reasons the email has been removed

Yorumlar (0)

Sonuc bulunamadi