Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

claude-code

> 编程语言
Open source

Fork of instructkr/claude-code

144.5K stars0 likes3 views
WebsiteGitHub

About

Fork of instructkr/claude-code

Claude Code Source Snapshot for Security Research

This repository mirrors a publicly exposed Claude Code source snapshot that became accessible on March 31, 2026 through a source map exposure in the npm distribution. It is maintained for educational, defensive security research, and software supply-chain analysis.


Research Context

This repository is maintained by a university student studying:

  • software supply-chain exposure and build artifact leaks
  • secure software engineering practices
  • agentic developer tooling architecture
  • defensive analysis of real-world CLI systems

This archive is intended to support:

  • educational study
  • security research practice
  • architecture review
  • discussion of packaging and release-process failures

It does not claim ownership of the original code, and it should not be interpreted as an official Anthropic repository.


How the Public Snapshot Became Accessible

Chaofan Shou (@Fried_rice) publicly noted that Claude Code source material was reachable through a .map file exposed in the npm package:

"Claude code source code has been leaked via a map file in their npm registry!"

— @Fried_rice, March 31, 2026

The published source map referenced unobfuscated TypeScript sources hosted in Anthropic's R2 storage bucket, which made the src/ snapshot publicly downloadable.


Repository Scope

Claude Code is Anthropic's CLI for interacting with Claude from the terminal to perform software engineering tasks such as editing files, running commands, searching codebases, and coordinating workflows.

This repository contains a mirrored src/ snapshot for research and analysis.

  • Public exposure identified on: 2026-03-31
  • Language: TypeScript
  • Runtime: Bun
  • Terminal UI: React + Ink
  • Scale: ~1,900 files, 512,000+ lines of code

Directory Structure


Architecture Summary

  1. Tool System (src/tools/)

Every tool Claude Code can invoke is implemented as a self-contained module. Each tool defines its input schema, permission model, and execution logic.

Tool Description
BashTool Shell command execution
FileReadTool File reading (images, PDFs, notebooks)
FileWriteTool File creation / overwrite
FileEditTool Partial file modification (string replacement)
GlobTool File pattern matching search
GrepTool ripgrep-based content search
WebFetchTool Fetch URL content
WebSearchTool Web search
AgentTool Sub-agent spawning
SkillTool Skill execution
MCPTool MCP server tool invocation
LSPTool Language Server Protocol integration
NotebookEditTool Jupyter notebook editing
TaskCreateTool / TaskUpdateTool Task creation and management
SendMessageTool Inter-agent messaging
TeamCreateTool / TeamDeleteTool Team agent management
EnterPlanModeTool / ExitPlanModeTool Plan mode toggle
EnterWorktreeTool / ExitWorktreeTool Git worktree isolation
ToolSearchTool Deferred tool discovery
CronCreateTool Scheduled trigger creation
RemoteTriggerTool Remote trigger
SleepTool Proactive mode wait
SyntheticOutputTool Structured output generation
2. Command System (src/commands/)

User-facing slash commands invoked with / prefix.

Command Description
/commit Create a git commit
/review Code review
/compact Context compression
/mcp MCP server management
/config Settings management
/doctor Environment diagnostics
/login / /logout Authentication
/memory Persistent memory management
/skills Skill management
/tasks Task management
/vim Vim mode toggle
/diff View changes
/cost Check usage cost
/theme Change theme
/context Context visualization
/pr_comments View PR comments
/resume Restore previous session
/share Share session
/desktop Desktop app handoff
/mobile Mobile app handoff
3. Service Layer (src/services/)
Service Description
api/ Anthropic API client, file API, bootstrap
mcp/ Model Context Protocol server connection and management
oauth/ OAuth 2.0 authentication flow
lsp/ Language Server Protocol manager
analytics/ GrowthBook-based feature flags and analytics
plugins/ Plugin loader
compact/ Conversatio

Issues· 4 open

View all issuesOpen on GitHub
  • #4

    因为最近泄露的 Claude Code 源码搞了个交流裙

    Updated Jul 7, 2026
  • #2

    I need to be told Im important

    Updated Apr 3, 2026
  • #1

    (o´Д`o)ノ

    Updated Apr 1, 2026

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言