# dhrbc/claude-code architecture

> Architecture diagram of the GitHub repository dhrbc/claude-code, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dhrbc/claude-code
- Repository: https://github.com/dhrbc/claude-code

## Overview

1. **Overall shape**
   - This repo is a **terminal-first agentic CLI** built in **TypeScript** on **Bun**, with a **React + Ink** UI layer for rendering in the terminal.
   - The main architectural pattern is: **user input → command/tool dispatch → query engine / service layer → streamed output back to the terminal**, with many side systems attached for permissions, sessions, plugins, remote control, and background tasks.

2. **Startup and runtime entrypoints**
   - `src/main.tsx`, `src/entrypoints/*`, and `src/setup.ts` are the startup boundary.
   - Bootstrapping initializes config, settings, analytics/feature flags, keychain/credential access, and terminal/UI state before the interactive session begins.
   - `src/bootstrap/*` and `src/state/*` hold early app state and cross-cutting state management that the rest of the app reads from.

3. **Interactive shell UI**
   - `src/ink/` is a custom Ink/terminal rendering layer rather than a thin wrapper; it owns terminal layout, input events, focus, selection, screen rendering, and terminal-specific primitives.
   - `src/components/` contains most UI building blocks: prompt input, message timeline, dialogs, task panels, permission dialogs, settings, onboarding, and status indicators.
   - `src/screens/` provides full-screen flows such as Doctor, REPL, and Resume conversation.

4. **Core conversation and LLM orchestration**
   - `src/QueryEngine.ts`, `src/query/`, `src/utils/query*`, and `src/constants/*` form the central agent loop.
   - This layer is responsible for sending prompts to the model, streaming responses, handling retries, managing context budgets, and orchestrating tool calls.
   - `src/context.ts`, `src/history.ts`, `src/assistant/sessionHistory.ts`, and `src/cost-tracker.ts` feed the engine with conversation state, prior turns, and usage accounting.

5. **Tool execution boundary**
   - `src/tools/` defines each actionable capability as an isolated tool module: shell execution, file read/write/edit, search, web fetch/search, notebook edits, MCP, LSP, tasks, team messaging, plan/worktree toggles, cron, and remote triggers.
   - `src/Tool.ts` and `src/tools.ts` define the tool type system and registry.
   - Tool execution is mediated by `src/services/tools/*` and `src/utils/tool*`, which handle streaming execution, orchestration, result storage, schema caching, and collapsing/formatting outputs for the UI.

6. **Permission and safety boundary**
   - Tool calls do not execute directly; they pass through `src/hooks/toolPermission/*` and `src/components/permissions/*`.
   - This layer decides whether a request is auto-approved, denied, or surfaced to the user based on permission mode, workspace rules, sandbox state, and tool-specific safety checks.
   - Shell-related tools have extra guardrails in `src/tools/BashTool/*`, `src/tools/PowerShellTool/*`, and `src/utils/permissions/*` for destructive commands, path validation, and read-only enforcement.

7. **Commands vs tools**
   - `src/commands/` is the user-facing slash-command subsystem; these commands configure the app, manage sessions, inspect state, and launch specialized workflows.
   - `src/commands.ts` acts as the registry/dispatch layer for command discovery.
   - In diagram terms: **commands are control-plane actions**, while **tools are data-plane actions** that the model can invoke during a conversation.

8. **External service integrations**
   - `src/services/api/*` is the Anthropic API/client boundary and includes bootstrap, usage, file APIs, session ingress, retries, and error handling.
   - `src/services/oauth/*` handles authentication flows and token management.
   - `src/services/analytics/*` provides telemetry and feature-flag infrastructure, while `src/services/notifier.ts` and related utilities feed user-facing status/notification paths.
   - `src/services/lsp/*`, `src/services/mcp/*`, and `src/services/plugins/*` are the primary integration surfaces with external developer tooling ecosystems.

9. **Bridge and remote-control subsystem**
   - `src/bridge/` is a dedicated bidirectional bridge between the CLI and IDE/remote environments.
   - It includes session creation, bridge messaging, permission callbacks, JWT/auth utilities, remote bridge transport, and REPL bridge handling.
   - This is a distinct boundary from normal local CLI execution: it enables the app to be controlled or observed by IDE extensions, remote sessions, or connected runtimes.

10. **Tasks, agents, and multi-worker orchestration**
   - `src/tasks/`, `src/task.ts`, `src/tasks.ts`, and `src/components/tasks/*` model background work, shell tasks, remote tasks, and in-process teammate/agent tasks.
   - `src/coordinator/`, `src/tools/AgentTool/*`, and `src/utils/swarm/*` support multi-agent coordination and team-style parallel work.
   - `src/utils/task/*`, `src/utils/concurrentSessions.ts`, and related helpers handle task lifecycle, output formatting, and task visibility in the UI.

11. **Plugins, skills, and extensibility**
   - `src/plugins/`, `src/services/plugins/*`, and `src/utils/plugins/*` implement a plugin platform for loading commands, tools, hooks, output styles, and marketplace content.
   - `src/skills/` and `src/tools/SkillTool/*` provide reusable workflows that can be bundled or loaded from disk.
   - `src/utils/hooks/*` and `src/schemas/hooks.ts` suggest a hook system that lets plugins and skills participate in lifecycle events, prompt processing, and post-processing.

12. **Persistence, memory, and session recovery**
   - `src/memdir/`, `src/services/SessionMemory/*`, `src/services/teamMemorySync/*`, `src/utils/session*`, and `src/utils/filePersistence/*` manage long-lived memory, session artifacts, and resumable state.
   - `src/commands/resume`, `src/commands/clear`, `src/commands/rename`, and `src/commands/export` expose user control over that persisted state.
   - The important architectural boundary is between **ephemeral turn state** in the active session and **persistent memory/session stores** used across launches.

13. **Platform-specific and terminal-adjacent subsystems**
   - `src/keybindings/`, `src/vim/`, `src/voice/`, `src/buddy/`, and `src/components/PromptInput/*` add interaction modes and input processing around the core CLI.
   - `src/upstreamproxy/`, `src/server/`, `src/remote/`, and `src/utils/deepLink/*` support networking, remote sessions, and environment handoff.
   - `src/native-ts/` contains lower-level utilities that back some performance-sensitive functionality such as layout or file indexing.

14. **How to draw the main flow**
   - A good diagram centers on the path: **terminal input/UI → command or prompt processing → query engine → tool/permission layer → external services and filesystem/shell → streamed results back to UI**.
   - Around that core, show side bands for **bridge/remote control**, **tasks/agents**, **plugins/skills/hooks**, and **persistent memory/session state**.
   - The main trust boundaries are: **user vs automated tool execution**, **local CLI vs remote/IDE bridge**, and **application state vs external services**.

Main entry points: [`src/QueryEngine.ts`](https://github.com/dhrbc/claude-code/blob/main/src/QueryEngine.ts) (Query Engine), [`src/services/tools/toolOrchestration.ts`](https://github.com/dhrbc/claude-code/blob/main/src/services/tools/toolOrchestration.ts) (Tool Exec), [`src/components/App.tsx`](https://github.com/dhrbc/claude-code/blob/main/src/components/App.tsx) (App Shell), [`src/setup.ts`](https://github.com/dhrbc/claude-code/blob/main/src/setup.ts) (Setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_main["Main<br/>entrypoint<br/>[main.tsx]"]
  node_setup["Setup<br/>bootstrap<br/>[setup.ts]"]
  node_cli_entry["CLI Entry<br/>entrypoint<br/>[cli.tsx]"]
  node_app_state[("App State<br/>state store<br/>[AppState.tsx]")]
end

subgraph group_ui["Terminal UI"]
  node_ink_runtime["Ink Runtime<br/>terminal renderer<br/>[ink.tsx]"]
  node_app_ui["App Shell<br/>ui root<br/>[App.tsx]"]
  node_prompt_input["Prompt Input<br/>input UI<br/>[PromptInput.tsx]"]
  node_messages_ui["Messages<br/>timeline UI<br/>[Messages.tsx]"]
end

subgraph group_agent["Agent Core"]
  node_query_engine{{"Query Engine<br/>agent loop<br/>[QueryEngine.ts]"}}
  node_process_input["Input Router<br/>command parser"]
  node_commands_registry["Commands<br/>control plane<br/>[commands.ts]"]
  node_context_state[("Context<br/>conversation state<br/>[context.ts]")]
end

subgraph group_tools["Tools"]
  node_tool_registry["Tools<br/>tool registry<br/>[tools.ts]"]
  node_tool_types["Tool Types<br/>tool schema<br/>[Tool.ts]"]
  node_tool_exec["Tool Exec<br/>tool orchestration"]
  node_bash_tool{{"Bash Tool<br/>shell tool<br/>[BashTool.tsx]"}}
  node_file_tool{{"File Tool<br/>filesystem tool<br/>[FileReadTool.ts]"}}
end

subgraph group_integrations["Integrations"]
  node_api_client["Anthropic API<br/>model client<br/>[client.ts]"]
  node_oauth_client["OAuth<br/>auth service<br/>[client.ts]"]
  node_lsp_mgr["LSP<br/>language integration<br/>[manager.ts]"]
  node_mcp_conn["MCP<br/>tooling integration"]
  node_bridge_main["Bridge<br/>[bridgeMain.ts]"]
end

subgraph group_extensibility["Extensibility"]
  node_plugins_core["Plugins<br/>extension platform<br/>[builtinPlugins.ts]"]
  node_skills_core["Skills<br/>workflow library<br/>[bundledSkills.ts]"]
end

subgraph group_persistence["Persistence"]
  node_history_state[("History<br/>[history.ts]")]
  node_session_memory[("Session Memory<br/>persistent memory<br/>[sessionMemory.ts]")]
  node_memdir[("Memdir<br/>memory store<br/>[memdir.ts]")]
end

subgraph group_execution["Execution"]
  node_remote_mgr["Remote Sessions<br/>remote runtime"]
  node_tasks_api[("Tasks<br/>background work<br/>[tasks.ts]")]
  node_shell_task["Shell Task<br/>task runner<br/>[LocalShellTask.tsx]"]
end

node_main -->|"bootstraps"| node_setup
node_setup -->|"launches"| node_cli_entry
node_setup -->|"initializes"| node_app_state
node_cli_entry -->|"starts UI"| node_ink_runtime
node_ink_runtime -->|"renders"| node_app_ui
node_app_ui -->|"captures input"| node_prompt_input
node_app_ui -->|"shows transcript"| node_messages_ui
node_prompt_input -->|"submits"| node_process_input
node_process_input -->|"slash commands"| node_commands_registry
node_process_input -->|"prompt text"| node_query_engine
node_commands_registry -->|"updates state"| node_app_state
node_query_engine -->|"reads context"| node_context_state
node_query_engine -->|"reads history"| node_history_state
node_query_engine -->|"selects tools"| node_tool_registry
node_query_engine -->|"calls model"| node_api_client
node_tool_registry -->|"typed by"| node_tool_types
node_tool_registry -->|"executes via"| node_tool_exec
node_tool_exec -->|"runs shell"| node_bash_tool
node_tool_exec -->|"reads files"| node_file_tool
node_bash_tool -->|"returns result"| node_tool_exec
node_file_tool -->|"returns result"| node_tool_exec
node_tool_exec -->|"streams output"| node_messages_ui
node_tool_exec -->|"persists artifacts"| node_session_memory
node_session_memory -->|"writes disk"| node_memdir
node_query_engine -->|"consults"| node_lsp_mgr
node_query_engine -->|"uses tooling"| node_mcp_conn
node_query_engine -->|"extends"| node_plugins_core
node_query_engine -->|"loads skills"| node_skills_core
node_bridge_main -->|"bridges"| node_remote_mgr
node_bridge_main -->|"syncs state"| node_app_state
node_remote_mgr -->|"spawns"| node_tasks_api
node_tasks_api -->|"includes"| node_shell_task
node_tasks_api -->|"surfaces status"| node_app_ui
node_oauth_client -->|"authenticates"| node_api_client

click node_main "https://github.com/dhrbc/claude-code/blob/main/src/main.tsx"
click node_setup "https://github.com/dhrbc/claude-code/blob/main/src/setup.ts"
click node_cli_entry "https://github.com/dhrbc/claude-code/blob/main/src/entrypoints/cli.tsx"
click node_app_state "https://github.com/dhrbc/claude-code/blob/main/src/state/AppState.tsx"
click node_ink_runtime "https://github.com/dhrbc/claude-code/blob/main/src/ink/ink.tsx"
click node_app_ui "https://github.com/dhrbc/claude-code/blob/main/src/components/App.tsx"
click node_prompt_input "https://github.com/dhrbc/claude-code/blob/main/src/components/PromptInput/PromptInput.tsx"
click node_messages_ui "https://github.com/dhrbc/claude-code/blob/main/src/components/Messages.tsx"
click node_query_engine "https://github.com/dhrbc/claude-code/blob/main/src/QueryEngine.ts"
click node_process_input "https://github.com/dhrbc/claude-code/blob/main/src/utils/processUserInput/processUserInput.ts"
click node_commands_registry "https://github.com/dhrbc/claude-code/blob/main/src/commands.ts"
click node_context_state "https://github.com/dhrbc/claude-code/blob/main/src/context.ts"
click node_history_state "https://github.com/dhrbc/claude-code/blob/main/src/history.ts"
click node_tool_registry "https://github.com/dhrbc/claude-code/blob/main/src/tools.ts"
click node_tool_types "https://github.com/dhrbc/claude-code/blob/main/src/Tool.ts"
click node_tool_exec "https://github.com/dhrbc/claude-code/blob/main/src/services/tools/toolOrchestration.ts"
click node_bash_tool "https://github.com/dhrbc/claude-code/blob/main/src/tools/BashTool/BashTool.tsx"
click node_file_tool "https://github.com/dhrbc/claude-code/blob/main/src/tools/FileReadTool/FileReadTool.ts"
click node_api_client "https://github.com/dhrbc/claude-code/blob/main/src/services/api/client.ts"
click node_oauth_client "https://github.com/dhrbc/claude-code/blob/main/src/services/oauth/client.ts"
click node_lsp_mgr "https://github.com/dhrbc/claude-code/blob/main/src/services/lsp/manager.ts"
click node_mcp_conn "https://github.com/dhrbc/claude-code/blob/main/src/services/mcp/MCPConnectionManager.tsx"
click node_bridge_main "https://github.com/dhrbc/claude-code/blob/main/src/bridge/bridgeMain.ts"
click node_remote_mgr "https://github.com/dhrbc/claude-code/blob/main/src/remote/RemoteSessionManager.ts"
click node_tasks_api "https://github.com/dhrbc/claude-code/blob/main/src/tasks.ts"
click node_shell_task "https://github.com/dhrbc/claude-code/blob/main/src/tasks/LocalShellTask/LocalShellTask.tsx"
click node_plugins_core "https://github.com/dhrbc/claude-code/blob/main/src/plugins/builtinPlugins.ts"
click node_skills_core "https://github.com/dhrbc/claude-code/blob/main/src/skills/bundledSkills.ts"
click node_session_memory "https://github.com/dhrbc/claude-code/blob/main/src/services/SessionMemory/sessionMemory.ts"
click node_memdir "https://github.com/dhrbc/claude-code/blob/main/src/memdir/memdir.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_setup,node_cli_entry,node_app_state,node_history_state,node_session_memory,node_memdir toneBlue
class node_ink_runtime,node_app_ui,node_prompt_input,node_messages_ui,node_remote_mgr,node_tasks_api,node_shell_task toneAmber
class node_query_engine,node_process_input,node_commands_registry,node_context_state toneMint
class node_tool_registry,node_tool_types,node_tool_exec,node_bash_tool,node_file_tool toneRose
class node_api_client,node_oauth_client,node_lsp_mgr,node_mcp_conn,node_bridge_main toneIndigo
class node_plugins_core,node_skills_core toneTeal
```

## Components

### Runtime

Startup, CLI entrypoints, app state, and shell loop

- [Main](https://github.com/dhrbc/claude-code/blob/main/src/main.tsx): entrypoint · Primary startup entry · `src/main.tsx`
- [Setup](https://github.com/dhrbc/claude-code/blob/main/src/setup.ts): bootstrap · Initial app setup and environment wiring · `src/setup.ts`
- [CLI Entry](https://github.com/dhrbc/claude-code/blob/main/src/entrypoints/cli.tsx): entrypoint · Command-line bootstrap and CLI transport · `src/entrypoints/cli.tsx`
- [App State](https://github.com/dhrbc/claude-code/blob/main/src/state/AppState.tsx): state store · Shared application state and selectors · `src/state/AppState.tsx`

### Terminal UI

Ink renderer, screens, and interactive components

- [Ink Runtime](https://github.com/dhrbc/claude-code/blob/main/src/ink/ink.tsx): terminal renderer · Custom terminal rendering and event system · `src/ink/ink.tsx`
- [App Shell](https://github.com/dhrbc/claude-code/blob/main/src/components/App.tsx): ui root · Top-level terminal UI composition · `src/components/App.tsx`
- [Prompt Input](https://github.com/dhrbc/claude-code/blob/main/src/components/PromptInput/PromptInput.tsx): input UI · User text, modes, and queued commands · `src/components/PromptInput/PromptInput.tsx`
- [Messages](https://github.com/dhrbc/claude-code/blob/main/src/components/Messages.tsx): timeline UI · Conversation transcript and message rendering · `src/components/Messages.tsx`

### Agent Core

Conversation loop, context, history, and command processing

- [Query Engine](https://github.com/dhrbc/claude-code/blob/main/src/QueryEngine.ts): agent loop · Central prompt-to-response orchestration · `src/QueryEngine.ts`
- [Input Router](https://github.com/dhrbc/claude-code/blob/main/src/utils/processUserInput/processUserInput.ts): command parser · Routes slash commands, bash input, and text prompts · `src/utils/processUserInput/processUserInput.ts`
- [Commands](https://github.com/dhrbc/claude-code/blob/main/src/commands.ts): control plane · Slash-command registry and dispatch · `src/commands.ts`
- [Context](https://github.com/dhrbc/claude-code/blob/main/src/context.ts): conversation state · Active context, turn state, and budgets · `src/context.ts`

### Tools

Tool registry, execution, and representative tool implementations

- [Tools](https://github.com/dhrbc/claude-code/blob/main/src/tools.ts): tool registry · Tool definitions and registry · `src/tools.ts`
- [Tool Types](https://github.com/dhrbc/claude-code/blob/main/src/Tool.ts): tool schema · Shared tool type system · `src/Tool.ts`
- [Tool Exec](https://github.com/dhrbc/claude-code/blob/main/src/services/tools/toolOrchestration.ts): tool orchestration · Streaming tool execution and result handling · `src/services/tools/toolOrchestration.ts`
- [Bash Tool](https://github.com/dhrbc/claude-code/blob/main/src/tools/BashTool/BashTool.tsx): shell tool · Shell execution with validation and guardrails · `src/tools/BashTool/BashTool.tsx`
- [File Tool](https://github.com/dhrbc/claude-code/blob/main/src/tools/FileReadTool/FileReadTool.ts): filesystem tool · Read/write/edit file actions · `src/tools/FileReadTool/FileReadTool.ts`

### Integrations

External APIs and developer-tool bridges

- [Anthropic API](https://github.com/dhrbc/claude-code/blob/main/src/services/api/client.ts): model client · Model API client and retries · `src/services/api/client.ts`
- [OAuth](https://github.com/dhrbc/claude-code/blob/main/src/services/oauth/client.ts): auth service · Token and login flow handling · `src/services/oauth/client.ts`
- [LSP](https://github.com/dhrbc/claude-code/blob/main/src/services/lsp/manager.ts): language integration · Language server management and diagnostics · `src/services/lsp/manager.ts`
- [MCP](https://github.com/dhrbc/claude-code/blob/main/src/services/mcp/MCPConnectionManager.tsx): tooling integration · Model Context Protocol connections and transport · `src/services/mcp/MCPConnectionManager.tsx`
- [Bridge](https://github.com/dhrbc/claude-code/blob/main/src/bridge/bridgeMain.ts): remote bridge · IDE and remote control bridge boundary · `src/bridge/bridgeMain.ts`

### Extensibility

Plugins, skills, hooks, and custom workflows

- [Plugins](https://github.com/dhrbc/claude-code/blob/main/src/plugins/builtinPlugins.ts): extension platform · Built-in and bundled plugin loading · `src/plugins/builtinPlugins.ts`
- [Skills](https://github.com/dhrbc/claude-code/blob/main/src/skills/bundledSkills.ts): workflow library · Bundled skills and skill loading · `src/skills/bundledSkills.ts`

### Persistence

Sessions, memory, and long-lived artifacts

- [History](https://github.com/dhrbc/claude-code/blob/main/src/history.ts): session history · Conversation history and resume data · `src/history.ts`
- [Session Memory](https://github.com/dhrbc/claude-code/blob/main/src/services/SessionMemory/sessionMemory.ts): persistent memory · Session memory prompts and storage · `src/services/SessionMemory/sessionMemory.ts`
- [Memdir](https://github.com/dhrbc/claude-code/blob/main/src/memdir/memdir.ts): memory store · On-disk memory and session artifacts · `src/memdir/memdir.ts`

### Execution

Tasks, background work, and remote/session orchestration

- [Remote Sessions](https://github.com/dhrbc/claude-code/blob/main/src/remote/RemoteSessionManager.ts): remote runtime · Remote session lifecycle and transport · `src/remote/RemoteSessionManager.ts`
- [Tasks](https://github.com/dhrbc/claude-code/blob/main/src/tasks.ts): background work · Task model and task lifecycle · `src/tasks.ts`
- [Shell Task](https://github.com/dhrbc/claude-code/blob/main/src/tasks/LocalShellTask/LocalShellTask.tsx): task runner · Local shell task execution and output · `src/tasks/LocalShellTask/LocalShellTask.tsx`

## Connections

- Main → Setup: bootstraps · Startup initialization begins here
- Setup → CLI Entry: launches · Prepares the CLI entrypoint
- Setup → App State: initializes · Builds shared app state
- CLI Entry → Ink Runtime: starts UI · Hands control to terminal rendering
- Ink Runtime → App Shell: renders · Root UI composition
- App Shell → Prompt Input: captures input · Primary user interaction path
- App Shell → Messages: shows transcript · Conversation and tool output display
- Prompt Input → Input Router: submits · Routes user input into the app pipeline
- Input Router → Commands: slash commands · Control-plane command dispatch
- Input Router → Query Engine: prompt text · Conversation input goes to the agent loop
- Commands → App State: updates state · Commands mutate session and app settings
- Query Engine → Context: reads context · Uses active conversation context
- Query Engine → History: reads history · Uses prior turns and resume state
- Query Engine → Tools: selects tools · Requests capabilities from the registry
- Query Engine → Anthropic API: calls model · Sends prompts and streams responses
- Tools → Tool Types: typed by · Tools share a common schema
- Tools → Tool Exec: executes via · Tool calls are mediated by the execution layer
- Tool Exec → Bash Tool: runs shell · Representative high-risk tool path
- Tool Exec → File Tool: reads files · Representative filesystem tool path
- Bash Tool → Tool Exec: returns result · Tool outputs stream back through orchestration
- File Tool → Tool Exec: returns result · Tool outputs stream back through orchestration
- Tool Exec → Messages: streams output · Tool progress and results are rendered in the transcript
- Tool Exec → Session Memory: persists artifacts · Selected results and session artifacts may be stored
- Session Memory → Memdir: writes disk · Persistent memory lives on disk
- Query Engine → LSP: consults · Language tooling and diagnostics support
- Query Engine → MCP: uses tooling · External developer-tool integrations
- Query Engine → Plugins: extends · Commands, tools, hooks, and UI can be plugin-backed
- Query Engine → Skills: loads skills · Reusable workflows can be injected into the loop
- Bridge → Remote Sessions: bridges · Separate remote/IDE control boundary
- Bridge → App State: syncs state · Bridge mirrors or mutates app session state
- Remote Sessions → Tasks: spawns · Remote sessions produce task-like work units
- Tasks → Shell Task: includes · Local shell execution is a core task kind
- Tasks → App Shell: surfaces status · Task lifecycle is shown in the terminal UI
- OAuth → Anthropic API: authenticates · API access depends on token management
