You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run N parallel Claude Code agents on the same task, then select the best result via test execution and convergence analysis. Based on the principle that **the aggregate of independent attempts outperforms any single attempt** — proven in [ensemble ML](https://en.wikipedia.org/wiki/Ensemble_learning), [superforecasting](https://en.wikipedia.org/wiki/Superforecasting), and [LLM code generation research](#references).
24
+
25
+
## Quick start
26
+
27
+
```bash
28
+
npm install -g thinktank
29
+
30
+
# Run 3 parallel agents on a task
31
+
thinktank run "fix the authentication bypass"
32
+
33
+
# Run 5 agents with test verification
34
+
thinktank run "fix the race condition" -n 5 -t "npm test"
35
+
36
+
# Apply the best result
37
+
thinktank apply
38
+
```
8
39
9
-
Based on the principle that **the aggregate of independent attempts outperforms any single attempt** — proven in [ensemble ML](https://en.wikipedia.org/wiki/Ensemble_learning), [superforecasting](https://en.wikipedia.org/wiki/Superforecasting), and [LLM code generation research](#references).
40
+
Requires [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated.
10
41
11
42
## How it works
12
43
13
44
```
14
-
thinktank run "fix the authentication bypass" -n 5 -t "npm test"
45
+
┌─────────────┐
46
+
│ Your task │
47
+
└──────┬──────┘
48
+
│
49
+
┌────────────┼────────────┐
50
+
│ │ │
51
+
▼ ▼ ▼
52
+
┌──────────┐ ┌──────────┐ ┌──────────┐
53
+
│ Agent #1 │ │ Agent #2 │ │ Agent #3 │
54
+
│ worktree │ │ worktree │ │ worktree │
55
+
└────┬─────┘ └────┬─────┘ └────┬─────┘
56
+
│ │ │
57
+
▼ ▼ ▼
58
+
┌──────────────────────────────────────┐
59
+
│ Test & Convergence │
60
+
│ ┌─────────┐ ┌──────────────────┐ │
61
+
│ │ npm test │ │ Agents 1,3 agree │ │
62
+
│ └─────────┘ └──────────────────┘ │
63
+
└───────────────────┬──────────────────┘
64
+
│
65
+
▼
66
+
┌─────────────────┐
67
+
│ Best result │
68
+
│ recommended │
69
+
└─────────────────┘
15
70
```
16
71
17
72
1. Spawns **N parallel Claude Code agents**, each in an isolated git worktree
18
73
2. Each agent independently solves the task (no shared context = true independence)
19
74
3. Runs your **test suite** on each result
20
75
4. Analyzes **convergence** — did the agents agree on an approach?
21
76
5.**Recommends** the best candidate (tests passing + consensus + smallest diff)
22
-
6. You review and apply
77
+
6. You review and `thinktank apply`
23
78
24
79
## Why this works
25
80
@@ -31,25 +86,19 @@ Every model ever benchmarked shows **pass@5 >> pass@1**. The gap between "one at
31
86
| Confidence | "Did it get it right?" | "4/5 agents agree — high confidence" |
32
87
| Coverage | One approach explored | Multiple approaches, pick the best |
33
88
89
+
The key insight: **parallel attempts cost more tokens but not more time.** All agents run simultaneously.
90
+
34
91
## When to use it
35
92
36
93
-**High-stakes changes** — auth, payments, security, data migrations
37
94
-**Ambiguous tasks** — multiple valid approaches, need to see the spread
38
95
-**Complex refactors** — many files, easy to miss something
39
96
-**Unfamiliar codebases** — agents might go the wrong direction
40
97
41
-
## Install
42
-
43
-
```bash
44
-
npm install -g thinktank
45
-
```
46
-
47
-
Requires [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated.
48
-
49
98
## Usage
50
99
51
100
```bash
52
-
# Run 3 parallel agents (default)
101
+
# Run with defaults (3 agents, sonnet model)
53
102
thinktank run "add rate limiting to the API"
54
103
55
104
# Run 5 agents with test verification
@@ -58,11 +107,17 @@ thinktank run "fix the race condition in the cache layer" -n 5 -t "npm test"
58
107
# Use a specific model
59
108
thinktank run "migrate callbacks to async/await" --model opus -n 3
60
109
110
+
# Apply the recommended result
111
+
thinktank apply
112
+
113
+
# Apply a specific agent's result
114
+
thinktank apply --agent 2
115
+
61
116
# View the last run's results
62
117
thinktank list
63
118
```
64
119
65
-
## Output
120
+
## Example output
66
121
67
122
```
68
123
thinktank — ensemble AI coding
@@ -102,9 +157,7 @@ Convergence
102
157
| Single Claude Code run | pass@1 | 1x | Fastest |
0 commit comments