# hex/claude-council architecture

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

- Interactive diagram: https://gitdiagram.com/hex/claude-council
- Repository: https://github.com/hex/claude-council

## Overview

claude-council is a Claude Code plugin for asking multiple AI agents the same coding question and comparing their answers. The main path is a user command or confirmed model-tool request, through council execution and configured provider adapters, to per-provider responses and a synthesis; results can also stream into a tmux pane or be fetched as background jobs. The README documents roles, debate, deep analysis, advice, stop-gate review, and specialist coding tasks as additional capabilities. Pane links reflect sampled code; other relationships are documented in the README, and unsampled internals are not inferred.

Main entry points: [`scripts/run-council.sh`](https://github.com/hex/claude-council/blob/main/scripts/run-council.sh) (Council runner), [`mods/council-pane/hooks/pane.tsx`](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/pane.tsx) (Streaming pane), [`mods/council-pane/hooks/snapshot.ts`](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/snapshot.ts) (Run snapshot), [`commands/ask.md`](https://github.com/hex/claude-council/blob/main/commands/ask.md) (Ask command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entrypoints"]
  node_ask["Ask command<br/>[ask.md]"]
  node_result["Result command<br/>[result.md]"]
  node_statuscmd["Status command<br/>[status.md]"]
  node_advise["Advice command<br/>[advise.md]"]
  node_modeltool["Council tool<br/>[tool.ts]"]
end

subgraph group_council["Council execution"]
  node_runner["Council runner<br/>[run-council.sh]"]
  node_providers["Provider adapters"]
  node_roles["Role configuration<br/>[roles.json]"]
  node_synthesis["Answer synthesis<br/>[synthesis.md]"]
  node_jobs["Background jobs<br/>[jobs.sh]"]
end

subgraph group_results["Results and pane"]
  node_pane["Streaming pane<br/>[pane.tsx]"]
  node_snapshot["Run snapshot<br/>[snapshot.ts]"]
  node_status["Provider status<br/>[status.ts]"]
  node_view["Pane view model<br/>[view.ts]"]
  node_tables["Table formatting<br/>[tables.ts]"]
end

subgraph group_extensions["Reviews and specialists"]
  node_stopgate["Stop review gate"]
  node_specialists["Specialist tasks<br/>[specialist.sh]"]
  node_specialistui["Specialist pane<br/>[specialist.ts]"]
  node_advisor["Proactive advisor<br/>[council-advisor.md]"]
end

node_user(("Claude Code user"))
node_externalai{{"AI providers"}}

node_user -->|"asks via"| node_ask
node_user -->|"fetches jobs"| node_result
node_user -->|"checks status"| node_statuscmd
node_user -->|"requests advice"| node_advise
node_ask -->|"starts query"| node_runner
node_modeltool -->|"runs confirmed query"| node_runner
node_runner -->|"dispatches seats"| node_providers
node_providers -->|"queries models"| node_externalai
node_runner -->|"uses roles"| node_roles
node_runner -->|"synthesizes answers"| node_synthesis
node_runner -->|"queues async work"| node_jobs
node_runner -->|"streams run results"| node_pane
node_result -->|"fetches job"| node_jobs
node_pane -->|"reads run view"| node_snapshot
node_snapshot -->|"parses status"| node_status
node_snapshot -->|"parses colors"| node_view
node_pane -->|"renders sections"| node_view
node_pane -.->|"formats tables"| node_tables
node_user -->|"opts into review"| node_stopgate
node_stopgate -->|"requests review"| node_externalai
node_user -->|"assigns task"| node_specialists
node_specialists -.->|"shows task progress"| node_specialistui
node_user -->|"gets suggestions"| node_advisor

click node_ask "https://github.com/hex/claude-council/blob/main/commands/ask.md"
click node_result "https://github.com/hex/claude-council/blob/main/commands/result.md"
click node_statuscmd "https://github.com/hex/claude-council/blob/main/commands/status.md"
click node_advise "https://github.com/hex/claude-council/blob/main/commands/advise.md"
click node_modeltool "https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/tool.ts"
click node_runner "https://github.com/hex/claude-council/blob/main/scripts/run-council.sh"
click node_providers "https://github.com/hex/claude-council/tree/main/scripts/providers"
click node_roles "https://github.com/hex/claude-council/blob/main/config/roles.json"
click node_synthesis "https://github.com/hex/claude-council/blob/main/prompts/synthesis.md"
click node_jobs "https://github.com/hex/claude-council/blob/main/scripts/lib/jobs.sh"
click node_pane "https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/pane.tsx"
click node_snapshot "https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/snapshot.ts"
click node_status "https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/status.ts"
click node_view "https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/view.ts"
click node_tables "https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/tables.ts"
click node_stopgate "https://github.com/hex/claude-council/blob/main/scripts/stop-review-gate.sh"
click node_specialists "https://github.com/hex/claude-council/blob/main/scripts/specialist.sh"
click node_specialistui "https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/specialist.ts"
click node_advisor "https://github.com/hex/claude-council/blob/main/agents/council-advisor.md"

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_ask,node_result,node_statuscmd,node_advise,node_modeltool,node_user toneBlue
class node_runner,node_providers,node_roles,node_synthesis,node_jobs toneAmber
class node_pane,node_snapshot,node_status,node_view,node_tables toneMint
class node_stopgate,node_specialists,node_specialistui,node_advisor toneRose
class node_externalai toneIndigo
```

## Components

### User entrypoints

- [Ask command](https://github.com/hex/claude-council/blob/main/commands/ask.md): `commands/ask.md`
- [Result command](https://github.com/hex/claude-council/blob/main/commands/result.md): `commands/result.md`
- [Status command](https://github.com/hex/claude-council/blob/main/commands/status.md): `commands/status.md`
- [Advice command](https://github.com/hex/claude-council/blob/main/commands/advise.md): `commands/advise.md`
- [Council tool](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/tool.ts): `mods/council-pane/hooks/tool.ts`

### Council execution

- [Council runner](https://github.com/hex/claude-council/blob/main/scripts/run-council.sh): `scripts/run-council.sh`
- [Provider adapters](https://github.com/hex/claude-council/tree/main/scripts/providers): `scripts/providers`
- [Role configuration](https://github.com/hex/claude-council/blob/main/config/roles.json): `config/roles.json`
- [Answer synthesis](https://github.com/hex/claude-council/blob/main/prompts/synthesis.md): `prompts/synthesis.md`
- [Background jobs](https://github.com/hex/claude-council/blob/main/scripts/lib/jobs.sh): `scripts/lib/jobs.sh`

### Results and pane

- [Streaming pane](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/pane.tsx): `mods/council-pane/hooks/pane.tsx`
- [Run snapshot](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/snapshot.ts): `mods/council-pane/hooks/snapshot.ts`
- [Provider status](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/status.ts): `mods/council-pane/hooks/status.ts`
- [Pane view model](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/view.ts): `mods/council-pane/hooks/view.ts`
- [Table formatting](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/tables.ts): `mods/council-pane/hooks/tables.ts`

### Reviews and specialists

- [Stop review gate](https://github.com/hex/claude-council/blob/main/scripts/stop-review-gate.sh): `scripts/stop-review-gate.sh`
- [Specialist tasks](https://github.com/hex/claude-council/blob/main/scripts/specialist.sh): `scripts/specialist.sh`
- [Specialist pane](https://github.com/hex/claude-council/blob/main/mods/council-pane/hooks/specialist.ts): `mods/council-pane/hooks/specialist.ts`
- [Proactive advisor](https://github.com/hex/claude-council/blob/main/agents/council-advisor.md): `agents/council-advisor.md`

### Other components

- **Claude Code user**
- **AI providers**

## Connections

- Claude Code user → Ask command: asks via (evidence: `README.md`)
- Claude Code user → Result command: fetches jobs (evidence: `README.md`)
- Claude Code user → Status command: checks status (evidence: `README.md`)
- Claude Code user → Advice command: requests advice (evidence: `README.md`)
- Ask command → Council runner: starts query (evidence: `README.md`)
- Council tool → Council runner: runs confirmed query (evidence: `README.md`)
- Council runner → Provider adapters: dispatches seats (evidence: `README.md`)
- Provider adapters → AI providers: queries models (evidence: `README.md`)
- Council runner → Role configuration: uses roles (evidence: `README.md`)
- Council runner → Answer synthesis: synthesizes answers (evidence: `README.md`)
- Council runner → Background jobs: queues async work (evidence: `README.md`)
- Council runner → Streaming pane: streams run results (evidence: `README.md`)
- Result command → Background jobs: fetches job (evidence: `README.md`)
- Streaming pane → Run snapshot: reads run view (evidence: `mods/council-pane/hooks/pane.tsx`)
- Run snapshot → Provider status: parses status (evidence: `mods/council-pane/hooks/snapshot.ts`)
- Run snapshot → Pane view model: parses colors (evidence: `mods/council-pane/hooks/snapshot.ts`)
- Streaming pane → Pane view model: renders sections (evidence: `mods/council-pane/hooks/pane.tsx`)
- Streaming pane → Table formatting: formats tables (evidence: `mods/council-pane/hooks/pane.tsx`)
- Claude Code user → Stop review gate: opts into review (evidence: `README.md`)
- Stop review gate → AI providers: requests review (evidence: `README.md`)
- Claude Code user → Specialist tasks: assigns task (evidence: `README.md`)
- Specialist tasks → Specialist pane: shows task progress
- Claude Code user → Proactive advisor: gets suggestions (evidence: `README.md`)
