CC  by lsm1103

Claude Code CLI restored from source maps for local research

Created 5 days ago

New!

272 stars

Top 94.9% on SourcePulse

GitHubView on GitHub
Project Summary

This project reconstructs and provides a runnable, albeit unofficial, version of the Claude Code CLI by restoring its complete TypeScript source code from the public npm package's source maps. It targets researchers and developers interested in studying the internal workings of the Claude Code CLI, offering a local development environment for analysis.

How It Works

This repository leverages source maps from the @anthropic-ai/claude-code npm package to reverse-engineer the original TypeScript codebase. It utilizes the Bun runtime (version ≥ 1.3.5) for dependency management and execution, aiming to provide a functional CLI environment that mirrors the original's capabilities as closely as possible, with compatibility shims for unrecoverable modules.

Quick Start & Requirements

  • Primary install/run command:
    • Install dependencies: bun install
    • Start the restored CLI: bun run dev
    • Output version: bun run version
  • Non-default prerequisites: Bun ≥ 1.3.5, Node.js ≥ 24.
  • Links: No official quick-start or demo links are provided.

Highlighted Details

  • Extensive Tool System: Features over 50 tools for file operations (read, write, edit, glob, grep), execution environments (bash, REPL, PowerShell, notebooks), web interaction (fetch, search, browse), AI collaboration, and task management.
  • Comprehensive Services Layer: Includes clients for Anthropic API and MCP (Multi-Channel Protocol), session auto-compression strategies, and analytics integration.
  • Rich UI Layer: Built with React and a custom Ink branch, offering terminal UI components for messages, input, diff views, status bars, and dialogs.
  • Vim Mode Engine: Implements full Vim keybinding support within the terminal interface.
  • Large Codebase: Restored from approximately 1,987 TypeScript/TSX files.

Maintenance & Community

No specific details regarding maintainers, community channels (like Discord/Slack), or roadmaps are provided in the README.

Licensing & Compatibility

The repository is explicitly stated as unofficial and for research/learning purposes only. Source code copyright belongs to Anthropic. Commercial use is prohibited. Compatibility with closed-source linking or commercial applications is not applicable due to these restrictions.

Limitations & Caveats

This is an unofficial restoration and may not perfectly replicate the original Claude Code CLI's behavior due to source map limitations. Type-only files, build-time generated files, private wrappers, native bindings, dynamic imports, and resource files might be missing or degraded. The shims/ directory contains replacements for unrecoverable modules, indicating potential functional differences. Use is strictly limited to technical research and learning.

Health Check
Last Commit

4 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
273 stars in the last 5 days

Explore Similar Projects

Feedback? Help us improve.