claude-code-source  by JrCx7scC

Full Claude Code source restoration and local execution

Created 1 month ago
368 stars

Top 76.7% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This project reconstructs the complete source code of Claude Code from its npm package, including all native modules and internal dependencies, offering a fully functional, locally runnable version. It targets developers, researchers, and power users seeking to understand, modify, or deploy Claude Code locally, potentially bypassing network restrictions and enabling low-latency access. The primary benefit is a fully restored, feature-complete Claude Code environment accessible without relying on external services.

How It Works

The restoration process meticulously extracts components from the official @anthropic-ai/claude-code npm package. Source code is recovered from source maps (.js.map files), preserving logic and type definitions despite React Compiler transformations. Type files, erased during compilation, are rebuilt by analyzing import statements and usage patterns. Crucially, native modules (.node files) are directly extracted from official binaries across multiple platforms (macOS, Linux, Windows) using format parsers, ensuring full native functionality.

Quick Start & Requirements

  • Install: bun install
  • Run: bun run start (isolated config), bun run start:home (host config), bun run mcp (MCP server), bun run dev (development mode).
  • Prerequisites: Bun >= 1.3.10.
  • Links: Derived from @anthropic-ai/claude-code npm package.

Highlighted Details

  • Native Modules: All native modules (image-processor, audio-capture, computer-use-input, computer-use-swift, url-handler) are fully restored and compiled for arm64/x64 on Darwin, Linux, and Win32 platforms.
  • Internal Dependencies: Complete integration of Anthropic's internal dependencies, including @ant/computer-use-mcp, @ant/computer-use-input, and various SDKs, with source and native components preserved.
  • Core Functionality: All core features are available, encompassing CLI REPL, extensive tool usage (Bash, FileEdit, WebFetch), MCP server, slash commands, session management, permissions, plugin system, OAuth, image/audio processing, macOS computer control, LSP, Git integration, and Vim mode.
  • Feature Flags: Over 90 feature flags are retained in the source code, allowing granular control and insight into experimental features.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), or project roadmap are provided in the README.

Licensing & Compatibility

The project is based on the public distribution of @anthropic-ai/claude-code, with original code copyright held by Anthropic and subject to their terms. The stated purpose is strictly for "research and learning purposes," implying significant restrictions on commercial use or integration into closed-source projects.

Limitations & Caveats

Certain native modules, specifically computer-use-input/swift and url-handler, are exclusive to macOS due to their reliance on system APIs. A small number of TypeScript compilation errors (63) persist, primarily related to dead code or type inference issues within dependencies. The project's explicit "research and learning" designation imposes limitations on broader application.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
12 stars in the last 30 days

Explore Similar Projects

Starred by John Resig John Resig(Author of jQuery; Chief Software Architect at Khan Academy) and Didier Lopes Didier Lopes(Founder of OpenBB).

CCPlugins by notlikeDev

0.0%
3k
Claude Code CLI enhancement framework
Created 10 months ago
Updated 7 months ago
Feedback? Help us improve.