Working Claude Code from Source

hackernews | | 📦 오픈소스
#ai 개발도구 #ai 딜 #anthropic #claude #claude code #cli #reverse engineering #오픈소스
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

제공된 기사는 소스 코드를 직접 빌드하여 클로드 코드(Claude Code)를 실행하고 활용하는 방법을 다루고 있습니다. 사용자는 이 과정을 통해 기본 제공되는 환경을 넘어 자신의 로컬 시스템에 맞춘 개발 환경을 세밀하게 최적화할 수 있습니다. 특히, 오픈소스 기반의 수정을 통해 기능을 확장하고 독자적인 AI 코딩 워크플로우를 구축하는 핵심 방법과 그 이점을 상세히 설명합니다.

본문

A working reverse-engineered Claude Code CLI codebase rebuilt from source analysis to reproduce the original terminal workflow, architecture, and engineering behavior. Start with the architecture docs Current focus: Environmental requirements You must have the latest version of bun, otherwise there will be a bunch of weird bugs!!! bun upgrade!!! - Bun >= 1.3.11 - Conventional way to configure CC, each major provider has its own configuration method # Development mode, if you see the version number 888, it means it is correct bun run dev # Build bun run build The build uses code splitting multi-file packaging (build.ts ), and the product is output to the dist/ directory (entry dist/cli.js + about 450 chunk files). The built version can be started by both bun and node. You can start it directly by publishing it to a private source. If you encounter a bug, please raise an issue directly and we will resolve it first. ✅ = implemented ⚠️ = partially implemented / conditionally enabled ❌ = stub / removed / feature flag closed | Capabilities | Status | Description | | REPL interactive interface (Ink terminal rendering) | ✅ | Home screen 5000+ lines, complete interaction | | API Communication — Anthropic Direct | ✅ | Support API Key + OAuth | | API Communication — AWS Bedrock | ✅ | Supports credential refresh, Bearer Token | | API Communication — Google Vertex | ✅ | Support GCP credential refresh | | API Communication — Azure Foundry | ✅ | Supports API Key + Azure AD | Streaming dialogue and tool call loop (query.ts ) | ✅ | 1700+ lines, including automatic compression and token tracking | Conversation Engine (QueryEngine.ts ) | ✅ | 1300+ lines to manage conversation state and attribution | | Context build (git status / CLAUDE.md / memory) | ✅ | context.ts complete implementation | | Permission system (plan/auto/manual mode) | ✅ | 6300+ lines, including YOLO classifier, path verification, rule matching | | Hook system (pre/post tool use) | ✅ | Support settings.json configuration | Session Resume (/resume ) | ✅ | Standalone ResumeConversation screen | Doctor Diagnosis (/doctor ) | ✅ | Version, API, plugin, sandbox check | | Automatic compression (compaction) | ✅ | auto-compact / micro-compact / API compact | | Tools | Status | Description | | BashTool | ✅ | Shell execution, sandbox, permission check | | FileReadTool | ✅ | File / PDF / Picture / Notebook Reading | | FileEditTool | ✅ | String replacement editing + diff tracking | | FileWriteTool | ✅ | File creation/overwriting + diff generation | | NotebookEditTool | ✅ | Jupyter Notebook cell editing | | AgentTool | ✅ | Subagent fork (fork/async/background/remote) | | WebFetchTool | ✅ | URL Fetching → Markdown → AI Summary | | WebSearchTool | ✅ | Web search + domain name filtering | | AskUserQuestionTool | ✅ | Multiple question interactive prompts + preview | | SendMessageTool | ✅ | Message sending (peers / teammates / mailbox) | | SkillTool | ✅ | Slash command / Skill call | | EnterPlanModeTool | ✅ | Enter planning mode | | ExitPlanModeTool (V2) | ✅ | Exit plan mode | | TodoWriteTool | ✅ | Todo List v1 | | BriefTool | ✅ | Short message + attachment sending | | TaskOutputTool | ✅ | Background task output reading | | TaskStopTool | ✅ | Background task stop | | ListMcpResourcesTool | ⚠️ | MCP resource list (filtered by specialTools, added under specific conditions) | | ReadMcpResourceTool | ⚠️ | MCP resource reading (same as above) | | SyntheticOutputTool | ⚠️ | Created only in non-interactive sessions (SDK/pipe mode) | | CronCreateTool | ✅ | Scheduled task creation (AGENT_TRIGGERS gate has been removed) | | CronDeleteTool | ✅ | Scheduled task deletion | | CronListTool | ✅ | Scheduled task list | | EnterWorktreeTool | ✅ | Enter Git Worktree (isWorktreeModeEnabled() is hardcoded to true) | | ExitWorktreeTool | ✅ | Exit Git Worktree | Tools — Conditional Enablement | Tools | Status | Enablement Conditions | | GlobTool | ✅ | Enabled when bfs/ugrep is not embedded (enabled by default) | | GrepTool | ✅ | Same as above | | TaskCreateTool | ⚠️ | When isTodoV2Enabled() is true | | TaskGetTool | ⚠️ | Same as above | | TaskUpdateTool | ⚠️ | Same as above | | TaskListTool | ⚠️ | Same as above | | TeamCreateTool | ⚠️ | isAgentSwarmsEnabled() | | TeamDeleteTool | ⚠️ | Same as above | | ToolSearchTool | ⚠️ | isToolSearchEnabledOptimistic() | | PowerShellTool | ⚠️ | Windows Platform Detection | | LSPTool | ⚠️ | ENABLE_LSP_TOOL environment variable | | ConfigTool | ❌ | USER_TYPE === 'ant' (always false) | Tools — Feature Flag Off (all disabled) | Tools | Feature Flag | | SleepTool | PROACTIVE / KAIROS | | RemoteTriggerTool | AGENT_TRIGGERS_REMOTE | | MonitorTool | MONITOR_TOOL | | SendUserFileTool | KAIROS | | OverflowTestTool | OVERFLOW_TEST_TOOL | | TerminalCaptureTool | TERMINAL_PANEL | | WebBrowserTool | WEB_BROWSER_TOOL | | SnipTool | HISTORY_SNIP | | WorkflowTool | WORKFLOW_SCRIPTS | | PushNotificationTool | KAIROS / KAIROS_PUSH_NOTIFICATION | | SubscribePRTool | KAIROS_GITHUB_WEBH

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →