{"id":47771393,"url":"https://github.com/kill136/claudecode","last_synced_at":"2026-04-06T12:00:55.427Z","repository":{"id":348256576,"uuid":"1197110362","full_name":"kill136/claudecode","owner":"kill136","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-02T03:13:52.000Z","size":9313,"stargazers_count":39,"open_issues_count":0,"forks_count":70,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T10:19:20.225Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kill136.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2026-03-31T10:34:57.000Z","updated_at":"2026-04-03T07:29:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ce59ca5-7262-400f-8491-3d2fec135833","html_url":"https://github.com/kill136/claudecode","commit_stats":null,"previous_names":["kill136/claudecode"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kill136/claudecode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kill136%2Fclaudecode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kill136%2Fclaudecode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kill136%2Fclaudecode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kill136%2Fclaudecode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kill136","download_url":"https://codeload.github.com/kill136/claudecode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kill136%2Fclaudecode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31433044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-04-03T09:53:40.577Z","updated_at":"2026-04-05T11:00:52.560Z","avatar_url":"https://github.com/kill136.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Code Source\n\nDeobfuscated source code of `@anthropic-ai/claude-code` v2.1.76.\n\n## Overview\n\nThis repository contains the reverse-engineered TypeScript source code from Anthropic's [Claude Code](https://www.npmjs.com/package/@anthropic-ai/claude-code) CLI tool. The official npm package ships as a single minified `cli.js` bundle (~12MB); this repo restores the original module structure with readable names, comments, and type annotations.\n\n**1,884 TypeScript/TSX source files | 35MB | 5,066 bundled modules**\n\n## Project Structure\n\n```\n├── package.json          # Dependencies \u0026 build scripts\n├── tsconfig.json         # TypeScript configuration\n├── src/                  # Source code (deobfuscated)\n│   ├── entrypoints/      # CLI, SDK, MCP entry points\n│   ├── tools/            # 40+ tool implementations\n│   ├── AgentTool/        # Sub-agent spawning \u0026 orchestration\n│   ├── BashTool/         # Shell command execution with sandbox\n│   ├── FileEditTool/     # String replacement file editing\n│   ├── FileReadTool/     # File reading (text, PDF, images)\n│   ├── FileWriteTool/    # File creation/overwrite\n│   ├── GlobTool/         # File pattern matching\n│   ├── GrepTool/         # Content search (ripgrep-based)\n│   ├── WebFetchTool/     # URL fetching \u0026 content extraction\n│   ├── WebSearchTool/    # Web search integration\n│   ├── SkillTool/        # Slash command / skill execution\n│   ├── LSPTool/          # Language Server Protocol integration\n│   ├── NotebookEditTool/ # Jupyter notebook editing\n│   └── ...               # TaskCreate/Get/Update/List/Stop, Cron, MCP, etc.\n├── bridge/               # IDE integration \u0026 remote control (CCR)\n├── query/                # Core query engine \u0026 token budget\n├── query.ts              # Main conversation loop (~68K lines)\n├── QueryEngine.ts        # High-level session management\n├── commands/             # 88+ slash commands\n├── commands.ts           # Command registry with feature gates\n├── components/           # React + Ink TUI components\n├── services/             # API, analytics, MCP, telemetry\n├── state/                # Zustand-like app state management\n├── context/              # System prompt \u0026 context assembly\n├── hooks/                # Pre/post tool execution hooks\n├── skills/               # Built-in skill definitions\n├── plugins/              # Plugin system (manifest, marketplace)\n├── coordinator/          # Multi-agent coordination mode\n├── buddy/                # Virtual companion system (Easter egg)\n├── vim/                  # Full Vim keybinding support\n├── voice/                # Voice input mode\n├── ink/                  # Custom Ink renderer \u0026 reconciler\n├── native-ts/            # TS ports of native modules (yoga, nucleo, syntect)\n├── remote/               # Remote session management\n├── server/               # Direct connect server\n├── memdir/               # Auto-memory system (MEMORY.md)\n├── keybindings/          # Keyboard shortcut system\n├── migrations/           # Version upgrade migrations\n├── upstreamproxy/        # Container HTTPS proxy (CCR)\n├── schemas/              # Zod validation schemas\n├── types/                # TypeScript type definitions\n├── utils/                # Utilities (permissions, sandbox, config, etc.)\n├── constants/            # Prompts, keys, system constants\n├── tasks/                # Background task types (Agent, Shell, Workflow)\n│   ├── Tool.ts           # Base tool interface \u0026 registry\n│   ├── tools.ts          # Tool list with feature-gated imports\n│   ├── cost-tracker.ts   # API cost tracking\n│   ├── history.ts        # Conversation history (JSONL)\n│   └── setup.ts          # Initialization \u0026 configuration\n└── dist/                 # Build output (not committed)\n```\n\n## Key Architectural Insights\n\n### Build System\n- Built with **Bun bundler** — uses `bun:bundle` `feature()` for compile-time dead code elimination (DCE)\n- `MACRO.*` build-time constants (VERSION, BUILD_TIME, etc.) injected via `--define`\n- React Compiler (`react/compiler-runtime`) for optimized component rendering\n- Single-file output: all 5,066 modules bundled into one `cli.js`\n\n### Feature Gates\nInternal feature flags control functionality via `feature()` from `bun:bundle`:\n- `PROACTIVE` / `KAIROS` — Proactive agent capabilities\n- `AGENT_TRIGGERS` / `AGENT_TRIGGERS_REMOTE` — Scheduled/remote agent execution\n- `MONITOR_TOOL` — Live monitoring tool\n- `ABLATION_BASELINE` — A/B testing baseline\n- `KAIROS_GITHUB_WEBHOOKS` — GitHub webhook subscriptions\n\n### Internal-Only Features\nSome tools/packages are restricted to Anthropic employees (`USER_TYPE === 'ant'`):\n- `REPLTool` — Interactive REPL execution\n- `SuggestBackgroundPRTool` — Background PR suggestions\n- `@ant/claude-for-chrome-mcp` — Chrome browser integration\n- `@anthropic-ai/sandbox-runtime` — Sandbox isolation runtime\n\n### Tool System\n- All tools implement a common interface (`Tool` from `Tool.ts`)\n- Input validation via **Zod** with `lazySchema()` for deferred initialization\n- Permission system: `canUseTool()` hooks with caching\n- Concurrent file edit protection via timestamp + content change detection\n- `ToolSearchTool` enables lazy tool discovery (deferred tool loading)\n\n### State Management\n- **AppStateStore** — Zustand-like reactive state for the TUI\n- **QueryEngine** — Manages conversation sessions, message history, compaction\n- **Session persistence** — JSONL-based history with paste storage\n\n## Building from Source\n\n### Prerequisites\n- [Bun](https://bun.sh/) \u003e= 1.0\n- Node.js \u003e= 18\n\n### Steps\n\n```bash\n# Install dependencies\nbun install\n\n# Build (you'll need to create stubs for internal @ant/* packages)\nbun build src/entrypoints/cli.tsx --outdir dist --target node \\\n  --external \"react/compiler-runtime\" \\\n  --define \"MACRO.VERSION='\\\"2.1.76\\\"'\" \\\n  --define \"MACRO.BUILD_TIME='\\\"$(date -I)\\\"'\" \\\n  --define \"MACRO.FEEDBACK_CHANNEL='\\\"stable\\\"'\" \\\n  --define \"MACRO.ISSUES_EXPLAINER='\\\"report issues\\\"'\" \\\n  --define \"MACRO.PACKAGE_URL='\\\"\\\"'\" \\\n  --define \"MACRO.NATIVE_PACKAGE_URL='\\\"\\\"'\" \\\n  --define \"MACRO.VERSION_CHANGELOG='\\\"\\\"'\"\n\n# Patch react/compiler-runtime import\nsed -i 's|from \"react/compiler-runtime\"|from \"./react-compiler-runtime.js\"|g' dist/cli.js\n\n# Run\nnode dist/cli.js --version\n```\n\n\u003e **Note**: ~10 source files are missing from this deobfuscation (internal tools, some type definitions). Stubs are needed for: `@ant/*` packages, `@anthropic-ai/sandbox-runtime`, `REPLTool`, `TungstenTool`, `color-diff-napi`, `modifiers-napi`.\n\n## Known Missing Files\n\n| File | Description |\n|------|-------------|\n| `tools/REPLTool/` | Interactive REPL (ant-only) |\n| `tools/TungstenTool/` | Internal monitoring tool |\n| `tools/SuggestBackgroundPRTool/` | Background PR tool (ant-only) |\n| `tools/VerifyPlanExecutionTool/` | Plan verification tool |\n| `keybindings/types.ts` | Keybinding type definitions |\n| `utils/filePersistence/types.ts` | File persistence types |\n| `services/compact/cachedMicrocompact.ts` | Cached micro-compaction |\n| `services/contextCollapse/` | Context collapse service |\n| `types/connectorText.ts` | Connector text block types |\n\n## Disclaimer\n\nThis repository is for **educational and research purposes only**. All rights belong to Anthropic PBC. The original source is subject to [Anthropic's legal agreements](https://code.claude.com/docs/en/legal-and-compliance).\n## Community\n\n- **Website:** [chatbi.site](https://www.chatbi.site)\n- **Discord:** [Join us](https://discord.gg/bNyJKk6PVZ)\n- **X (Twitter):** [@wangbingjie1989](https://x.com/wangbingjie1989)\n## Source Version\n\n- **Package**: `@anthropic-ai/claude-code`\n- **Version**: 2.1.76\n- **Date**: 2026-03-26\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkill136%2Fclaudecode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkill136%2Fclaudecode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkill136%2Fclaudecode/lists"}