# rolovibes/halo-harness architecture

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

- Interactive diagram: https://gitdiagram.com/rolovibes/halo-harness
- Repository: https://github.com/rolovibes/halo-harness

## Overview

Halo Harness is a Claude Code-compatible coding agent that runs interactive or headless sessions against configurable model providers, with familiar tools, permissions, hooks, MCP servers, skills, and sub-agents. The primary workflow is a user request through the terminal UI and controller into a session loop, which routes model calls and tool execution and returns events/results. Separate product branches support team orchestration and remote fleets, plus a browser Studio for monitoring and editing. Some subsystem links are documented capabilities rather than inspected call paths; those are marked dashed.

Main entry points: [`halo_harness/agent/loop.py`](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/agent/loop.py) (Agent loop), [`halo_harness/headless.py`](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/headless.py) (Session assembly), [`halo_harness/studio/ui/src/App.tsx`](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/studio/ui/src/App.tsx) (Studio browser), [`halo_harness/controller.py`](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/controller.py) (Session controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Agent sessions"]
  node_tui["Terminal UI<br/>[app.py]"]
  node_controller["Session controller<br/>[controller.py]"]
  node_headless["Session assembly<br/>[headless.py]"]
  node_loop["Agent loop<br/>[loop.py]"]
  node_events["Event contract<br/>[events.py]"]
  node_subagents["Sub-agents<br/>[subagent.py]"]
end

subgraph group_integrations["Models and tools"]
  node_config["Claude config<br/>[paths.py]"]
  node_permissions["Permission rules<br/>[permissions.py]"]
  node_providers["Provider routing<br/>[profiles.py]"]
  node_http["Provider transport<br/>[http.py]"]
  node_tools["Tool execution<br/>[base.py]"]
  node_mcp["MCP servers<br/>[manager.py]"]
end

subgraph group_teams["Teams and fleets"]
  node_orchestra["Orchestra runs<br/>[workers.py]"]
  node_fleet["Fleet missions"]
end

subgraph group_studio["Studio"]
  node_studio_ui["Studio browser<br/>[App.tsx]"]
  node_studio_server["Studio server<br/>[server.py]"]
  node_design["Design workspace<br/>[cli.py]"]
  node_media["Media rendering<br/>[comfy_client.py]"]
end

node_user(("User"))
node_provider_service{{"Model provider"}}

node_user -->|"submits work"| node_tui
node_tui -->|"dispatches commands"| node_controller
node_controller -->|"owns worker"| node_loop
node_controller -.->|"drains events"| node_events
node_headless -->|"assembles session"| node_loop
node_headless -->|"loads settings"| node_config
node_headless -->|"selects route"| node_providers
node_loop -.->|"requests completions"| node_providers
node_providers -.->|"uses transport"| node_http
node_http -.->|"sends requests"| node_provider_service
node_loop -.->|"executes tools"| node_tools
node_loop -.->|"checks permission"| node_permissions
node_headless -.->|"configures servers"| node_mcp
node_loop -->|"delegates work"| node_subagents
node_orchestra -.->|"dispatches mission workers"| node_fleet
node_user -->|"opens workspace"| node_studio_ui
node_studio_ui -.->|"uses browser API"| node_studio_server
node_studio_server -.->|"serves design tools"| node_design
node_studio_server -->|"requests renders"| node_media
node_studio_ui -.->|"views run graphs"| node_orchestra
node_studio_ui -.->|"views fleet runs"| node_fleet

click node_tui "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/tui/app.py"
click node_controller "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/controller.py"
click node_headless "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/headless.py"
click node_loop "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/agent/loop.py"
click node_events "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/events.py"
click node_config "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/config/paths.py"
click node_permissions "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/permissions.py"
click node_providers "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/providers/profiles.py"
click node_http "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/providers/http.py"
click node_tools "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/tools/base.py"
click node_mcp "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/mcp/manager.py"
click node_subagents "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/agent/subagent.py"
click node_orchestra "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/orchestra/workers.py"
click node_fleet "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/fleet/mission_worker_run.py"
click node_studio_ui "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/studio/ui/src/App.tsx"
click node_studio_server "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/studio/server.py"
click node_design "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/design/cli.py"
click node_media "https://github.com/rolovibes/halo-harness/blob/master/halo_harness/media/comfy_client.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_tui,node_controller,node_headless,node_loop,node_events,node_subagents,node_user toneBlue
class node_config,node_permissions,node_providers,node_http,node_tools,node_mcp toneAmber
class node_orchestra,node_fleet toneMint
class node_studio_ui,node_studio_server,node_design,node_media toneRose
class node_provider_service toneIndigo
```

## Components

### Agent sessions

- [Terminal UI](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/tui/app.py): `halo_harness/tui/app.py`
- [Session controller](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/controller.py): `halo_harness/controller.py`
- [Session assembly](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/headless.py): `halo_harness/headless.py`
- [Agent loop](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/agent/loop.py): `halo_harness/agent/loop.py`
- [Event contract](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/events.py): `halo_harness/events.py`
- [Sub-agents](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/agent/subagent.py): `halo_harness/agent/subagent.py`

### Models and tools

- [Claude config](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/config/paths.py): `halo_harness/config/paths.py`
- [Permission rules](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/permissions.py): `halo_harness/permissions.py`
- [Provider routing](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/providers/profiles.py): `halo_harness/providers/profiles.py`
- [Provider transport](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/providers/http.py): `halo_harness/providers/http.py`
- [Tool execution](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/tools/base.py): `halo_harness/tools/base.py`
- [MCP servers](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/mcp/manager.py): `halo_harness/mcp/manager.py`

### Teams and fleets

- [Orchestra runs](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/orchestra/workers.py): `halo_harness/orchestra/workers.py`
- [Fleet missions](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/fleet/mission_worker_run.py): `halo_harness/fleet/mission_worker_run.py`

### Studio

- [Studio browser](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/studio/ui/src/App.tsx): `halo_harness/studio/ui/src/App.tsx`
- [Studio server](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/studio/server.py): `halo_harness/studio/server.py`
- [Design workspace](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/design/cli.py): `halo_harness/design/cli.py`
- [Media rendering](https://github.com/rolovibes/halo-harness/blob/master/halo_harness/media/comfy_client.py): `halo_harness/media/comfy_client.py`

### Other components

- **User**
- **Model provider**

## Connections

- User → Terminal UI: submits work (evidence: `README.md`)
- Terminal UI → Session controller: dispatches commands (evidence: `halo_harness/tui/app.py`)
- Session controller → Agent loop: owns worker (evidence: `halo_harness/controller.py`)
- Session controller → Event contract: drains events (evidence: `halo_harness/controller.py`)
- Session assembly → Agent loop: assembles session (evidence: `halo_harness/headless.py`)
- Session assembly → Claude config: loads settings (evidence: `halo_harness/headless.py`)
- Session assembly → Provider routing: selects route (evidence: `halo_harness/headless.py`)
- Agent loop → Provider routing: requests completions
- Provider routing → Provider transport: uses transport
- Provider transport → Model provider: sends requests
- Agent loop → Tool execution: executes tools
- Agent loop → Permission rules: checks permission
- Session assembly → MCP servers: configures servers
- Agent loop → Sub-agents: delegates work (evidence: `halo_harness/agent/subagent.py`)
- Orchestra runs → Fleet missions: dispatches mission workers
- User → Studio browser: opens workspace (evidence: `README.md`)
- Studio browser → Studio server: uses browser API
- Studio server → Design workspace: serves design tools
- Studio server → Media rendering: requests renders
- Studio browser → Orchestra runs: views run graphs
- Studio browser → Fleet missions: views fleet runs
