Oracle tmux Auto-Dispatch Pipeline

Sprint 82: Oracle tmux Auto-Dispatch Pipeline

Goals

Build an automated pipeline where Oracle spawns agents as independent processes (claude -p) in tmux and allocates/collects tasks via file-based IPC.

Background

Before: 11 agents executed sequentially in a single Claude session → no parallelization, context window overload After: Independent process spawn via tmux → parallel execution, file-based IPC

Architecture

Oracle (tmux control pane)
  → oracle-dispatch.sh
    → oracle-spawn.sh {agent} (tmux tier{N} pane) — claude -p
  → oracle-reap.sh (result collection)
  → oracle-watchdog.sh (timeout monitoring)

tmux Session Structure

  • session: "oracle"
    • window 0 "control": Oracle process
    • window 1 "tier1": conductor, gatekeeper, librarian (dynamic pane)
    • window 2 "tier2": architect, scribe, postman, curator
    • window 3 "tier3": herald, palette, scout, sensei

File-Based IPC

  • ~/.claude/oracle/tasks/{task_id}.json — task queue
  • ~/.claude/oracle/inbox/{agent}-{task_id}.md — agent results
  • ~/.claude/oracle/prompts/{agent}.txt — built system prompts
  • ~/.claude/oracle/logs/{agent}-{task_id}.out — stdout logs
  • ~/.claude/oracle/state/panes.json — active pane mapping
  • ~/.claude/oracle/state/locks/{agent}.lock — concurrent execution prevention

Implementation Details

Phase 1: Directory + Prompt Build

  • ~/.claude/oracle/ directory structure created
  • _result-protocol.md: agent result output specification
  • oracle-build-prompts.sh: _base.md + {agent}.md + _result-protocol.md → prompts/{agent}.txt

Phase 2: Core Scripts

  • oracle-init.sh: tmux session initialization (4 windows)
  • oracle-spawn.sh: agent spawn (per-tier pane, model mapping)
  • oracle-reap.sh: result collection (inbox file + task JSON status update)
  • oracle-dispatch.sh: dependency DAG resolution → parallel spawn
  • oracle-watchdog.sh: 30-second interval timeout monitoring
  • oracle-status.sh: system status query
  • oracle-cleanup.sh: graceful shutdown

Phase 3: Agent Prompt Refactoring

  • _base.md: added "independent execution mode" section
  • 11 agent .md files: User request: $ARGUMENTS → dual-mode task receipt section

Phase 4: Existing System Integration

  • claude-team.sh: dispatch mode detection → oracle-init.sh / oracle-cleanup.sh integration
  • oracle-respond.sh: task JSON creation after code work → dispatch delegation
  • oracle-system-prompt.md: dispatch system recognition + task JSON format
  • .claude-team.json: 11 agents + presets + dispatch settings

Phase 5: Oracle Skill Modification

  • algosu-oracle.md: added dispatch pipeline usage + judgment criteria

Agent Model Mapping

TierAgentModel
1conductor, gatekeeper, librarianclaude-opus-4-6
2architect, scribe, postman, curatorclaude-sonnet-4-6
3herald, scout, senseiclaude-sonnet-4-6
3palette (exception)claude-opus-4-6

Verification

  • oracle-build-prompts.sh: 11/11 agents built successfully
  • oracle-status.sh: normal output confirmed (no active session state)

File List

FileAction
~/.claude/oracle/bin/oracle-init.shNew
~/.claude/oracle/bin/oracle-spawn.shNew
~/.claude/oracle/bin/oracle-reap.shNew
~/.claude/oracle/bin/oracle-dispatch.shNew
~/.claude/oracle/bin/oracle-watchdog.shNew
~/.claude/oracle/bin/oracle-status.shNew
~/.claude/oracle/bin/oracle-cleanup.shNew
~/.claude/oracle/bin/oracle-build-prompts.shNew
~/.claude/oracle/_result-protocol.mdNew
.claude/commands/agents/_base.mdModified
.claude/commands/agents/*.md (11 files)Modified
~/.claude/oracle-respond.shModified
~/.claude/oracle-system-prompt.mdModified
~/.claude/claude-team.shModified
.claude-team.jsonNew
.claude/commands/algosu-oracle.mdModified