npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quantum-ai/cc-haha

v1.0.4

Published

Claude Code local implementation via Quantum AI

Readme

Claude Code Haha

A locally runnable version repaired from the leaked Claude Code source, with support for any Anthropic-compatible API endpoint such as MiniMax and OpenRouter.

The original leaked source does not run as-is. This repository fixes multiple blocking issues in the startup path so the full Ink TUI can work locally.

Features

  • Full Ink TUI experience (matching the official Claude Code interface)
  • --print headless mode for scripts and CI
  • MCP server, plugin, and Skills support
  • Custom API endpoint and model support
  • Fallback Recovery CLI mode

Architecture Overview


Quick Start

1. Install Bun

This project requires Bun. If Bun is not installed on the target machine yet, use one of the following methods first:

# macOS / Linux (official install script)
curl -fsSL https://bun.sh/install | bash

If a minimal Linux image reports unzip is required to install bun, install unzip first:

# Ubuntu / Debian
apt update && apt install -y unzip
# macOS (Homebrew)
brew install bun
# Windows (PowerShell)
powershell -c "irm bun.sh/install.ps1 | iex"

After installation, reopen the terminal and verify:

bun --version

2. Install project dependencies

bun install

3. Configure environment variables

Copy the example file and fill in your API key:

cp .env.example .env

Edit .env:

# API authentication (choose one)
ANTHROPIC_API_KEY=sk-xxx          # Standard API key via x-api-key header
ANTHROPIC_AUTH_TOKEN=sk-xxx       # Bearer token via Authorization header

# API endpoint (optional, defaults to Anthropic)
ANTHROPIC_BASE_URL=https://api.minimaxi.com/anthropic

# Model configuration
ANTHROPIC_MODEL=MiniMax-M2.7-highspeed
ANTHROPIC_DEFAULT_SONNET_MODEL=MiniMax-M2.7-highspeed
ANTHROPIC_DEFAULT_HAIKU_MODEL=MiniMax-M2.7-highspeed
ANTHROPIC_DEFAULT_OPUS_MODEL=MiniMax-M2.7-highspeed

# Timeout in milliseconds
API_TIMEOUT_MS=3000000

# Disable telemetry and non-essential network traffic
DISABLE_TELEMETRY=1
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

4. Start

macOS / Linux

# Interactive TUI mode (full interface)
./bin/claude-haha

# Headless mode (single prompt)
./bin/claude-haha -p "your prompt here"

# Pipe input
echo "explain this code" | ./bin/claude-haha -p

# Show all options
./bin/claude-haha --help

Windows

Prerequisite: Git for Windows must be installed (provides Git Bash, which the project's internal shell execution depends on).

The startup script bin/claude-haha is a bash script and cannot run directly in cmd or PowerShell. Use one of the following methods:

Option 1: PowerShell / cmd — call Bun directly (recommended)

# Model configuration
set ANTHROPIC_AUTH_TOKEN=sk-xxx
set ANTHROPIC_BASE_URL=https://openrouter.ai/api/v1
set ANTHROPIC_MODEL=google/gemini-2.0-flash

npx cc-haha -p "hello"

# Interactive TUI mode
npx cc-haha

# Headless mode
npx cc-haha -p "hello"

# Fallback Recovery CLI
bun --env-file=.env ./src/localRecoveryCli.ts

Option 2: Run inside Git Bash

# Interactive TUI mode
bun --env-file=.env ./src/entrypoints/cli.tsx

# Headless mode
bun --env-file=.env ./src/entrypoints/cli.tsx -p "hello"

# Same usage as macOS / Linux
./bin/claude-haha

Note: Some features (voice input, Computer Use, sandbox isolation, etc.) are not available on Windows. This does not affect the core TUI interaction.


Environment Variables

| Variable | Required | Description | |------|------|------| | ANTHROPIC_API_KEY | One of two | API key sent via the x-api-key header | | ANTHROPIC_AUTH_TOKEN | One of two | Auth token sent via the Authorization: Bearer header | | ANTHROPIC_BASE_URL | No | Custom API endpoint, defaults to Anthropic | | ANTHROPIC_MODEL | No | Default model | | ANTHROPIC_DEFAULT_SONNET_MODEL | No | Sonnet-tier model mapping | | ANTHROPIC_DEFAULT_HAIKU_MODEL | No | Haiku-tier model mapping | | ANTHROPIC_DEFAULT_OPUS_MODEL | No | Opus-tier model mapping | | API_TIMEOUT_MS | No | API request timeout, default 600000 (10min) | | DISABLE_TELEMETRY | No | Set to 1 to disable telemetry | | CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | No | Set to 1 to disable non-essential network traffic |


Fallback Mode

If the full TUI has issues, use the simplified readline-based interaction mode:

CLAUDE_CODE_FORCE_RECOVERY_CLI=1 ./bin/claude-haha

Fixes Compared with the Original Leaked Source

The leaked source could not run directly. This repository mainly fixes the following issues:

| Issue | Root cause | Fix | |------|------|------| | TUI does not start | The entry script routed no-argument startup to the recovery CLI | Restored the full cli.tsx entry | | Startup hangs | The verify skill imports a missing .md file, causing Bun's text loader to hang indefinitely | Added stub .md files | | --print hangs | filePersistence/types.ts was missing | Added type stub files | | --print hangs | ultraplan/prompt.txt was missing | Added resource stub files | | Enter key does nothing | The modifiers-napi native package was missing, isModifierPressed() threw, handleEnter was interrupted, and onSubmit never ran | Added try/catch fault tolerance | | Setup was skipped | preload.ts automatically set LOCAL_RECOVERY=1, skipping all initialization | Removed the default setting |


Project Structure

bin/claude-haha          # Entry script
preload.ts               # Bun preload (sets MACRO globals)
.env.example             # Environment variable template
src/
├── entrypoints/cli.tsx  # Main CLI entry
├── main.tsx             # Main TUI logic (Commander.js + React/Ink)
├── localRecoveryCli.ts  # Fallback Recovery CLI
├── setup.ts             # Startup initialization
├── screens/REPL.tsx     # Interactive REPL screen
├── ink/                 # Ink terminal rendering engine
├── components/          # UI components
├── tools/               # Agent tools (Bash, Edit, Grep, etc.)
├── commands/            # Slash commands (/commit, /review, etc.)
├── skills/              # Skill system
├── services/            # Service layer (API, MCP, OAuth, etc.)
├── hooks/               # React hooks
└── utils/               # Utility functions

Tech Stack

| Category | Technology | |------|------| | Runtime | Bun | | Language | TypeScript | | Terminal UI | React + Ink | | CLI parsing | Commander.js | | API | Anthropic SDK | | Protocols | MCP, LSP |


Disclaimer

This repository is based on the Claude Code source leaked from the Anthropic npm registry on 2026-03-31. All original source code copyrights belong to Anthropic. It is provided for learning and research purposes only.