# harnesslab/claw-code-agent architecture

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

- Interactive diagram: https://gitdiagram.com/harnesslab/claw-code-agent
- Repository: https://github.com/harnesslab/claw-code-agent

## Overview

1. **Top-level shape**
   - This is a **Python CLI agent runtime**, not a web service.
   - The main flow is: user command → local orchestration layer → OpenAI-compatible model endpoint → tool calls back into the local runtime.
   - Most of the code lives under `src/`, with `tests/` validating each runtime slice and `benchmarks/` measuring task-suite performance.

2. **CLI and command routing**
   - `src/main.py` is the entrypoint and command dispatcher.
   - It exposes agent modes like `agent`, `agent-chat`, `agent-resume`, background/daemon commands, and many inspection/mutation commands such as `search-*`, `mcp-*`, `remote-*`, `config-*`, and `account-*`.
   - The CLI is the outer boundary that decides whether input becomes a model turn, a local slash command, or a utility/runtime action.

3. **Core agent loop**
   - `src/agent_runtime.py` is the central loop for a single agent run.
   - It coordinates prompt assembly, model calls, tool invocation, stop/continue handling, streaming output, truncation recovery, and final transcript persistence.
   - `src/query_engine.py` acts as a higher-level orchestration facade around that runtime.

4. **Prompt, context, and session state**
   - `src/agent_prompting.py` builds the system prompt.
   - `src/agent_context.py` and `src/context.py` collect workspace context, including file tree/material, `CLAUDE.md` discovery, and other prompt inputs.
   - `src/agent_context_usage.py` estimates token usage and drives `/context`-style reporting.
   - `src/agent_session.py`, `src/session_store.py`, `src/transcript.py`, and `src/history.py` persist and restore conversation state, file edit history, and resumable sessions.

5. **Tooling boundary and execution**
   - `src/agent_tools.py`, `src/tools.py`, `src/tool_pool.py`, and `src/execution_registry.py` define and execute the tool surface.
   - Core tools include file operations, search, shell execution, web fetch/search, configuration/account/remote actions, task/plan/worktree actions, MCP calls, and nested delegation.
   - `src/permissions.py`, `src/bash_security.py`, `src/cost_tracker.py`, and `src/prompt_constants.py` enforce the safety and budget boundary around those tools.

6. **Model connectivity**
   - `src/openai_compat.py` is the transport layer to an **OpenAI-compatible chat completions API**.
   - The repo is designed to work with local or proxied model backends such as **vLLM**, **Ollama**, **LiteLLM Proxy**, and **OpenRouter**.
   - Streaming and tool calling are first-class; the model is expected to emit tool calls that the local runtime executes and feeds back into the next turn.

7. **Local control-plane runtimes**
   - A large part of the repo is a set of **local stateful runtimes** that expose auxiliary agent features without depending on a server.
   - These include `search_runtime.py`, `mcp_runtime.py`, `remote_runtime.py`, `background_runtime.py`, `account_runtime.py`, `ask_user_runtime.py`, `config_runtime.py`, `plan_runtime.py`, `task_runtime.py`, `team_runtime.py`, `workflow_runtime.py`, `remote_trigger_runtime.py`, and `worktree_runtime.py`.
   - These runtimes typically manage manifests, profiles, histories, and activation state, then surface them both as slash commands and as tools.

8. **Plugins and hook/policy layer**
   - `src/plugin_runtime.py` and `src/agent_plugin_cache.py` implement a manifest-based plugin system with hooks, tool aliases, and virtual tools.
   - `src/hook_policy.py` provides local hook/policy manifests, trust reporting, safe environment handling, and budget or tool-blocking overrides.
   - This layer sits between the core agent loop and the tool/prompt surface, letting plugins modify prompt assembly, resume behavior, persistence, and delegation.

9. **Nested agents and workflow coordination**
   - `src/agent_manager.py` tracks nested agent lineage, group membership, and batched delegation.
   - `src/team_runtime.py`, `src/task_runtime.py`, and `src/plan_runtime.py` represent higher-level coordination state for tasks, plans, and team-style message history.
   - `src/workflow_runtime.py` and `src/remote_trigger_runtime.py` model reusable workflows and triggers as local artifacts with run history.

10. **Persistence, snapshots, and parity data**
   - The repo stores state locally in serialized session data, runtime manifests, and file-history snapshots; the README references `.port_sessions/` for resumable sessions.
   - `src/reference_data/` contains snapshot files for commands, tools, and surface metadata used by parity tracking and internal comparisons.
   - `src/commands.py`, `src/tools.py`, and `src/runtime.py` appear to mirror the expected command/tool/runtime inventory for parity with the original npm architecture.

11. **Tokenizer, compaction, and cost control**
   - `src/tokenizer_runtime.py` provides tokenizer-aware accounting with cached backends and heuristic fallback.
   - `src/compact.py` and related context code implement snipping/compaction when prompts grow too large.
   - Cost and quota enforcement is centralized in `src/cost_tracker.py`, with support for token budgets, model-call caps, tool-call caps, and session-turn limits.

12. **Testing and benchmark harness**
   - `tests/` is broad and maps closely to the runtime boundaries, which helps confirm the architecture is modular rather than monolithic.
   - `benchmarks/` contains task-suite runners and dataset loaders for evaluating agent performance across coding, math, QA, and SWE-style benchmarks.
   - The benchmark subsystem is separate from the agent runtime, but it exercises the same model/tool/session stack used by the CLI.

13. **External boundary summary**
   - The only hard external dependency in normal operation is the **model API endpoint**; everything else is intentionally local and standard-library based.
   - Optional external-ish integrations are limited to model providers/backends and whatever remote resources the search/MCP/web fetch tools access.

Main entry points: [`src/main.py`](https://github.com/harnesslab/claw-code-agent/blob/main/src/main.py) (CLI entry), [`src/agent_runtime.py`](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_runtime.py) (Agent loop), [`src/execution_registry.py`](https://github.com/harnesslab/claw-code-agent/blob/main/src/execution_registry.py) (Exec registry), [`src/agent_tools.py`](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_tools.py) (Agent tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI boundary"]
  node_main["CLI entry<br/>dispatcher<br/>[main.py]"]
  node_slash["Slash cmds<br/>command routing"]
end

subgraph group_core["Core agent"]
  node_query["Query engine<br/>orchestration facade<br/>[query_engine.py]"]
  node_runtime["Agent loop<br/>core runtime<br/>[agent_runtime.py]"]
  node_prompting["Prompt build<br/>prompt assembly<br/>[agent_prompting.py]"]
  node_context["Workspace ctx<br/>context сбор<br/>[agent_context.py]"]
  node_usage["Token usage<br/>context accounting"]
  node_session["Session state<br/>persistence<br/>[agent_session.py]"]
  node_transcript["Transcript<br/>conversation log<br/>[transcript.py]"]
end

subgraph group_tooling["Tools and safety"]
  node_tools["Tool surface<br/>tool definitions<br/>[tools.py]"]
  node_agent_tools["Agent tools<br/>tool gateway<br/>[agent_tools.py]"]
  node_pool["Tool pool<br/>tool registry<br/>[tool_pool.py]"]
  node_exec["Exec registry<br/>tool execution"]
  node_perm["Permissions<br/>policy<br/>[permissions.py]"]
  node_security["Bash safety<br/>sandbox policy<br/>[bash_security.py]"]
  node_cost["Cost tracker<br/>budget control<br/>[cost_tracker.py]"]
end

subgraph group_control["Local runtimes"]
  node_plugin["Plugins<br/>manifest hooks<br/>[plugin_runtime.py]"]
  node_hook["Hook policy<br/>policy manifests<br/>[hook_policy.py]"]
  node_manager["Agent manager<br/>delegation state<br/>[agent_manager.py]"]
  node_searchrt["Search runtime<br/>local runtime<br/>[search_runtime.py]"]
  node_mcp["MCP runtime<br/>local runtime<br/>[mcp_runtime.py]"]
  node_remote["Remote runtime<br/>local runtime<br/>[remote_runtime.py]"]
  node_background["Background<br/>daemon runtime"]
  node_plan["Plan runtime<br/>coordination state<br/>[plan_runtime.py]"]
  node_task["Task runtime<br/>coordination state<br/>[task_runtime.py]"]
  node_team["Team runtime<br/>coordination state<br/>[team_runtime.py]"]
  node_workflow["Workflow runtime<br/>workflow artifact"]
  node_trigger["Trigger runtime<br/>workflow trigger"]
  node_worktree["Worktree runtime<br/>workspace runtime"]
end

subgraph group_infra["Model and storage"]
  node_store["Session store<br/>persistence<br/>[session_store.py]"]
  node_model[("Model API<br/>openai-compatible transport<br/>[openai_compat.py]")]
  node_compact["Compaction<br/>context reduction<br/>[compact.py]"]
  node_tokenizer["Tokenizer<br/>token accounting"]
  node_runtimebase["Runtime core<br/>shared runtime<br/>[runtime.py]"]
end

subgraph group_eval["Benchmarking"]
end

node_main -->|"dispatches agent mode"| node_query
node_main -->|"routes slash commands"| node_slash
node_query -->|"runs agent loop"| node_runtime
node_runtime -->|"builds prompt"| node_prompting
node_runtime -->|"loads context"| node_context
node_runtime -->|"estimates tokens"| node_usage
node_runtime -->|"restores state"| node_session
node_session -->|"reads/writes"| node_store
node_runtime -->|"persists transcript"| node_transcript
node_runtime -->|"invokes tools"| node_agent_tools
node_agent_tools -->|"exposes surface"| node_tools
node_agent_tools -->|"resolves tools"| node_pool
node_pool -->|"executes through"| node_exec
node_exec -->|"checks permission"| node_perm
node_exec -->|"checks shell safety"| node_security
node_exec -->|"charges budget"| node_cost
node_runtime -->|"calls API"| node_model
node_runtime -->|"compacts context"| node_compact
node_compact -->|"measures tokens"| node_tokenizer
node_plugin -->|"governs hooks"| node_hook
node_plugin -.->|"modifies flow"| node_runtime
node_manager -->|"coordinates nested runs"| node_runtime
node_main -->|"search commands"| node_searchrt
node_main -->|"mcp commands"| node_mcp
node_main -->|"remote commands"| node_remote
node_main -->|"daemon commands"| node_background
node_main -->|"plan commands"| node_plan
node_main -->|"task commands"| node_task
node_main -->|"team commands"| node_team
node_main -->|"workflow commands"| node_workflow
node_main -->|"trigger commands"| node_trigger
node_main -->|"worktree commands"| node_worktree

click node_main "https://github.com/harnesslab/claw-code-agent/blob/main/src/main.py"
click node_slash "https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_slash_commands.py"
click node_query "https://github.com/harnesslab/claw-code-agent/blob/main/src/query_engine.py"
click node_runtime "https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_runtime.py"
click node_prompting "https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_prompting.py"
click node_context "https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_context.py"
click node_usage "https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_context_usage.py"
click node_session "https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_session.py"
click node_store "https://github.com/harnesslab/claw-code-agent/blob/main/src/session_store.py"
click node_transcript "https://github.com/harnesslab/claw-code-agent/blob/main/src/transcript.py"
click node_tools "https://github.com/harnesslab/claw-code-agent/blob/main/src/tools.py"
click node_agent_tools "https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_tools.py"
click node_pool "https://github.com/harnesslab/claw-code-agent/blob/main/src/tool_pool.py"
click node_exec "https://github.com/harnesslab/claw-code-agent/blob/main/src/execution_registry.py"
click node_perm "https://github.com/harnesslab/claw-code-agent/blob/main/src/permissions.py"
click node_security "https://github.com/harnesslab/claw-code-agent/blob/main/src/bash_security.py"
click node_cost "https://github.com/harnesslab/claw-code-agent/blob/main/src/cost_tracker.py"
click node_plugin "https://github.com/harnesslab/claw-code-agent/blob/main/src/plugin_runtime.py"
click node_hook "https://github.com/harnesslab/claw-code-agent/blob/main/src/hook_policy.py"
click node_manager "https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_manager.py"
click node_searchrt "https://github.com/harnesslab/claw-code-agent/blob/main/src/search_runtime.py"
click node_mcp "https://github.com/harnesslab/claw-code-agent/blob/main/src/mcp_runtime.py"
click node_remote "https://github.com/harnesslab/claw-code-agent/blob/main/src/remote_runtime.py"
click node_background "https://github.com/harnesslab/claw-code-agent/blob/main/src/background_runtime.py"
click node_plan "https://github.com/harnesslab/claw-code-agent/blob/main/src/plan_runtime.py"
click node_task "https://github.com/harnesslab/claw-code-agent/blob/main/src/task_runtime.py"
click node_team "https://github.com/harnesslab/claw-code-agent/blob/main/src/team_runtime.py"
click node_workflow "https://github.com/harnesslab/claw-code-agent/blob/main/src/workflow_runtime.py"
click node_trigger "https://github.com/harnesslab/claw-code-agent/blob/main/src/remote_trigger_runtime.py"
click node_worktree "https://github.com/harnesslab/claw-code-agent/blob/main/src/worktree_runtime.py"
click node_model "https://github.com/harnesslab/claw-code-agent/blob/main/src/openai_compat.py"
click node_compact "https://github.com/harnesslab/claw-code-agent/blob/main/src/compact.py"
click node_tokenizer "https://github.com/harnesslab/claw-code-agent/blob/main/src/tokenizer_runtime.py"
click node_runtimebase "https://github.com/harnesslab/claw-code-agent/blob/main/src/runtime.py"

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_slash toneBlue
class node_query,node_runtime,node_prompting,node_context,node_usage,node_session,node_transcript toneAmber
class node_tools,node_agent_tools,node_pool,node_exec,node_perm,node_security,node_cost toneMint
class node_plugin,node_hook,node_manager,node_searchrt,node_mcp,node_remote,node_background,node_plan,node_task,node_team,node_workflow,node_trigger,node_worktree toneRose
class node_store,node_model,node_compact,node_tokenizer,node_runtimebase toneIndigo
```

## Components

### CLI boundary

Command routing and top-level entrypoints.

- [CLI entry](https://github.com/harnesslab/claw-code-agent/blob/main/src/main.py): dispatcher · Top-level command dispatcher for agent modes and runtime utilities. · `src/main.py`
- [Slash cmds](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_slash_commands.py): command routing · Agent slash command handling and command mutations. · `src/agent_slash_commands.py`

### Core agent

Prompting, context, session state, and the main agent loop.

- [Query engine](https://github.com/harnesslab/claw-code-agent/blob/main/src/query_engine.py): orchestration facade · Higher-level orchestration layer around the agent runtime. · `src/query_engine.py`
- [Agent loop](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_runtime.py): core runtime · Single-run orchestration: prompt assembly, model calls, tool use, streaming, truncation recovery, and transcript persistence. · `src/agent_runtime.py`
- [Prompt build](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_prompting.py): prompt assembly · Builds the system prompt and turn framing for the agent. · `src/agent_prompting.py`
- [Workspace ctx](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_context.py): context сбор · Collects workspace material, file tree, and CLAUDE.md-style inputs. · `src/agent_context.py`
- [Token usage](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_context_usage.py): context accounting · Estimates token usage and powers context reporting. · `src/agent_context_usage.py`
- [Session state](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_session.py): persistence · Resumable session storage and conversation history. · `src/agent_session.py`
- [Transcript](https://github.com/harnesslab/claw-code-agent/blob/main/src/transcript.py): conversation log · Final and intermediate conversation transcript persistence. · `src/transcript.py`

### Tools and safety

Tool registration, execution, permissions, and budgets.

- [Tool surface](https://github.com/harnesslab/claw-code-agent/blob/main/src/tools.py): tool definitions · Defines the available tool surface and tool metadata. · `src/tools.py`
- [Agent tools](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_tools.py): tool gateway · Agent-facing tool boundary that connects prompts to executable tools. · `src/agent_tools.py`
- [Tool pool](https://github.com/harnesslab/claw-code-agent/blob/main/src/tool_pool.py): tool registry · Pools and resolves tools for execution. · `src/tool_pool.py`
- [Exec registry](https://github.com/harnesslab/claw-code-agent/blob/main/src/execution_registry.py): tool execution · Executes registered tools and dispatches tool calls. · `src/execution_registry.py`
- [Permissions](https://github.com/harnesslab/claw-code-agent/blob/main/src/permissions.py): policy · Permission checks for tool and runtime actions. · `src/permissions.py`
- [Bash safety](https://github.com/harnesslab/claw-code-agent/blob/main/src/bash_security.py): sandbox policy · Shell-command safety and command filtering boundary. · `src/bash_security.py`
- [Cost tracker](https://github.com/harnesslab/claw-code-agent/blob/main/src/cost_tracker.py): budget control · Tracks token, tool-call, model-call, and turn budgets. · `src/cost_tracker.py`

### Local runtimes

Stateful auxiliary runtimes exposed as commands and tools.

- [Plugins](https://github.com/harnesslab/claw-code-agent/blob/main/src/plugin_runtime.py): manifest hooks · Manifest-based plugin system with hooks, aliases, and virtual tools. · `src/plugin_runtime.py`
- [Hook policy](https://github.com/harnesslab/claw-code-agent/blob/main/src/hook_policy.py): policy manifests · Local hook/policy manifests, trust reporting, and safe environment handling. · `src/hook_policy.py`
- [Agent manager](https://github.com/harnesslab/claw-code-agent/blob/main/src/agent_manager.py): delegation state · Tracks nested agent lineage, group membership, and batched delegation. · `src/agent_manager.py`
- [Search runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/search_runtime.py): local runtime · Local search state and search-oriented command surface. · `src/search_runtime.py`
- [MCP runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/mcp_runtime.py): local runtime · Local MCP integration and manifest/state handling. · `src/mcp_runtime.py`
- [Remote runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/remote_runtime.py): local runtime · Remote resource and control-plane state management. · `src/remote_runtime.py`
- [Background](https://github.com/harnesslab/claw-code-agent/blob/main/src/background_runtime.py): daemon runtime · Background and daemon-style runtime actions. · `src/background_runtime.py`
- [Plan runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/plan_runtime.py): coordination state · Plan artifacts and planning-oriented coordination state. · `src/plan_runtime.py`
- [Task runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/task_runtime.py): coordination state · Task artifacts and task-oriented coordination state. · `src/task_runtime.py`
- [Team runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/team_runtime.py): coordination state · Team-style message history and higher-level coordination state. · `src/team_runtime.py`
- [Workflow runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/workflow_runtime.py): workflow artifact · Reusable workflows and run history as local artifacts. · `src/workflow_runtime.py`
- [Trigger runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/remote_trigger_runtime.py): workflow trigger · Remote trigger artifacts and trigger run history. · `src/remote_trigger_runtime.py`
- [Worktree runtime](https://github.com/harnesslab/claw-code-agent/blob/main/src/worktree_runtime.py): workspace runtime · Worktree-oriented state and actions for branch/workspace management. · `src/worktree_runtime.py`

### Model and storage

External model transport and local persistence/compaction infrastructure.

- [Session store](https://github.com/harnesslab/claw-code-agent/blob/main/src/session_store.py): persistence · Backing store for sessions and transcript restoration. · `src/session_store.py`
- [Model API](https://github.com/harnesslab/claw-code-agent/blob/main/src/openai_compat.py): openai-compatible transport · OpenAI-compatible chat-completions transport to local or proxied model backends. · `src/openai_compat.py`
- [Compaction](https://github.com/harnesslab/claw-code-agent/blob/main/src/compact.py): context reduction · Prompt snipping and compaction when context grows too large. · `src/compact.py`
- [Tokenizer](https://github.com/harnesslab/claw-code-agent/blob/main/src/tokenizer_runtime.py): token accounting · Tokenizer-aware accounting with cached backends and heuristic fallback. · `src/tokenizer_runtime.py`
- [Runtime core](https://github.com/harnesslab/claw-code-agent/blob/main/src/runtime.py): shared runtime · Shared runtime utilities and inventory parity scaffolding. · `src/runtime.py`

## Connections

- CLI entry → Query engine: dispatches agent mode · CLI routes agent commands into orchestration.
- CLI entry → Slash cmds: routes slash commands · CLI forwards slash and mutation commands.
- Query engine → Agent loop: runs agent loop · Facade invokes the core runtime for a turn.
- Agent loop → Prompt build: builds prompt · Agent loop assembles the system and turn prompt.
- Agent loop → Workspace ctx: loads context · Agent loop gathers workspace and repository context.
- Agent loop → Token usage: estimates tokens · Context usage informs reporting and truncation decisions.
- Agent loop → Session state: restores state · Run resumes from persisted session state.
- Session state → Session store: reads/writes · Session state is backed by local storage.
- Agent loop → Transcript: persists transcript · Completed turns and edits are saved as transcript history.
- Agent loop → Agent tools: invokes tools · Core loop hands model tool calls to the tool boundary.
- Agent tools → Tool surface: exposes surface · Agent tools are defined by the shared tool surface.
- Agent tools → Tool pool: resolves tools · Tool requests are mapped into executable tool instances.
- Tool pool → Exec registry: executes through · Resolved tools are executed by the registry.
- Exec registry → Permissions: checks permission · Tool execution is gated by permissions.
- Exec registry → Bash safety: checks shell safety · Shell-related execution is filtered by bash policy.
- Exec registry → Cost tracker: charges budget · Tool and model activity updates cost tracking.
- Agent loop → Model API: calls API · Core loop streams and receives chat-completions responses.
- Agent loop → Compaction: compacts context · Large prompts are truncated or compacted before retry.
- Compaction → Tokenizer: measures tokens · Compaction depends on tokenizer-aware accounting.
- Plugins → Hook policy: governs hooks · Plugin behavior is constrained by local hook policy.
- Plugins → Agent loop: modifies flow · Plugins can alter prompting, resume, persistence, and delegation.
- Agent manager → Agent loop: coordinates nested runs · Delegated and nested agent execution is tracked across runs.
- CLI entry → Search runtime: search commands · CLI surfaces search-oriented local runtime actions.
- CLI entry → MCP runtime: mcp commands · CLI surfaces MCP runtime actions.
- CLI entry → Remote runtime: remote commands · CLI surfaces remote-control actions.
- CLI entry → Background: daemon commands · CLI launches background and daemon workflows.
- CLI entry → Plan runtime: plan commands · CLI exposes planning state actions.
- CLI entry → Task runtime: task commands · CLI exposes task coordination actions.
- CLI entry → Team runtime: team commands · CLI exposes team coordination actions.
- CLI entry → Workflow runtime: workflow commands · CLI exposes reusable workflow actions.
- CLI entry → Trigger runtime: trigger commands · CLI exposes trigger management actions.
- CLI entry → Worktree runtime: worktree commands · CLI exposes workspace and worktree actions.
