claude-overnight 0.1.2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -29
- package/dist/index.js +254 -85
- package/dist/planner.d.ts +19 -2
- package/dist/planner.js +284 -75
- package/dist/swarm.d.ts +7 -1
- package/dist/swarm.js +62 -21
- package/dist/types.d.ts +6 -0
- package/dist/ui.js +38 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# claude-overnight
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Fire off Claude agents, come back to shipped work.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Describe what to build. Set a budget — 10 agents, 100, 1000. A planner agent analyzes your codebase, breaks the objective into that many independent tasks, and launches them all. Each agent runs in its own git worktree with full tooling (Read, Edit, Bash, Grep — everything). Rate limits? It waits. Windows reset? It resumes. It doesn't stop until every task is done.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -10,17 +10,17 @@ Tell it what to build. Set a budget — 10 tasks, 100, 1000, whatever the job ne
|
|
|
10
10
|
npm install -g claude-overnight
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Requires Node.js >= 20 and
|
|
13
|
+
Requires Node.js >= 20 and Claude authentication (OAuth via `claude` CLI, or `ANTHROPIC_API_KEY`).
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Usage
|
|
16
16
|
|
|
17
|
-
### Interactive
|
|
17
|
+
### Interactive
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
claude-overnight
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Describe your objective, set a
|
|
23
|
+
Describe your objective, set a budget, pick a worker model, set a usage limit. The planner generates tasks — review, edit, or chat about them, then run.
|
|
24
24
|
|
|
25
25
|
### Task file
|
|
26
26
|
|
|
@@ -28,13 +28,53 @@ Describe your objective, set a task budget, pick a model. The planner generates
|
|
|
28
28
|
claude-overnight tasks.json
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
### Inline
|
|
31
|
+
### Inline
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
claude-overnight "fix auth bug in src/auth.ts" "add tests for user model"
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
## How the planner works
|
|
38
|
+
|
|
39
|
+
The planner always runs on the best available model (Opus) regardless of which model you pick for workers. This ensures high-quality task decomposition even when workers use a cheaper model.
|
|
40
|
+
|
|
41
|
+
### Model-aware task design
|
|
42
|
+
|
|
43
|
+
The planner calibrates task ambition based on your worker model:
|
|
44
|
+
|
|
45
|
+
**Opus workers**: Each session is a powerhouse — it can own entire epics, do deep codebase research, make architectural decisions, implement complex multi-file systems, and use browser tools for analysis. The planner gives these agents full ownership and autonomy.
|
|
46
|
+
|
|
47
|
+
**Sonnet workers**: Capable of substantial implementation, refactoring, and testing. The planner gives meaningful missions with room for decision-making.
|
|
48
|
+
|
|
49
|
+
**Haiku workers**: Fast and efficient, best for focused tasks. The planner gives specific, well-scoped instructions with clear file paths and expected changes.
|
|
50
|
+
|
|
51
|
+
### Budget scaling
|
|
52
|
+
|
|
53
|
+
The budget also shapes task granularity:
|
|
54
|
+
|
|
55
|
+
**Small budget (1-15)**: Specific, file-level tasks. "In `src/auth.ts`, refactor `validateToken()` to use JWT."
|
|
56
|
+
|
|
57
|
+
**Medium budget (16-50)**: Autonomous missions. "Design and implement the complete favorites system: DB schema, API routes, client hooks, error handling."
|
|
58
|
+
|
|
59
|
+
**Large budget (50+)**: Full workstream decomposition. Architecture, features, testing, security, UX polish, performance — everything a team would cover. Each task is a substantial work session.
|
|
60
|
+
|
|
61
|
+
A budget of 200 is not 200 micro-edits. It's 200 senior-engineer work sessions running in parallel.
|
|
62
|
+
|
|
63
|
+
## Usage limits
|
|
64
|
+
|
|
65
|
+
Control how much of your plan capacity the run consumes. In interactive mode, you'll be asked:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Usage limit:
|
|
69
|
+
→ Unlimited — use full capacity, wait through rate limits
|
|
70
|
+
90% — leave 10% for other work
|
|
71
|
+
75% — conservative, plenty of headroom
|
|
72
|
+
50% — use half, keep the rest
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
When utilization hits your cap, the swarm stops dispatching new tasks and lets active agents finish gracefully. This way you can run a big overnight job and still have capacity left for manual Claude usage.
|
|
76
|
+
|
|
77
|
+
Use `--usage-cap=90` on the command line, or `"usageCap": 90` in task files.
|
|
38
78
|
|
|
39
79
|
## Task file format
|
|
40
80
|
|
|
@@ -46,48 +86,76 @@ Each quoted argument becomes one parallel task.
|
|
|
46
86
|
],
|
|
47
87
|
"model": "claude-sonnet-4-6",
|
|
48
88
|
"concurrency": 4,
|
|
49
|
-
"worktrees": true
|
|
89
|
+
"worktrees": true,
|
|
90
|
+
"usageCap": 90
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
A plain array also works: `["task one", "task two"]`.
|
|
95
|
+
|
|
96
|
+
For multi-wave runs from a task file, add `objective` and `flexiblePlan`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"objective": "Modernize the auth system and add comprehensive tests",
|
|
101
|
+
"flexiblePlan": true,
|
|
102
|
+
"tasks": ["Refactor auth middleware", "Add JWT validation"],
|
|
103
|
+
"usageCap": 90
|
|
50
104
|
}
|
|
51
105
|
```
|
|
52
106
|
|
|
53
|
-
|
|
107
|
+
The initial tasks run first. After each wave, a steering agent reads the codebase and plans the next wave until the objective is met or the budget runs out.
|
|
54
108
|
|
|
55
109
|
| Field | Type | Default | Description |
|
|
56
110
|
|---|---|---|---|
|
|
57
|
-
| `tasks` | `(string \| {prompt, cwd?, model?})[]` | required | Tasks to run
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
111
|
+
| `tasks` | `(string \| {prompt, cwd?, model?})[]` | required | Tasks to run |
|
|
112
|
+
| `objective` | `string` | — | High-level goal for multi-wave steering (required when `flexiblePlan` is true) |
|
|
113
|
+
| `flexiblePlan` | `boolean` | `false` | Enable adaptive multi-wave planning from task files |
|
|
114
|
+
| `model` | `string` | prompted | Worker model (per-task overridable) |
|
|
115
|
+
| `concurrency` | `number` | `5` | Max parallel agents |
|
|
60
116
|
| `worktrees` | `boolean` | auto (git repo) | Isolate each agent in a git worktree |
|
|
61
117
|
| `permissionMode` | `"auto" \| "bypassPermissions" \| "default"` | `"auto"` | How agents handle dangerous operations |
|
|
62
|
-
| `cwd` | `string` | `process.cwd()` | Working directory
|
|
63
|
-
| `allowedTools` | `string[]` | all | Restrict
|
|
64
|
-
| `mergeStrategy` | `"yolo" \| "branch"` | `"yolo"` | Merge into HEAD or
|
|
118
|
+
| `cwd` | `string` | `process.cwd()` | Working directory |
|
|
119
|
+
| `allowedTools` | `string[]` | all | Restrict agent tools |
|
|
120
|
+
| `mergeStrategy` | `"yolo" \| "branch"` | `"yolo"` | Merge into HEAD or a new branch |
|
|
121
|
+
| `usageCap` | `number (0-100)` | unlimited | Stop at N% utilization (e.g. 90) |
|
|
65
122
|
|
|
66
123
|
## CLI flags
|
|
67
124
|
|
|
68
125
|
| Flag | Default | Description |
|
|
69
126
|
|---|---|---|
|
|
70
|
-
| `--budget=N` | `10` |
|
|
71
|
-
| `--concurrency=N` | `5` | How many agents run
|
|
72
|
-
| `--model=NAME` |
|
|
73
|
-
| `--
|
|
74
|
-
| `--
|
|
75
|
-
|
|
|
76
|
-
|
|
|
127
|
+
| `--budget=N` | `10` | Total agent sessions the planner targets |
|
|
128
|
+
| `--concurrency=N` | `5` | How many agents run simultaneously |
|
|
129
|
+
| `--model=NAME` | prompted | Worker model (planner always uses best available) |
|
|
130
|
+
| `--usage-cap=N` | unlimited | Stop at N% utilization |
|
|
131
|
+
| `--timeout=SECONDS` | `300` | Inactivity timeout (kills only silent agents) |
|
|
132
|
+
| `--no-flex` | — | Disable adaptive multi-wave planning (run all tasks in one shot) |
|
|
133
|
+
| `--dry-run` | — | Show planned tasks without running |
|
|
134
|
+
| `-h, --help` | — | Help |
|
|
135
|
+
| `-v, --version` | — | Version |
|
|
136
|
+
|
|
137
|
+
Budget = total work. Concurrency = pace. A budget of 100 with concurrency 5 means 100 tasks, 5 at a time.
|
|
77
138
|
|
|
78
139
|
## Rate limits and long runs
|
|
79
140
|
|
|
80
|
-
|
|
141
|
+
Built for unattended runs lasting hours, days, or weeks.
|
|
81
142
|
|
|
82
|
-
- **
|
|
83
|
-
- **
|
|
143
|
+
- **Usage bar**: the live UI shows current utilization with a visual bar, percentage, and countdown to reset when rate-limited.
|
|
144
|
+
- **Hard block**: API returns a reset timestamp — swarm pauses and resumes exactly when the window opens.
|
|
145
|
+
- **Soft throttle**: at >75% utilization, dispatch slows to avoid hitting the limit.
|
|
84
146
|
- **Retry with backoff**: transient errors (429, overloaded, connection reset) retry with exponential backoff.
|
|
147
|
+
- **Usage cap**: set a ceiling and the swarm stops dispatching when it's reached — active agents finish, no new ones start.
|
|
85
148
|
|
|
86
|
-
No tasks are dropped. Set a budget of 1000
|
|
149
|
+
No tasks are dropped. Set a budget of 1000 and go to sleep.
|
|
87
150
|
|
|
88
151
|
## Worktrees and merging
|
|
89
152
|
|
|
90
|
-
Each agent
|
|
153
|
+
Each agent gets an isolated git worktree on a `swarm/task-N` branch. Changes auto-commit when the agent finishes. After all agents complete, branches merge back sequentially.
|
|
154
|
+
|
|
155
|
+
- `"yolo"` (default): merges directly into your current branch
|
|
156
|
+
- `"branch"`: creates a `swarm/run-{timestamp}` branch (main untouched)
|
|
157
|
+
|
|
158
|
+
Merge conflicts retry with `-X theirs`. If that fails, the branch is preserved for manual resolution. Stale worktrees and `swarm/*` branches from previous runs are cleaned up on startup.
|
|
91
159
|
|
|
92
160
|
## Exit codes
|
|
93
161
|
|
|
@@ -95,4 +163,4 @@ Each agent runs in an isolated git worktree on a `swarm/task-N` branch. Changes
|
|
|
95
163
|
|---|---|
|
|
96
164
|
| `0` | All tasks succeeded |
|
|
97
165
|
| `1` | Some tasks failed |
|
|
98
|
-
| `2` | All
|
|
166
|
+
| `2` | All failed or none completed |
|