Skip to content

Main feature map for Claude Code

This document continues the reverse-engineering analysis of Claude Code. Its goal is to answer a product/runtime question: what major capabilities are implemented by cli.renamed.js, and how do those capabilities connect?

The file is bundled/minified production JavaScript. The document therefore uses semantic aliases such as OuterBootstrap, CommanderRoot, HeadlessRunner, InteractiveSessionLoop, McpCoordinator, SessionRestorer, and RemoteControlBridge. Minified names are secondary search handles; exact strings below anchor this @anthropic-ai/claude-code@2.1.215 build.

Executive summary

cli.renamed.js is not a thin prompt wrapper. It is the main Claude Code agent runtime. Its outer ZIS() router selects version output, internal hosts/helpers, bridge, daemon/background, fleet, or normal CLI startup; the normal UkS()jkS() path then parses the command surface and composes interactive/headless/remote sessions. The bundle also loads settings and managed policy, initializes authentication and model/provider state, manages sessions, assembles tools, applies permissions, loads MCP servers and plugins, orchestrates custom and background agents, and handles accessibility, observability, updates, and coordinated shutdown.

The 2.1.215 snapshot adds several source-confirmed surfaces that were absent from the previous 2.1.143 documentation baseline: Sonnet 5, Opus 4.8, and Fable 5 model records; the Workflow tool and /workflows UI; background-by-default and nested subagents; experimental observer agents and Agent Teams; the gated EndConversation lifecycle; /fork background copies plus /subtask; session-bound Projects knowledge, Artifact publishing, and Claude Design/design-system sync; screen-reader and safe modes; MCP tool refresh/auto-backgrounding; richer hooks and telemetry; and hard per-session WebSearch/subagent budgets. The second-round audit also promotes two substantial older-but-underdocumented subsystems—macOS computer-use MCP and /team-onboarding guide sharing—without misclassifying them as new package deltas.

Two useful lenses for the runtime are context engineering and harness engineering:

  • Context engineering decides what the model can see: system prompts, CLAUDE.md, settings, output styles, tools, agents, MCP prompts/resources, memories, file inputs, and session history.
  • Harness engineering decides how the model is embedded in a usable coding-agent runtime: modes, sessions, tools, permissions, hooks, streaming, retries, remote control, telemetry, and update behavior.

Source anchors

AreaSemantic aliasMinified anchor / exact stringRole
Build identityAnalyzedBuildVERSION: "2.1.215", BUILD_TIME: "2026-07-19T00:01:04Z"Pins every generated/minified anchor to one package build.
Bootstrap/CommanderOuterBootstrap / CommanderRootZIS(), UkS(), jkS(), Claude Code - starts an interactive session by default, --printRoutes specialized processes before the normal main, then builds/parses the ordinary command surface.
HeadlessHeadlessRunner--output-format=stream-json, control_request, prompt_suggestionRuns print/SDK stream-JSON mode and drains control/message loops.
Interactive/accessibilityInteractiveSessionLoop--ax-screen-reader, CLAUDE_AX_SCREEN_READER, /resumeRuns the TUI/session loop, picker, and flat accessibility renderer.
Conversation terminationEndConversationToolEndConversation, ended-by-model, tengu_umber_kestrelReflects twice, persists terminal state, aborts the turn, and blocks resumed work.
MCPMcpCoordinatortools/list, roots/list, notifications/roots/list_changed, keeping previous tools, RefreshMcpToolsConnects MCP servers, publishes roots, and preserves last-good capability fields when a list-change refresh fails.
Background daemonDaemonSupervisorkrm(), BG_PROTO = 1, controlRequest, leaseSupervises background handles through a versioned/authenticated newline-delimited local control protocol and transient keep-alive leases.
Enterprise gatewayGatewayServerclaude gateway --config, startGateway(), /oauth/device_authorization, /v1/messages, /managed/settingsRuns a native-only corporate auth/inference/policy/spend/OTLP gateway.
Native computer controlComputerUseMcpServercomputer-use, request_access, computer-use.lockControls approved macOS applications through a session-wired MCP and layered native policy.
SessionsSessionRestorertranscriptSource:"local-jsonl", --resume, --fork-sessionFinds recent sessions and restores or forks transcript state.
Tools/workflowsBuiltInToolNamesBash, Read, Edit, WebFetch, WebSearch, Agent, Workflow, RefreshMcpToolsCore coding, delegation, orchestration, and integration capabilities.
Hosted knowledgeProjectsToolCLAUDE_PROJECT_UUID, project_info, project_search, project_writeBinds one session to one durable claude.ai Project knowledge container.
Hosted creationArtifactTool, DesignTool, DesignSyncToolArtifact, ClaudeDesign, DesignSyncPublishes versioned pages and edits/synchronizes collaborative design projects under account/policy gates.
Hosted onboardingTeamOnboardingSkill, ShareOnboardingGuideTool/team-onboarding, ONBOARDING.md, allow_team_onboardingSummarizes bounded local usage into a guide and optionally maintains an organization share link.
Observer automationObserverPairingRegistryobserver, observer-ref, ObserverReportAuto-spawns read-only observers, resumes pairings, and delivers one-way advice.
HooksHookEventsPreToolUse, PostToolBatch, MessageDisplay, SessionStart, TaskCreatedAuthorization, display, lifecycle, task, and automation event surface.
Ops/recoveryTrafficAndDebugGatesCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, --safe-mode, CLAUDE_CODE_SAFE_MODEDebug/traffic policy plus configuration-isolation recovery.

Runtime system map

flowchart TB
Cli[cli.js bundled runtime] --> Bootstrap[Bootstrap and command surface]
Bootstrap --> Specialized[Internal hosts / bridge / daemon / background]
Cli --> Modes[Runtime modes]
Cli --> Context[Context and model loop]
Cli --> Tools[Tools and permissions]
Cli --> Sessions[Sessions and persistence]
Cli --> Integrations[MCP / plugins / IDE / Chrome]
Cli --> Agents[Agents and automation]
Cli --> Ops[Diagnostics / telemetry / update]
Cli --> Accessibility[Screen reader / safe mode]
Bootstrap --> Commands[auth / mcp / plugin / project / agents / doctor / update / install]
Modes --> TUI[Interactive TUI]
Modes --> Headless[Print / SDK stream JSON]
Modes --> Remote[Remote / teleport / Remote Control]
Context --> Prompt[CLAUDE.md / settings / system prompt / output styles]
Context --> Models[Auth / models / providers]
Context --> Stream[Provider request and streaming response]
Tools --> Builtins[Built-in coding tools]
Tools --> Policy[Allow/deny / permission mode / hooks]
Tools --> External[MCP tools / plugins / browser / IDE]
Sessions --> Jsonl[local-jsonl transcripts]
Sessions --> Resume[resume / continue / fork / rewind]
Sessions --> Bridge[remote session ingress]
Agents --> Custom[custom agents]
Agents --> Task[Task and background agent commands]
Agents --> Teams[Agent Teams roster / tasks / mailboxes]
Agents --> Review[ultrareview / auto-mode]
Agents --> Workflows[Workflow tool / ultracode / workflows view]
Specialized --> Daemon[Local background supervisor]

Major feature matrix

Feature areaEntry point or triggerMain capabilitiesPrimary docs
Package/Bun startupNative Bun standalone artifact, .bun graph entrypointExtracted graph identifies the CLI entrypoint and embedded image/audio N-API modules; exact wrapper-to-native handoff is not retained in this checkout.Package and Bun bootstrap
CLI command shellclaude, root flags, subcommandsVersion, root mode dispatch, auth, mcp, plugin, project, agents, doctor, update, install.Command-line reference
Background supervisordaemon/background routes, claude agents, leases/control socketOn-demand or gated service-origin supervisor, worker adoption, dispatch/attach/reply/kill, idle/takeover, and local protocol checks.Daemon and background service
Interactive modeDefault TTY runSetup/login/trust screens, TUI root, resume picker, tools/agents/MCP load, and the interactive session loop.CLI main paths
Conversation terminationGated EndConversation toolTwo-call reflection, durable ended-by-model marker, interactive blocking, headless shutdown, and /clear recovery.Conversation termination
Headless/SDK mode-p, --print, --sdk-url, non-TTY stdout, --init-onlyPrompt/stdin ingestion, stream-JSON input/output, permission/control frames, JSON/text result output.Headless streaming and resilience
Prompt/contextCLAUDE.md, .claude/settings.json, --system-prompt, --append-system-prompt, --add-dir, output stylesRuntime instruction sources, memory files, dynamic system prompt sections, slash-command/skill/agent context.Prompt, context, and memory
Models/auth/providersANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, OAuth token FDs, provider env vars, --modelFirst-party/OAuth/API key auth, Bedrock/Vertex/Foundry/Anthropic AWS/Mantle provider selection, model aliases, thinking/budget flags.Models, providers, and auth
Built-in tools and permissionsTool constants plus --tools, --allowedTools, --disallowedTools, --permission-modeFile, shell, notebook, web, todo, skill, and task tools gated by filters, deny/allow rules, hooks, and permission modes.Built-in tools and permissions
MCP/plugins/hooks/computer usemcp, plugin, --mcp-config, --plugin-dir, mcp__computer-use__*, hooks eventsMCP config/transport/readiness, hosted discovery, plugin marketplaces/session plugins, hook policy, and macOS application control.MCP, plugins, and hooks, Computer-use MCP
Settings/policy/integrations.claude/settings.json, managed settings, --settings, --ide, --chromeLayered settings, config roots, policy toggles, IDE/Chrome/file integration, API-key helper scripts.Settings, policy, and integrations
Status-line commandsstatusLine, subagentStatusLine, /statuslineJSON stdin state, debounced/periodic refresh, local shell execution, prompt-line rendering, and separate JSONL task-row decoration.Status line runtime and command protocol
Sessions and transcripts--continue, --resume, --session-id, JSONL pathsLocal transcript roots, latest-session lookup, resume/continue, fork, no-persistence, rewind.Session resume and transcripts
Cloud/teleport/control--cloud (deprecated --remote), --teleport, remote-control, --rc, remote token env varsHosted session creation/attach, teleport hydration, Remote Control bridge, permission forwarding.Remote control and teleport
Remote runner data planeagent proxy, /mnt/user-data/working, /uploads, staged MCPPolicy-enforced HTTPS CONNECT tunneling, tool trust, optimistic working-file sync, filestore staging, and MCP file lanes.Remote-environment egress and file staging
Hosted projects/artifacts/design/onboardingCLAUDE_PROJECT_UUID, Projects, Artifact, ClaudeDesign, DesignSync, /team-onboardingAttached knowledge context and CRUD, versioned hosted pages, collaborative design, guarded design-system sync, and optional onboarding-guide sharing.Hosted Projects and knowledge, Team onboarding and share flows, Artifact publishing and live pages, Claude Design and design-system sync
Agents and automationagents, --agents, Agent, CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS, observer, ObserverReport, /fork, /subtask, Workflow, ultrareview, auto-modeBackground sessions, custom agents, background-by-default/nested subagents, experimental Agent Teams/observers, deterministic workflows, and classifier inspection.Agents, tasks, and subagents, Agent Teams, Observer agents, Dynamic workflows
Diagnostics/ops/media--debug-file, doctor, update, telemetry env vars, image/audio N-API modulesDebug logs, telemetry and traffic gates, native updater, doctor checks, media module extraction.Diagnostics and debug logs, Telemetry and tracing, Updater and doctor, Media native modules
Enterprise gateway servergateway --config <path>OIDC device login, Postgres state/migrations, provider routing, managed settings, spend administration/metering, OTLP relay, health/readiness, and SSRF/TLS controls.Enterprise gateway server

Takeaways

The main capabilities in cli.renamed.js can be summarized as: bootstrap, modes, context, models, tools, integrations, sessions, hosted collaboration, remote control, agents, and operations.

More concretely:

  1. ZIS(), UkS(), and jkS() form the startup spine: specialized process roles are selected before ordinary Commander parsing.
  2. HeadlessRunner/HeadlessControlLoop and InteractiveSessionLoop/InteractiveResumePicker are the two main execution spines: headless/SDK and interactive TUI.
  3. McpCoordinator, McpCommandRegistrar, and PluginCommandRegistrar show that MCP and plugins are first-class integration systems, not afterthoughts.
  4. Tool-name constants and permission flags show a guarded action runtime around file, shell, notebook, web, todo, skill, and task capabilities.
  5. SessionDiscovery, SessionRestore, JSONL transcript roots, ended-by-model, observer-ref, remote tokens, bridge code, and teleport helpers show that durable metadata and remote handoff are core runtime modules. ended-by-model is restored in both direct and picker resume paths; its marker write remains best-effort.
  6. ComputerUseMcpServer, TeamOnboardingSkill, and hosted connector/plugin/skill discovery show that integrations can combine local runtime state with separately gated host/account services.
  7. The daemon control socket, MCP refresh reducer, and team inbox show explicit trust/failure boundaries: sensitive daemon operations authenticate, failed MCP discovery retains last-good fields, and inbox-delivered permission-rule updates are dropped.
  8. Debug/telemetry/update constants and embedded image/audio N-API modules round out the operational and media-support layer.

Use this document as the map; use the linked implementation pages for source anchors and edge cases.

Created and maintained by Yingting Huang.