Multi-agent ensemble planning CLI
npx claudepluginhub gbasin/thunkOrchestrate Claude Code and Codex to collaboratively create implementation plans with human-in-the-loop review
WARNING: This Python implementation is deprecated. The active Bun + TypeScript rewrite lives at ../thunk-ts. New development should happen there.
Multi-agent ensemble planning CLI. Orchestrates multiple AI agents (Claude Code, OpenAI Codex) to collaboratively create implementation plans with human-in-the-loop review.
"A droid is only as good as its plan." Planning with multiple models produces more robust plans through:
uv tool install git+https://github.com/gbasin/thunk
To update:
uv tool upgrade thunk
# Start a planning session
thunk init "Add user authentication"
# Wait for agents to complete first turn
thunk wait --session <session_id>
# Review and edit the plan
# Edit .thunk/sessions/<id>/turns/001.md
# Continue to next turn (incorporates your edits)
thunk continue --session <session_id>
# Approve when satisfied
thunk approve --session <session_id>
Each turn follows this flow:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ DRAFT │ -> │ PEER REVIEW │ -> │ SYNTHESIS │ -> │ USER REVIEW │
│ │ │ │ │ │ │ │
│ Each agent │ │ Agents │ │ Merge into │ │ Human edits │
│ writes plan │ │ review peer │ │ unified │ │ turns/001.md│
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
turns/NNN.md, then calls continue or approveAgents maintain context across turns via CLI session continuation:
--resume <session_id>resume <thread_id>This means agents accumulate codebase knowledge rather than starting fresh each turn.
When you edit turns/001.md and call continue, agents receive your changes as a diff. They interpret your edits naturally:
| Command | Description |
|---|---|
thunk init "task" | Start new planning session |
thunk wait --session <id> | Block until current turn completes |
thunk status --session <id> | Check progress without blocking |
thunk continue --session <id> | Start next turn after your edits |
thunk approve --session <id> | Lock plan as final |
thunk list | List all sessions |
thunk clean --session <id> | Remove session data |
thunk diff --session <id> | Show changes between turns |
.thunk/sessions/swift-river/ # Human-friendly session ID
├── meta.yaml # Task description, timestamp
├── state.yaml # Turn, phase, agent_plan_ids mapping
│
├── sunny-glade.md # Agent's persistent plan (plan_id)
├── amber-marsh.md # Another agent's plan
│
├── turns/
│ ├── 001.md # Turn 1 synthesis (USER EDITS THIS)
│ ├── 001.snapshot.md # Pre-edit snapshot (for diffing)
│ ├── 001/ # Debug snapshots
│ │ ├── sunny-glade-draft.md
│ │ └── sunny-glade-reviewed.md
│ ├── 002.md
│ └── ...
│
├── agents/
│ ├── sunny-glade.log # Session-wide debug log (appended)
│ ├── sunny-glade/
│ │ └── cli_session_id.txt # For --resume
│ ├── amber-marsh.log
│ └── synthesizer.log
│
└── PLAN.md # Symlink to approved turn
Key points:
sunny-glade, amber-marsh) are opaque names mapped to agents in state.yamlsunny-glade.md)Default agents (in code):
Both run from the project root with full read access and limited tool permissions for safe exploration.