Parallel Claude Code Agent Orchestration for Exploratory Development
Electron desktop app that runs 4 Claude Code agents simultaneously in isolated Daytona sandboxes, each exploring different approaches to the same task. Pick the best solution, iterate in the next round with the winner's codebase as the starting point.
Hackathon: Daytona Hacksprint (Jan 26, 2026) Status: β Planning Complete β Ready for Implementation
- docs/PRD.md - Product requirements, user stories, acceptance criteria
- docs/DESIGN.md - System architecture, data flow, database schema
- docs/TECH_STACK.md - All dependencies, versions, installation guide
- docs/TASKS.md - Implementation checklist with phases
- docs/PROJECT.md - Project overview, commands, timeline
- CHANGELOG.md - Track of all changes made to the codebase
- ERRORS.md - Error log with root causes and solutions
Problem: When building software, you often don't know the best approach upfront. Should you use Library A or B? Pattern X or Y? Trial-and-error wastes time.
Solution: Run 4 agents in parallel, each trying a different approach. Observe them working simultaneously, pick the winner, and iterate on that solution in subsequent rounds.
Example Flow:
Round 1: "Build a snake game in Python"
βββ Agent 1: Uses pygame (object-oriented)
βββ Agent 2: Uses tkinter (functional)
βββ Agent 3: Uses curses (terminal-based)
βββ Agent 4: Uses web canvas (Flask + JS)
β User selects Agent 1 (pygame) as winner
Round 2: "Add score counter and high score tracking"
βββ All 4 agents start with Agent 1's pygame code
βββ Each tries different score persistence methods
βββ User picks best implementation
Round 3: "Add difficulty levels"
β Continue iterating...
βββββββββββββββββββββββββββββββββββββββββββ
β Electron App (Your Computer) β
β β
β βββββββββββββββββββββββββββββββββββ β
β β React UI (2x2 Grid) β β
β β βββββββββ¬ββββββββ β β
β β β Term1 β Term2 β xterm.js β β
β β βββββββββΌββββββββ€ β β
β β β Term3 β Term4 β β β
β β βββββββββ΄ββββββββ β β
β βββββββββββββββββββββββββββββββββββ β
β β² IPC β
β ββββββββββββββΌβββββββββββββββββββββ β
β β Node.js Main Process β β
β β - Sandbox Manager β β
β β - Auth Manager β β
β β - SQLite Database β β
β βββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
β API Calls
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β Daytona Cloud β
β ββββββββ¬βββββββ¬βββββββ¬βββββββ β
β β Sb 1 β Sb 2 β Sb 3 β Sb 4 β β
β β[CLI] β[CLI] β[CLI] β[CLI] β β
β ββββββββ΄βββββββ΄βββββββ΄βββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
Key Flow:
- User enters task prompt
- App generates 4 prompt variations (via Claude API)
- Spins up 4 Daytona sandboxes in parallel
- Installs Claude Code CLI in each sandbox
- Executes variations, streams output to UI terminals
- User clicks "Select" on best agent
- App extracts winner's files, destroys all sandboxes
- User enters next prompt β files injected into 4 new sandboxes
- Repeat
Desktop: Electron + React + TypeScript Terminal: xterm.js Database: SQLite (better-sqlite3) APIs: Daytona SDK, Anthropic SDK Build: Vite + electron-builder
See TECH_STACK.md for full dependency list and versions.
The Problem: Claude Code CLI requires browser-based OAuth, but Daytona sandboxes are headless (no browser).
The Solution:
- User runs
claude setup-tokenlocally on their machine - Copy the OAuth token from output
- App injects
CLAUDE_CODE_OAUTH_TOKENenv var into each sandbox - Claude CLI uses token for authentication (no browser needed)
# On your local machine (one-time setup)
claude setup-token
# Output: CLAUDE_CODE_OAUTH_TOKEN=xxxxx
# Copy this token into app settingsIf token auth fails (see known issue):
- User provides
ANTHROPIC_API_KEYinstead - App injects API key into sandboxes
- Claude CLI uses direct API authentication
Required Accounts:
- Daytona account with API key
- Claude Pro/Max subscription (for
setup-token) OR Anthropic API credits
Total: ~12 hours
| Phase | Time | Tasks |
|---|---|---|
| Setup | 0.5h | Project init, dependencies, structure |
| Auth | 1h | Setup wizard, credential validation |
| Sandboxes | 2h | Create sandboxes, install CLI |
| Prompts | 0.75h | Generate variations via Claude API |
| UI & Streaming | 2h | Grid layout, xterm.js integration |
| Execution | 1.5h | Run agents, status tracking |
| Winner Selection | 1.5h | Extract files, destroy sandboxes |
| Next Round | 1.5h | File injection, iteration |
| Polish | 1.5h | Error handling, UI refinements |
| Demo Prep | 1h | Test 3-round flow, package app |
See TASKS.md for detailed checklist.
# Node.js 20+ (LTS)
node --version # v20.11.0+
# Accounts & Keys
# 1. Daytona account β get API key from dashboard
# 2. Claude Pro/Max β run: claude setup-token
# OR Anthropic API credits β get key from console.anthropic.com# Create project
mkdir multishot && cd multishot
npm init -y
# Install dependencies (see TECH_STACK.md for full list)
npm install @daytonaio/sdk @anthropic-ai/sdk better-sqlite3 \
react react-dom xterm xterm-addon-fit electron
npm install --save-dev typescript vite electron-builder \
@types/react @types/node tailwindcss
# Setup config files
npx tsc --init
npx tailwindcss init -p
# Create .env
cp .env.example .env
# Edit .env with your API keys# .env
DAYTONA_API_KEY=dtn_xxxxx
CLAUDE_CODE_OAUTH_TOKEN=your_token_here
# OR
ANTHROPIC_API_KEY=sk-ant-xxxxxnpm run devObjective: Show 3-round iterative development of a snake game.
Prompt: "Build a snake game in Python"
Expected Outcomes:
- Agent 1: pygame implementation
- Agent 2: tkinter implementation
- Agent 3: terminal-based (curses)
- Agent 4: web-based (Flask + canvas)
Action: Select pygame agent (best GUI + performance)
Prompt: "Add score counter and high score tracking"
Expected Outcomes:
- All agents start with pygame code from Round 1
- Different approaches to score persistence (file, SQLite, JSON)
Action: Select best persistence implementation
Prompt: "Add difficulty levels (easy, medium, hard)"
Expected Outcomes:
- Speed variations, obstacle generation, etc.
Action: Select polished version β Final playable game!
Demo Time: <5 minutes Wow Factor: Watch 4 terminals building simultaneously, pick best-of-breed
β MVP Complete:
- User can create run with task prompt
- 4 agents execute in parallel with live terminal streaming
- Winner selection extracts state correctly
- Next round injects winner files into new agents
- Multiple rounds iterate successfully
β Demo Success:
- Complete 3-round snake game in <5 min
- No crashes during presentation
- Clear visual impact (4 terminals, different approaches)
- Audience understands value proposition
| Risk | Mitigation |
|---|---|
CLAUDE_CODE_OAUTH_TOKEN doesn't work |
Implement ANTHROPIC_API_KEY fallback on Day 1 |
| Sandbox creation slow (20-30s) | Show clear loading indicator, set expectations |
| Terminal streaming lag | Buffer outputs (100ms), optimize IPC |
| All 4 agents fail | Allow run restart with modified prompt |
| Network issues during demo | Record backup demo GIF |
- Auto-scoring: Claude evaluates outputs, recommends winner
- File preview: Monaco editor for viewing code
- Agent metrics: Token usage, execution time, error count
- Cloud sync: Share runs across devices
- Custom agents: User-defined Docker images
- Collaboration mode: Agents communicate and combine solutions
multishot/
βββ README.md # This file
βββ CLAUDE.md # Claude Code agent guidance
βββ CHANGELOG.md # Track of all changes
βββ ERRORS.md # Error log with solutions
βββ docs/ # Project documentation
β βββ PRD.md # Product requirements
β βββ DESIGN.md # System architecture
β βββ TECH_STACK.md # Dependencies & tools
β βββ TASKS.md # Implementation checklist
β βββ PROJECT.md # Project overview
βββ prompts/ # LLM prompt templates
βββ .claude/skills/ # Claude Code agent skills
β βββ daytona-integration/
β βββ electron-ipc/
β βββ database-schema/
β βββ terminal-streaming/
β βββ auth-flow/
βββ src/ # (when implemented)
βββ main/ # Electron main process
βββ renderer/ # React UI
βββ shared/ # Shared types
- Start Here: README.md (this file)
- Understand Requirements: docs/PRD.md
- Understand Architecture: docs/DESIGN.md
- Set Up Environment: docs/TECH_STACK.md
- Follow Implementation: docs/TASKS.md
- Quick Reference: docs/PROJECT.md
- Track Changes: CHANGELOG.md
- Error Reference: ERRORS.md
Project Lead: Sean Chiu Hackathon: Daytona Hacksprint (Jan 26, 2026) Planning Completed: Jan 22, 2026
External Resources:
- Daytona Docs
- Daytona TypeScript SDK
- Anthropic API Docs
- Claude Code Setup
- xterm.js Guide
- Electron IPC
Status: π Ready to Build Next Step: Initialize project structure (see TASKS.md Phase 1)
Generated with Claude Sonnet 4.5 on 2026-01-22