Skip to content

seanchiuai/multishot

Repository files navigation

🏹 Multishot

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


Quick Links


The Idea

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...

Architecture at a Glance

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   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:

  1. User enters task prompt
  2. App generates 4 prompt variations (via Claude API)
  3. Spins up 4 Daytona sandboxes in parallel
  4. Installs Claude Code CLI in each sandbox
  5. Executes variations, streams output to UI terminals
  6. User clicks "Select" on best agent
  7. App extracts winner's files, destroys all sandboxes
  8. User enters next prompt β†’ files injected into 4 new sandboxes
  9. Repeat

Tech Stack Summary

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.


Critical Challenge: Claude Code OAuth in Sandboxes

The Problem: Claude Code CLI requires browser-based OAuth, but Daytona sandboxes are headless (no browser).

The Solution:

Primary Approach

  1. User runs claude setup-token locally on their machine
  2. Copy the OAuth token from output
  3. App injects CLAUDE_CODE_OAUTH_TOKEN env var into each sandbox
  4. 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 settings

Fallback Approach

If token auth fails (see known issue):

  1. User provides ANTHROPIC_API_KEY instead
  2. App injects API key into sandboxes
  3. Claude CLI uses direct API authentication

Required Accounts:

  • Daytona account with API key
  • Claude Pro/Max subscription (for setup-token) OR Anthropic API credits

Implementation Timeline (Hackathon Day)

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.


Development Setup

Prerequisites

# 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

Installation

# 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

Environment Variables

# .env
DAYTONA_API_KEY=dtn_xxxxx
CLAUDE_CODE_OAUTH_TOKEN=your_token_here
# OR
ANTHROPIC_API_KEY=sk-ant-xxxxx

Run Development Server

npm run dev

Demo Script

Objective: Show 3-round iterative development of a snake game.

Round 1: Initial Build

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)

Round 2: Feature Addition

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

Round 3: Enhancement

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


Success Metrics

βœ… 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

Known Risks & Mitigations

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

Post-Hackathon Ideas

  • 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

File Structure

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

Documentation Index

  1. Start Here: README.md (this file)
  2. Understand Requirements: docs/PRD.md
  3. Understand Architecture: docs/DESIGN.md
  4. Set Up Environment: docs/TECH_STACK.md
  5. Follow Implementation: docs/TASKS.md
  6. Quick Reference: docs/PROJECT.md
  7. Track Changes: CHANGELOG.md
  8. Error Reference: ERRORS.md

Contact & Resources

Project Lead: Sean Chiu Hackathon: Daytona Hacksprint (Jan 26, 2026) Planning Completed: Jan 22, 2026

External Resources:


Status: πŸš€ Ready to Build Next Step: Initialize project structure (see TASKS.md Phase 1)

Generated with Claude Sonnet 4.5 on 2026-01-22

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors