Skip to main content

Requirements

RequirementVersion
Bun≥ 1.1.0
Operating systemmacOS, Linux, or Windows (WSL)
Claude Code runs on the Bun runtime, not Node.js. Bun provides native JSX/TSX support, the bun:bundle feature-flag system, and faster startup. Install it before proceeding.
curl -fsSL https://bun.sh/install | bash
Verify:
bun --version
# 1.1.0 or later

Install methods

Verify the installation

Run the version check and diagnostics:
claude --version
claude /doctor
/doctor runs src/screens/Doctor.tsx — a full-screen diagnostics UI that checks:
  • API connectivity to Anthropic
  • Authentication status
  • Required tool availability (e.g., ripgrep for GrepTool)
  • Connected MCP servers
  • Runtime and platform information
Address any issues reported before starting a session.

Authentication

Log in after installation:
claude /login
This starts an OAuth 2.0 flow (src/services/oauth/) that opens your browser. After completing the flow, credentials are stored locally.

macOS Keychain

On macOS, Claude Code stores authentication tokens in the system Keychain via the keychain prefetch in src/main.tsx:
startKeychainPrefetch()
This means your credentials survive restarts without re-authenticating. On Linux and Windows (WSL), tokens are stored in a local config file instead. To remove stored credentials:
claude /logout

Platform notes

  • Keychain integration is available and used by default for secure credential storage.
  • The macOS Keychain read is prefetched in parallel on startup for performance.
  • All tools including BashTool work without additional configuration.
  • Credentials are stored in a local config file (no Keychain).
  • Ensure ripgrep is installed for GrepTool to work:
    # Debian/Ubuntu
    apt install ripgrep
    
    # Arch
    pacman -S ripgrep
    
  • node-pty (used for terminal emulation) requires native build tools. Install build-essential (Debian) or equivalent.
  • Run Claude Code inside a WSL2 environment (Ubuntu or Debian recommended).
  • Install Bun inside WSL, not in the Windows host environment.
  • Keychain integration is not available; credentials use local config file storage.
  • IDE bridge (src/bridge/) works with VS Code’s WSL extension.

Build scripts reference

The package.json scripts field exposes the following build targets:
ScriptCommandPurpose
buildbun scripts/build-bundle.tsDevelopment build
build:watchbun scripts/build-bundle.ts --watchWatch mode
build:prodbun scripts/build-bundle.ts --minifyMinified production build
build:webbun scripts/build-web.tsWeb target build
typechecktsc --noEmitTypeScript type check
lintbiome check src/Lint with Biome
checkbiome check src/ && tsc --noEmitFull check

Entrypoints

The bin field in package.json maps the claude binary to src/entrypoints/cli.tsx. Additional entrypoints:
FilePurpose
src/entrypoints/cli.tsxDefault CLI session — launches the REPL
src/entrypoints/init.tsConfig, OAuth, telemetry, and MDM initialization
src/entrypoints/mcp.tsRun Claude Code as an MCP server
src/entrypoints/sdk/Agent SDK for programmatic use
The src/ directory is the original leaked source code and is the property of Anthropic. Do not redistribute it. For contributions to documentation or the MCP server, see the repository’s CONTRIBUTING.md.

Build docs developers (and LLMs) love