Hive Manager - Product Requirements Document
Product Name: Hive Manager
Version: 1.0.0
Platform: Windows (primary), macOS/Linux (future)
Tech Stack: Tauri v2 + Rust backend + Svelte frontend
A native desktop application for orchestrating and monitoring Claude Code multi-agent workflows (Hives, Swarms, and Fusions). Replaces Windows Terminal tab sprawl with a unified interface featuring embedded terminals, real-time hierarchy visualization, and cross-agent coordination.
Currently, multi-agent workflows spawn 10-20+ Windows Terminal tabs:
Queen, Planners (A-D), Workers (1a-4a, 1b-4b...), Reviewers, Testers, Integration Team
No unified view of session hierarchy or state
Easy to miss agent prompts buried in background tabs
Manual tracking of which agent owns which domain/files
Coordination logs scattered across files
Different CLIs (claude, agent, gemini, opencode, codex) with different behaviors
A single-window application that:
Embeds all agent terminals in a managed grid/tree layout
Visualizes the Queen β Planner β Worker hierarchy in real-time
Alerts when any agent requests input (across all CLI types)
Parses coordination.log and displays structured state
Tracks file ownership matrix visually
Supports steering individual agents mid-task
Agent Architecture Support
Tier 1: Queen (1 per session)
Property
Value
CLI
claude --model opus
Role
Top-level orchestrator
Spawns
Planners only
Owns
Branch, commits, PR, integration
Can Modify Code
No
Tier 2: Planners (1-10 per session)
Property
Value
CLI
claude --model opus
Role
Domain orchestrator
Spawns
Workers, Reviewer, Tester
Owns
Task files, worker coordination, review cycle
Can Modify Code
No
Tier 3: Workers (2-4 per Planner)
Worker
CLI
Model
Role
Worker 1X (Backend)
agent via WSL
Cursor/Opus
Backend implementation
Worker 2X (Frontend)
gemini
Gemini 3 Pro
Frontend implementation
Worker 3X (Coherence)
opencode
Grok Code
Cross-cutting coherence
Worker 4X (Simplify)
codex
GPT-5.3
Simplification pass
Agent
CLI
Model
Role
Reviewer
opencode
BigPickle
Code review
Tester
codex
GPT-5.3
Test execution
Integration Reviewer
opencode
BigPickle
Cross-domain review
Integration Tester
codex
GPT-5.3
Integration tests
CLI
Auto-Approve Flag
Model Flag
Platform
claude
--dangerously-skip-permissions
--model opus
Windows
agent
--force
(global)
WSL Ubuntu
gemini
-y
-m gemini-3-pro-preview
Windows
opencode
env OPENCODE_YOLO=true
-m opencode/MODEL
Windows
codex
--dangerously-bypass-approvals-and-sandbox
-m gpt-5.3-codex
Windows
Queen (Opus)
βββ Worker 1 (mixed)
βββ Worker 2 (mixed)
βββ Worker 3 (mixed)
βββ Worker 4 (mixed)
βββ Reviewer + Tester
1 Queen + 1-4 Workers
Single domain focus
Sequential or parallel workers
Queen (Opus)
βββ Planner A (Domain A)
β βββ Worker 1a (Backend)
β βββ Worker 2a (Frontend)
β βββ Worker 3a (Coherence)
β βββ Worker 4a (Simplify)
β βββ Reviewer A + Tester A
βββ Planner B (Domain B)
β βββ Worker 1b...
β βββ ...
βββ Integration Team
βββ Integration Reviewer
βββ Integration Tester
1 Queen + 2-4 Planners + 2-4 Workers each
Multi-domain parallel execution
File ownership matrix prevents conflicts
Same as Swarm but Planners deployed in waves (1-2 at a time)
Later Planners benefit from earlier discoveries
Up to 10 Planners (A-J)
Judge (You)
βββ Variant A (worktree)
βββ Variant B (worktree)
βββ Variant C (worktree)
Competing implementations in separate git worktrees
Human or automated judge picks winner
ID
Requirement
Priority
F1.1
Launch Hive session (Queen + 1-4 Workers)
P0
F1.2
Launch Swarm session (Queen + 2-4 Planners)
P0
F1.3
Launch Swarm Long-Horizon (sequential waves)
P1
F1.4
Launch Fusion session (competing worktrees)
P1
F1.5
Stop individual agent
P0
F1.6
Stop entire session (cascade)
P0
F1.7
View session history
P1
F1.8
Resume interrupted session
P2
F1.9
Clone session config for new task
P2
F2: Embedded Terminals (Multi-CLI Support)
ID
Requirement
Priority
F2.1
Spawn and render claude CLI via PTY
P0
F2.2
Spawn and render agent via WSL PTY
P0
F2.3
Spawn and render gemini CLI via PTY
P0
F2.4
Spawn and render opencode CLI via PTY
P0
F2.5
Spawn and render codex CLI via PTY
P0
F2.6
Full ANSI color/formatting support
P0
F2.7
Send keyboard input to focused terminal
P0
F2.8
Terminal resize (responsive panels)
P0
F2.9
Search within terminal output
P1
F2.10
Copy/paste support
P0
F2.11
Auto-scroll with lock/unlock
P0
F3: Hierarchy Visualization
ID
Requirement
Priority
F3.1
Display live hierarchy tree (Queen β Planners β Workers)
P0
F3.2
Show agent status badges (starting, running, waiting, complete, error)
P0
F3.3
Indicate which agent is focused
P0
F3.4
Click hierarchy node to focus terminal
P0
F3.5
Show Planner domain assignment
P1
F3.6
Show Worker role (Backend/Frontend/Coherence/Simplify)
P1
F3.7
Collapse/expand hierarchy branches
P1
F4: Session State Monitoring
ID
Requirement
Priority
F4.1
Parse and display coordination.log messages
P0
F4.2
Parse state/responsibility-matrix.md
P1
F4.3
Parse state/file-ownership.md and display matrix
P1
F4.4
Track task files in tasks/planner-{X}/
P1
F4.5
Show wave progress (long-horizon)
P1
F4.6
Display phase progress (Planning β Execution β Review β Integration)
P1
ID
Requirement
Priority
F5.1
Visual + audio alert when any agent requests input
P0
F5.2
Auto-focus terminal requesting input
P0
F5.3
Send text input to agent
P0
F5.4
Quick response buttons (y/n, approve, reject)
P1
F5.5
Broadcast message to all agents (via coordination.log)
P2
ID
Requirement
Priority
F6.1
Grid layout (2x2, 3x3, 4x4)
P0
F6.2
Tree layout (hierarchy-based, indented)
P1
F6.3
Tabbed layout (one terminal at a time)
P0
F6.4
Focus mode (single terminal fullscreen)
P0
F6.5
Custom split layouts
P2
F6.6
Save/restore layout preferences
P1
ID
Requirement
Priority
F7.1
Configure default Planner count
P1
F7.2
Configure Worker models per role
P1
F7.3
Configure CLI paths and flags
P1
F7.4
Configure session directory paths
P1
F7.5
Keyboard shortcut customization
P1
F7.6
Theme selection (dark/light)
P2
F8: Updates & Maintenance
ID
Requirement
Priority
F8.1
Check for updates on startup
P0
F8.2
Show changelog before update
P1
F8.3
Download in background, install on exit
P1
F8.4
Manual update check via menu
P0
F8.5
Rollback to previous version
P2
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β HIVE MANAGER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SVELTE FRONTEND β β
β β ββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββ β β
β β β Sidebar β β Terminal Grid β β Status Panel β β β
β β β β β ββββββ ββββββ β β β β β
β β β Sessions β β β Q β β Pa β β β Hierarchy Tree β β β
β β β History β β ββββββ ββββββ β β ββ Queen β β β
β β β Settings β β ββββββ ββββββ β β ββ Planner A β β β
β β β β β βW1a β βW2a β β β β ββ W1a β β β β
β β β β β ββββββ ββββββ β β β ββ W2a β³ β β β
β β β [+] New β β (xterm.js) β β ββ Planner B β β β
β β ββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β Tauri IPC + Events β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β RUST BACKEND β β
β β ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββ β β
β β β PTY Manager β β Session Manager β β File Watch β β β
β β β - Windows PTY β β - Hive β β - notify β β β
β β β - WSL PTY β β - Swarm β β - parser β β β
β β β - Multi-CLI β β - Fusion β β β β β
β β ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββ β β
β β ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββ β β
β β β Agent Registry β β Config Store β β Updater β β β
β β β - Hierarchy β β - CLI paths β β - GitHub β β β
β β β - Status β β - Defaults β β - Rollback β β β
β β ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββ β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
βΌ βΌ βΌ
βββββββββββ βββββββββββ βββββββββββ
β claude β β agent β β gemini β
β (PTY) β β (WSL) β β (PTY) β
βββββββββββ βββββββββββ βββββββββββ
βΌ βΌ βΌ
βββββββββββ βββββββββββ
βopencode β β codex β
β (PTY) β β (PTY) β
βββββββββββ βββββββββββ
PTY Manager (src-tauri/src/pty/)
pub struct PtyManager {
sessions : HashMap < String , PtySession > ,
wsl_available : bool ,
}
pub struct PtySession {
id : String ,
agent_type : AgentType ,
pty : Box < dyn portable_pty:: MasterPty > ,
child : Box < dyn portable_pty:: Child > ,
status : AgentStatus ,
}
pub enum AgentType {
Claude { model : String } , // claude --model opus
CursorAgent , // WSL: agent --force
Gemini { model : String } , // gemini -m MODEL -y
OpenCode { model : String } , // OPENCODE_YOLO=true opencode -m MODEL
Codex { model : String } , // codex --dangerously-bypass...
}
pub enum AgentStatus {
Starting ,
Running ,
WaitingForInput , // Detected via output patterns
Completed ,
Error ( String ) ,
}
Session Manager (src-tauri/src/session/)
pub struct SessionManager {
active_sessions : HashMap < String , Session > ,
history : Vec < SessionSummary > ,
}
pub struct Session {
id : String ,
session_type : SessionType ,
project_path : PathBuf ,
agents : AgentHierarchy ,
state : SessionState ,
created_at : DateTime < Utc > ,
}
pub enum SessionType {
Hive { worker_count : u8 } ,
Swarm { planner_count : u8 } ,
SwarmLongHorizon { max_planners : u8 , current_wave : u8 } ,
Fusion { variants : Vec < String > } ,
}
pub struct AgentHierarchy {
queen : AgentNode ,
planners : Vec < PlannerNode > ,
}
pub struct PlannerNode {
agent : AgentNode ,
domain : String ,
workers : Vec < AgentNode > ,
reviewer : Option < AgentNode > ,
tester : Option < AgentNode > ,
}
File Watcher (src-tauri/src/watcher/)
pub struct SessionWatcher {
watchers : HashMap < String , RecommendedWatcher > ,
}
// Watch paths:
// - .hive/sessions/{id}/coordination.log
// - .swarm/sessions/{id}/logs/*.log
// - .swarm/sessions/{id}/state/*.md
// - .swarm/sessions/{id}/tasks/**/*.md
pub enum WatchEvent {
CoordinationMessage { from : String , message_type : String , content : String } ,
AgentLogUpdate { agent_id : String , lines : Vec < String > } ,
StateFileChanged { file : String , content : String } ,
TaskFileCreated { planner : String , task_file : String } ,
}
Agent Spawner (src-tauri/src/spawner/)
pub struct AgentSpawner ;
impl AgentSpawner {
pub fn spawn_claude (
& self ,
model : & str ,
prompt_file : & Path ,
cwd : & Path ,
) -> Result < PtySession > ;
pub fn spawn_wsl_agent (
& self ,
prompt_file : & Path ,
cwd : & Path ,
) -> Result < PtySession > ;
pub fn spawn_gemini (
& self ,
model : & str ,
prompt_file : & Path ,
cwd : & Path ,
) -> Result < PtySession > ;
pub fn spawn_opencode (
& self ,
model : & str ,
prompt_file : & Path ,
cwd : & Path ,
) -> Result < PtySession > ;
pub fn spawn_codex (
& self ,
model : & str ,
prompt_file : & Path ,
cwd : & Path ,
) -> Result < PtySession > ;
}
Terminal Component (src/lib/components/Terminal.svelte)
Wraps xterm.js
Receives output events from Rust backend
Sends input to Rust backend
Displays status badge overlay
Hierarchy Tree (src/lib/components/HierarchyTree.svelte)
Renders Queen β Planner β Worker tree
Status indicators per node
Click to focus terminal
Expandable/collapsible
Coordination Log (src/lib/components/CoordinationLog.svelte)
Parses coordination.log
Colored by agent (Queen=purple, Planner=blue, etc.)
Auto-scroll with pause
File Ownership Matrix (src/lib/components/OwnershipMatrix.svelte)
Parses file-ownership.md
Visual grid of files Γ planners
Highlights conflicts
1. User clicks "Launch Swarm"
2. Frontend β Tauri command: launch_swarm(project, planner_count)
3. Rust creates session directory structure
4. Rust copies templates, generates prompts
5. Rust spawns Queen PTY
6. Rust returns session_id to frontend
7. Frontend subscribes to session events
8. Queen output streams via Tauri events
9. xterm.js renders output
1. PTY reader receives bytes
2. Rust buffers and scans for patterns:
- "?" at line end β WaitingForInput
- "PLANNER_COMPLETE" β status update
- Log format "[HH:MM:SS] AGENT:" β parse for coordination
3. Rust emits typed events to frontend
4. Frontend updates hierarchy status
5. If WaitingForInput β trigger alert
1. User types in xterm.js
2. xterm.js onData fires
3. Frontend β Tauri command: write_to_agent(agent_id, bytes)
4. Rust writes bytes to PTY stdin
5. Agent receives input
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β [β‘] Hive Manager [_] [β‘] [Γ] β
ββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββ€
β β βββββββββββββββββββββββ βββββββββββββββββββββββ β β
β ACTIVE β β Queen [β] β β Planner A [β] β β HIERARCHY β
β β β β β β β β
β > Swarmβ β Phase 2: Spawning β β Domain: Backend β β Queen β β
β auth β β planners... β β Spawning Worker 1a β β ββ Pa β β
β β β β β β β β ββW1a β³β
β β βββββββββββββββββββββββ βββββββββββββββββββββββ β β ββW2a β
β RECENT β βββββββββββββββββββββββ βββββββββββββββββββββββ β β ββW3a β
β β β Worker 1a [β³] β β Worker 2a [β] β β ββ Pb β β
β - hive β β β β β β β
β - swarmβ β Reading task... β β (not started) β β ββββββββββββ
β β β β β β β COORDINATIONβ
β β βββββββββββββββββββββββ βββββββββββββββββββββββ β Pa: [STATUS]β
β [+] Newβ β Starting w1aβ
ββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββ€
β Type: [Swarm βΌ] Planners: [2][3][4] Project: D:/Code/myapp [Launch] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Badge
Meaning
Color
β
Running
Blue #7aa2f7
β³
Waiting for input
Yellow #e0af68
β
Completed
Green #9ece6a
β
Error
Red #f7768e
β
Not started
Gray #414868
β
Starting
Cyan #7dcfff
Shortcut
Action
Ctrl+1-9
Focus terminal by position
Ctrl+Q
Focus Queen
Ctrl+A/B/C/D
Focus Planner A/B/C/D
Ctrl+Tab
Cycle terminals
Ctrl+Shift+Tab
Cycle reverse
Ctrl+N
New session dialog
Ctrl+W
Stop focused agent
Ctrl+Shift+W
Stop entire session
F11
Toggle fullscreen terminal
Ctrl+G
Toggle grid/tree layout
Ctrl+L
Toggle coordination log panel
Ctrl+F
Search in focused terminal
Ctrl+,
Settings
Escape
Exit fullscreen / close dialog
Color Scheme (Tokyo Night)
Element
Color
Background
#1a1b26
Surface
#24283b
Surface Hover
#292e42
Border
#414868
Text
#c0caf5
Text Muted
#565f89
Accent (Blue)
#7aa2f7
Success (Green)
#9ece6a
Warning (Yellow)
#e0af68
Error (Red)
#f7768e
Info (Cyan)
#7dcfff
Purple
#bb9af7
Agent Colors (for hierarchy/logs)
Agent
Color
Queen
Purple #bb9af7
Planner
Blue #7aa2f7
Worker (Backend)
Cyan #7dcfff
Worker (Frontend)
Green #9ece6a
Worker (Coherence)
Yellow #e0af68
Worker (Simplify)
Orange #ff9e64
Reviewer
Magenta #ff007c
Tester
Teal #1abc9c
Component
Location
Releases
GitHub Releases (private repo)
Manifest
https://github.com/{user}/hive-manager/releases/latest/download/latest.json
Installer
.msi (Windows)
{
"plugins" : {
"updater" : {
"active" : true ,
"dialog" : true ,
"endpoints" : [
" https://github.com/{user}/hive-manager/releases/latest/download/latest.json"
],
"pubkey" : " YOUR_PUBLIC_KEY"
}
}
}
App Start β Check Updates β Available?
β
βββββββββββββββββ΄ββββββββββββββββ
β Yes β No
βΌ βΌ
Show Changelog Dialog Continue Normal
β
βββββββββββ΄ββββββββββ
β Now Later β
βΌ βΌ
Download in BG Remind Next Launch
Install on Exit
Previous installer saved to %APPDATA%/hive-manager/backups/
Settings stored separately (never overwritten)
"Rollback" in Settings β restores previous version
D:/Code Projects/hive-manager/
βββ src/ # Svelte frontend
β βββ lib/
β β βββ components/
β β β βββ Terminal.svelte # xterm.js wrapper
β β β βββ TerminalGrid.svelte # Grid layout manager
β β β βββ HierarchyTree.svelte # Agent hierarchy view
β β β βββ CoordinationLog.svelte
β β β βββ OwnershipMatrix.svelte
β β β βββ SessionSidebar.svelte
β β β βββ LaunchDialog.svelte
β β β βββ SettingsDialog.svelte
β β β βββ StatusBadge.svelte
β β βββ stores/
β β β βββ sessions.ts # Session state
β β β βββ agents.ts # Agent hierarchy state
β β β βββ terminals.ts # Terminal instances
β β β βββ settings.ts # User preferences
β β βββ utils/
β β βββ tauri.ts # Tauri IPC wrappers
β β βββ terminal.ts # xterm.js helpers
β βββ routes/
β β βββ +page.svelte
β βββ app.html
β βββ app.css
βββ src-tauri/ # Rust backend
β βββ src/
β β βββ main.rs
β β βββ lib.rs
β β βββ pty/
β β β βββ mod.rs
β β β βββ manager.rs
β β β βββ session.rs
β β βββ session/
β β β βββ mod.rs
β β β βββ manager.rs
β β β βββ hive.rs
β β β βββ swarm.rs
β β β βββ fusion.rs
β β βββ spawner/
β β β βββ mod.rs
β β β βββ claude.rs
β β β βββ cursor.rs
β β β βββ gemini.rs
β β β βββ opencode.rs
β β β βββ codex.rs
β β βββ watcher/
β β β βββ mod.rs
β β β βββ parser.rs
β β βββ updater/
β β β βββ mod.rs
β β βββ commands/
β β β βββ mod.rs
β β β βββ session.rs
β β β βββ agent.rs
β β β βββ settings.rs
β β βββ config/
β β βββ mod.rs
β βββ Cargo.toml
β βββ tauri.conf.json
β βββ icons/
βββ static/
βββ package.json
βββ svelte.config.js
βββ vite.config.ts
βββ tsconfig.json
βββ PRD.md
βββ CLAUDE.md
[dependencies ]
tauri = { version = " 2" , features = [" shell-open" ] }
tauri-plugin-updater = " 2"
tauri-plugin-dialog = " 2"
tauri-plugin-fs = " 2"
tauri-plugin-shell = " 2"
serde = { version = " 1" , features = [" derive" ] }
serde_json = " 1"
tokio = { version = " 1" , features = [" full" ] }
portable-pty = " 0.8"
notify = " 6"
notify-debouncer-mini = " 0.4"
chrono = { version = " 0.4" , features = [" serde" ] }
uuid = { version = " 1" , features = [" v4" ] }
thiserror = " 1"
tracing = " 0.1"
tracing-subscriber = " 0.3"
directories = " 5"
regex = " 1"
{
"devDependencies" : {
"@sveltejs/adapter-static" : " ^3" ,
"@sveltejs/kit" : " ^2" ,
"@sveltejs/vite-plugin-svelte" : " ^4" ,
"@tauri-apps/cli" : " ^2" ,
"svelte" : " ^5" ,
"typescript" : " ^5" ,
"vite" : " ^6"
},
"dependencies" : {
"@tauri-apps/api" : " ^2" ,
"@tauri-apps/plugin-updater" : " ^2" ,
"@tauri-apps/plugin-dialog" : " ^2" ,
"@xterm/xterm" : " ^5" ,
"@xterm/addon-fit" : " ^0.10" ,
"@xterm/addon-webgl" : " ^0.18" ,
"@xterm/addon-search" : " ^0.15"
}
}
Future Considerations (v2+)
Replace file-based coordination with real-time messaging
MCP server embedded in app
Structured agent communication
Token usage per agent
Session duration metrics
Success/failure tracking
Cost estimation
SSH tunnel for remote PTY
Multi-machine coordination
Appendix: Session Directory Structures
.hive/sessions/{SESSION_ID}/
βββ session.json
βββ coordination.log
βββ queen-prompt.md
βββ tasks/
β βββ worker-1-task.md
β βββ worker-2-task.md
βββ state/
β βββ current.json
βββ spawn/
βββ queen.bat
βββ worker-*.bat
.swarm/sessions/{SESSION_ID}/
βββ docs/
β βββ model-selection.md
β βββ spawn-templates.md
β βββ log-protocol.md
βββ phases/
β βββ phase-1-planning.md
β βββ phase-2-execution.md
β βββ phase-3-review.md
β βββ phase-4-integration.md
β βββ phase-5-commit.md
βββ state/
β βββ context.md
β βββ responsibility-matrix.md
β βββ file-ownership.md
β βββ session-guidelines.md
β βββ tasks.json
βββ tasks/
β βββ planner-a/
β β βββ worker-1a-task.md
β β βββ worker-2a-task.md
β βββ planner-b/
β βββ ...
βββ logs/
β βββ queen.log
β βββ coordination.log
β βββ planner-a.log
β βββ planner-b.log
βββ spawn/
β βββ queen.bat
β βββ planner-a.bat
β βββ worker-1a.bat
β βββ ...
βββ queen-prompt.md
βββ planner-a-prompt.md
βββ planner-b-prompt.md
βββ launch.ps1
Last updated: 2026-02-03