{"id":30032390,"url":"https://github.com/ruvnet/open-claude-code","last_synced_at":"2026-05-22T06:17:13.269Z","repository":{"id":279315707,"uuid":"938364389","full_name":"ruvnet/open-claude-code","owner":"ruvnet","description":"Nightly Claude Code CLI Decompile — Reverse Engineered \u0026 Rebuilt","archived":false,"fork":false,"pushed_at":"2026-05-08T04:05:50.000Z","size":25313,"stargazers_count":264,"open_issues_count":5,"forks_count":109,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-05-08T06:13:51.016Z","etag":null,"topics":["claude-code","clean-room","clean-room-reimplementation","decompiler"],"latest_commit_sha":null,"homepage":"https://github.com/ruvnet/RuVector","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruvnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-24T20:52:35.000Z","updated_at":"2026-05-08T05:26:04.000Z","dependencies_parsed_at":"2025-02-25T00:35:45.652Z","dependency_job_id":null,"html_url":"https://github.com/ruvnet/open-claude-code","commit_stats":null,"previous_names":["ruvnet/mipro-v3"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/ruvnet/open-claude-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruvnet%2Fopen-claude-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruvnet%2Fopen-claude-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruvnet%2Fopen-claude-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruvnet%2Fopen-claude-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruvnet","download_url":"https://codeload.github.com/ruvnet/open-claude-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruvnet%2Fopen-claude-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32809223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","clean-room","clean-room-reimplementation","decompiler"],"created_at":"2025-08-06T21:18:32.488Z","updated_at":"2026-05-09T06:19:33.320Z","avatar_url":"https://github.com/ruvnet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eOpen Claude Code\u003c/h1\u003e\n\u003ch3 align=\"center\"\u003eOpen Source Claude Code CLI — Reverse Engineered \u0026 Rebuilt\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eA fully functional open source implementation of Anthropic's Claude Code CLI,\u003cbr/\u003e\n  built from decompiled source intelligence using \u003ca href=\"https://github.com/ruvnet/rudevolution\"\u003eruDevolution\u003c/a\u003e.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Tests\" src=\"https://img.shields.io/badge/tests-1581_passing-brightgreen?style=flat-square\" /\u003e\n  \u003cimg alt=\"Tools\" src=\"https://img.shields.io/badge/tools-25-blue?style=flat-square\" /\u003e\n  \u003cimg alt=\"Commands\" src=\"https://img.shields.io/badge/commands-40-blue?style=flat-square\" /\u003e\n  \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/@ruvnet/open-claude-code?style=flat-square\u0026label=npm\" /\u003e\n  \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-MIT-blue?style=flat-square\" /\u003e\n  \u003cimg alt=\"Nightly\" src=\"https://img.shields.io/badge/nightly-verified_releases-brightgreen?style=flat-square\" /\u003e\n\u003c/p\u003e\n\n\u003e **Automated Nightly Releases** — Open Claude Code automatically detects new [Claude Code](https://www.npmjs.com/package/@anthropic-ai/claude-code) releases, runs 903+ tests to verify zero regressions, and publishes verified builds with AI-powered discovery analysis. See [Releases](https://github.com/ruvnet/open-claude-code/releases) | [ADR-001](docs/adr/ADR-001-nightly-verified-release-pipeline.md) | [pi.ruv.io](https://pi.ruv.io)\n\n---\n\n## ⚡ Quick Start\n\n```bash\n# Run instantly (no install)\nnpx @ruvnet/open-claude-code \"explain this codebase\"\n\n# Or install globally\nnpm install -g @ruvnet/open-claude-code\nocc \"hello\"\n\n# Interactive mode\nocc\n```\n\n**Requires:** `ANTHROPIC_API_KEY` environment variable set.\n\n```bash\nexport ANTHROPIC_API_KEY=sk-ant-...\nnpx @ruvnet/open-claude-code \"what files are in this directory?\"\n```\n\n---\n\n## 🧠 What Is This?\n\n**Open Claude Code** is a ground-up open source rebuild of Anthropic's [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code), informed by [ruDevolution's](https://github.com/ruvnet/rudevolution) AI-powered decompilation of the published npm package.\n\nIt's not a copy — it's a clean-room implementation that mirrors the actual Claude Code architecture: async generator agent loop, 25 tools, 4 MCP transports, 6 permission modes, hooks, settings chain, sessions, and more.\n\n**1,581 tests. 61 files. 8,314 lines. 100% functional.**\n\n---\n\n## 📦 Installation\n\n### npx (no install needed)\n\n```bash\nnpx @ruvnet/open-claude-code \"your prompt here\"\n```\n\n### Global install\n\n```bash\nnpm install -g @ruvnet/open-claude-code\nocc \"your prompt here\"\n```\n\n### From source\n\n```bash\ngit clone https://github.com/ruvnet/open-claude-code.git\ncd open-claude-code/v2\nexport ANTHROPIC_API_KEY=sk-ant-...\nnode src/index.mjs \"hello\"\n```\n\n---\n\n## 🖥️ Usage\n\n### One-shot mode\n\n```bash\nocc \"explain the auth module\"\nocc \"fix the bug in server.js\"\nocc \"create a REST API for user management\"\nocc \"find all TODO comments in this project\"\n```\n\n### Interactive REPL\n\n```bash\nocc\n# \u003e explain this codebase\n# \u003e /help\n# \u003e /tools\n# \u003e /model claude-opus-4-6\n# \u003e refactor the database layer\n# \u003e /cost\n# \u003e /exit\n```\n\n### CLI Options\n\n```bash\nocc [options] [prompt]\n\nOptions:\n  -m, --model \u003cmodel\u003e          Model to use (default: claude-sonnet-4-6)\n  -p, --print                  Print mode (non-interactive, output only)\n  --permission-mode \u003cmode\u003e     Permission mode: default, auto, plan, acceptEdits, \n                               bypassPermissions, dontAsk\n  --system-prompt \u003ctext\u003e       Override system prompt\n  --add-dir \u003cpath\u003e             Additional CLAUDE.md directory\n  --max-turns \u003cn\u003e              Maximum conversation turns\n  --allowedTools \u003ctools\u003e       Comma-separated allowed tools\n  --disallowedTools \u003ctools\u003e    Comma-separated denied tools\n  --output-format \u003cfmt\u003e        Output: text, json, stream-json\n  -v, --verbose                Verbose output\n  -d, --debug                  Debug mode\n  --version                    Show version\n  -h, --help                   Show help\n```\n\n### Examples\n\n```bash\n# Use a different model\nocc -m claude-opus-4-6 \"design a database schema for a blog\"\n\n# Print mode (for piping)\nocc -p \"list all functions in src/\" \u003e functions.txt\n\n# Plan mode (read-only, no edits)\nocc --permission-mode plan \"review the security of auth.js\"\n\n# Restrict tools\nocc --allowedTools \"Read,Glob,Grep\" \"find all API endpoints\"\n\n# With custom system prompt\nocc --system-prompt \"You are a senior Go developer\" \"review main.go\"\n```\n\n---\n\n## 🔧 Interactive Commands\n\n40 slash commands available in REPL mode:\n\n| Command | Description |\n|---------|-------------|\n| `/help` | Show all commands |\n| `/model \u003cname\u003e` | Switch model mid-conversation |\n| `/tools` | List available tools |\n| `/tokens` | Show current token usage |\n| `/cost` | Show session cost estimate |\n| `/compact` | Compact context window |\n| `/undo` | Undo last file edit |\n| `/clear` | Clear conversation history |\n| `/doctor` | Check API connectivity + health |\n| `/fast` | Toggle fast mode (Haiku) |\n| `/effort \u003clevel\u003e` | Set effort: low, medium, high, max |\n| `/resume [id]` | Resume a previous session |\n| `/sessions` | List saved sessions |\n| `/agents` | List custom agents |\n| `/skills` | List available skills |\n| `/hooks` | Show active hooks |\n| `/config` | Show current settings |\n| `/permissions` | Show permission mode |\n| `/mcp` | Show MCP server status |\n| `/memory` | Show memory usage |\n| `/exit` | Exit |\n\n---\n\n## 🔨 Tools\n\n25 built-in tools matching Claude Code's tool system:\n\n| Tool | Description |\n|------|-------------|\n| **Bash** | Execute shell commands (sandboxed) |\n| **Read** | Read files with line numbers |\n| **Edit** | Replace strings in files |\n| **Write** | Create/overwrite files |\n| **Glob** | Find files by pattern |\n| **Grep** | Search file contents (regex) |\n| **LS** | List directory contents |\n| **Agent** | Spawn sub-agents |\n| **WebFetch** | Fetch URL content |\n| **WebSearch** | Web search |\n| **TodoWrite** | Task management |\n| **NotebookEdit** | Edit Jupyter notebooks |\n| **MultiEdit** | Atomic multi-file edits |\n| **ToolSearch** | Discover deferred tools |\n| **AskUser** | Prompt user for input |\n| **Skill** | Invoke a skill |\n| **SendMessage** | Agent team messaging |\n| **CronCreate/Delete/List** | Scheduled tasks |\n| **EnterWorktree/ExitWorktree** | Git worktree isolation |\n| **RemoteTrigger** | Remote execution |\n| **LSP** | Language server protocol |\n| **ReadMcpResource** | Read MCP resources |\n\n---\n\n## ⚙️ Configuration\n\n### Settings\n\nCreate `.claude/settings.json` in your project or `~/.claude/settings.json` globally:\n\n```json\n{\n  \"model\": \"claude-sonnet-4-6\",\n  \"permissions\": {\n    \"defaultMode\": \"auto\"\n  },\n  \"hooks\": {\n    \"PreToolUse\": [{\n      \"matcher\": \"Bash\",\n      \"hooks\": [{ \"type\": \"command\", \"command\": \"echo 'Running bash...'\" }]\n    }]\n  },\n  \"autoCompactEnabled\": true,\n  \"alwaysThinkingEnabled\": true\n}\n```\n\nSettings are loaded from 4 sources (in priority order):\n1. `.claude/settings.local.json` (local, gitignored)\n2. `.claude/settings.json` (project, shared)\n3. `~/.claude/settings.json` (user global)\n4. Managed policy (enterprise)\n\n### CLAUDE.md\n\nCreate a `CLAUDE.md` in your project root to customize behavior:\n\n```markdown\n# Project Rules\n- Always use TypeScript\n- Follow TDD\n- Keep files under 500 lines\n```\n\nCLAUDE.md files are loaded from: `~/.claude/CLAUDE.md` → parent directories → project root → `.claude/CLAUDE.md`.\n\n### Custom Agents\n\nCreate `.claude/agents/reviewer.md`:\n\n```markdown\n---\nname: reviewer\ndescription: Code review specialist\nmodel: claude-sonnet-4-6\ntools: [Read, Glob, Grep]\n---\n\nYou are a thorough code reviewer. Check for bugs, security issues, and style.\n```\n\n### Skills\n\nCreate `.claude/skills/deploy/SKILL.md`:\n\n```markdown\n---\nname: deploy\ndescription: Deploy to production\n---\n\n1. Run tests: npm test\n2. Build: npm run build\n3. Deploy: ./scripts/deploy.sh\n```\n\nInvoke with `/deploy` in the REPL.\n\n---\n\n## 🔐 Multi-Provider Support\n\nWorks with 5 AI providers:\n\n```bash\n# Anthropic (default)\nANTHROPIC_API_KEY=... occ \"hello\"\n\n# OpenAI\nOPENAI_API_KEY=... occ -m gpt-4o \"hello\"\n\n# Google\nGOOGLE_AI_API_KEY=... occ -m gemini-2.5-flash \"hello\"\n\n# AWS Bedrock\nAWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... occ -m bedrock/claude-sonnet \"hello\"\n\n# Google Vertex\nGOOGLE_APPLICATION_CREDENTIALS=... occ -m vertex/claude-sonnet \"hello\"\n```\n\n---\n\n## 🔗 MCP Integration\n\nConnect to MCP servers for additional tools:\n\n```json\n// .mcp.json\n{\n  \"mcpServers\": {\n    \"my-server\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"my-mcp-server\"],\n      \"env\": { \"API_KEY\": \"...\" }\n    }\n  }\n}\n```\n\nSupports 4 transports: stdio, SSE, Streamable HTTP, WebSocket.\n\n---\n\n## 🔍 Background: The Claude Code Source Leak\n\nOn March 31, 2026, Anthropic accidentally shipped source maps in the Claude Code npm package, [exposing the full TypeScript source](https://www.sabrina.dev/p/claude-code-source-leak-analysis). This project takes a different approach — we use [ruDevolution](https://github.com/ruvnet/rudevolution) to analyze the **published npm package** legally and rebuild from that intelligence.\n\n### What ruDevolution Found\n\n| Discovery | Evidence |\n|-----------|---------|\n| 🤖 Agent Teams | `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` |\n| 🌙 Auto Dream Mode | `tengu_auto_dream_completed` |\n| 🔮 claude-opus-4-6 | Unreleased model ID |\n| 🔐 6 \"amber\" codenames | Internal feature gates |\n| ☁️ Cloud Code Runner | BYOC compute |\n| 📡 MCP Streamable HTTP | New transport |\n\n[Download decompiled releases →](https://github.com/ruvnet/rudevolution/releases)\n\n---\n\n## ⚖️ Legal\n\nThis is a **clean-room implementation** — no leaked source used. Architecture informed by analysis of the published npm package, legal under US DMCA §1201(f), EU Software Directive Art. 6, UK CDPA §50B.\n\n---\n\n## 📚 Related\n\n- [ruDevolution](https://github.com/ruvnet/rudevolution) — AI-Powered JavaScript Decompiler\n- [Decompiled Releases](https://github.com/ruvnet/rudevolution/releases) — Every Claude Code version\n- [v2 Architecture (ADR-001)](./docs/adr/ADR-001-v2-architecture.md)\n- [Path to 100% (ADR-002)](./docs/adr/ADR-002-path-to-100-percent.md)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eNightly Release Pipeline\u003c/b\u003e\u003c/summary\u003e\n\n### Automated Nightly Verified Releases (ADR-001)\n\nOpen Claude Code includes an automated nightly CI/CD pipeline that:\n\n1. **Detects** new Claude Code releases from npm registry (03:00 UTC daily)\n2. **Verifies** compatibility with 903+ tests, npm audit, and smoke tests\n3. **Analyzes** changes using Claude Sonnet 4.6 AI-powered discovery\n4. **Publishes** verified releases with detailed notes — only if ALL gates pass\n\n```\nCron 03:00 UTC → npm check → 903+ tests → npm audit → AI analysis → verified release\n```\n\n**Manual trigger:**\n```bash\ngh workflow run nightly.yml -f force_release=true\n```\n\n**Required secrets:**\n- `GITHUB_TOKEN` — automatic\n- `ANTHROPIC_API_KEY` — optional, for AI discovery analysis\n\nSee [ADR-001](docs/adr/ADR-001-nightly-verified-release-pipeline.md) for full architecture.\n\n### rudevolution Integration\n\nThe [rudevolution](https://github.com/ruvnet/rudevolution) submodule provides AI-powered decompilation analysis of Claude Code releases, tracking 34,759+ functions with 95.7% name accuracy. Used by the nightly pipeline for change discovery.\n\n\u003c/details\u003e\n\n## 📄 License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruvnet%2Fopen-claude-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruvnet%2Fopen-claude-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruvnet%2Fopen-claude-code/lists"}