Claude Code banner
T-Lab-CUHKSZ T-Lab-CUHKSZ

Claude Code

Development community intermediate

Description

Claude Code Source - Buildable Research Fork. Reverse-engineered build system, runnable with Bun.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude Code Source - Buildable Research Fork

[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)]() [![Bun](https://img.shields.io/badge/runtime-Bun-f9f1e1?logo=bun)](https://bun.sh) [![TypeScript](https://img.shields.io/badge/lang-TypeScript-3178c6?logo=typescript&logoColor=white)]() [![Lines of Code](https://img.shields.io/badge/lines-512K+-blue)]() [![License](https://img.shields.io/badge/license-research%20only-orange)]() [![Stars](https://img.shields.io/github/stars/beita6969/claude-code?style=social)](https://github.com/beita6969/claude-code/stargazers) [![Forks](https://img.shields.io/github/forks/beita6969/claude-code?style=social)](https://github.com/beita6969/claude-code/network/members)

A **buildable, modifiable, and runnable** version of the Claude Code source.

Based on the Claude Code source snapshot publicly exposed on 2026-03-31 via an npm source map leak. The original snapshot contained only raw TypeScript source with no build configuration — it could not be compiled or run. This fork reconstructs the full build system and fixes all missing components to make it functional.

**[Quick Start](#quick-start)** | **[Architecture](#architecture-overview)** | **[Feature Flags](#feature-flags)** | **[Extension Guide](#extension-points-no-source-modification-needed)**


Quick Start

Prerequisites

  • Bun >= 1.3.x
  • Valid Anthropic authentication (OAuth via claude login or ANTHROPIC_API_KEY)

Install & Run

git clone https://github.com/beita6969/claude-code.git
cd claude-code

# Install dependencies (auto-creates bun:bundle polyfill via postinstall)
bun install

# Run directly
bun src/main.tsx -p "your prompt here" --output-format text

Build (Optional)

# Compile to single bundle (~20MB)
bun build src/main.tsx --outdir=dist --target=bun

Run Modes

# Headless print mode (no TTY needed)
bun src/main.tsx -p "your prompt here" --output-format text

# JSON output
bun src/main.tsx -p "your prompt here" --output-format json

# Interactive REPL mode (needs TTY)
bun src/main.tsx

**Note**: If `ANTHROPIC_API_KEY` is set in your environment, it must be valid. To use OAuth instead, unset it:

unset ANTHROPIC_API_KEY

What Changed vs. the Original Snapshot

The original snapshot shipped **no `package.json`, no `tsconfig.json`, no lockfile, and no build scripts**. Over 100 internal/feature-gated modules were also missing from the source map.

Build System (Reconstructed)

File Purpose
package.json 60+ npm dependencies reverse-engineered from ~1,900 source files
tsconfig.json TypeScript config (ESNext + JSX + Bun bundler resolution)
bunfig.toml Bun runtime configuration
scripts/postinstall.sh Auto-creates bun:bundle runtime polyfill after bun install
.gitignore Excludes node_modules/, dist/, lockfiles

Stub Modules (Created)

The original so