claude-queue 1.5.0 → 1.5.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 +47 -69
- package/claude-queue.sh +20 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# claude-queue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A CLI tool that solves GitHub issues using [Claude Code](https://docs.anthropic.com/en/docs/claude-code). It picks up open issues from your repo, solves them one by one, and opens a pull request with all the fixes. It can also create well-structured GitHub issues from a text description or interactive interview.
|
|
4
4
|
|
|
5
|
-
claude-queue
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
The typical workflow is: open issues for whatever you need done, run `claude-queue`, and come back to a pull request with everything solved. I usually do this at night and review the PR in the morning.
|
|
6
|
+
|
|
7
|
+
Issues don't have to be code changes — they can be investigative tasks like "figure out why the API is slow and document what you find" or "audit the codebase for accessibility issues". Claude will research, document findings, and commit whatever it produces.
|
|
8
8
|
|
|
9
9
|
## Prerequisites
|
|
10
10
|
|
|
@@ -18,7 +18,7 @@ claude-queue has two modes:
|
|
|
18
18
|
npm install -g claude-queue
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Or run directly
|
|
21
|
+
Or run directly:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
npx claude-queue
|
|
@@ -34,17 +34,12 @@ Run from inside any git repository with GitHub issues:
|
|
|
34
34
|
claude-queue
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
#### Solve options
|
|
38
|
-
|
|
39
37
|
| Flag | Default | Description |
|
|
40
38
|
|------|---------|-------------|
|
|
41
39
|
| `--max-retries N` | `3` | Max retry attempts per issue before marking it failed |
|
|
42
|
-
| `--max-turns N` | `50` | Max Claude Code turns per attempt
|
|
43
|
-
| `--label LABEL` | all issues | Only process issues
|
|
40
|
+
| `--max-turns N` | `50` | Max Claude Code turns per attempt |
|
|
41
|
+
| `--label LABEL` | all issues | Only process issues with this label |
|
|
44
42
|
| `--model MODEL` | CLI default | Claude model to use (e.g. `claude-sonnet-4-5-20250929`) |
|
|
45
|
-
| `-h, --help` | | Show help |
|
|
46
|
-
|
|
47
|
-
#### Solve examples
|
|
48
43
|
|
|
49
44
|
```bash
|
|
50
45
|
# Solve all open issues
|
|
@@ -59,7 +54,7 @@ claude-queue --max-retries 5 --model claude-sonnet-4-5-20250929
|
|
|
59
54
|
|
|
60
55
|
### Creating issues
|
|
61
56
|
|
|
62
|
-
Generate
|
|
57
|
+
Generate GitHub issues from a text description or an interactive interview with Claude.
|
|
63
58
|
|
|
64
59
|
```bash
|
|
65
60
|
claude-queue create "Add dark mode and fix the login bug"
|
|
@@ -71,42 +66,31 @@ There are three ways to provide input:
|
|
|
71
66
|
2. **Stdin** — run `claude-queue create` with no arguments, type or paste your text, then press Ctrl+D
|
|
72
67
|
3. **Interactive** — run `claude-queue create -i` and Claude will ask clarifying questions before generating issues
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
#### Create options
|
|
69
|
+
Claude decomposes the input into individual issues with titles, markdown bodies, and labels (reusing existing repo labels where possible). You get a preview before anything is created.
|
|
77
70
|
|
|
78
71
|
| Flag | Default | Description |
|
|
79
72
|
|------|---------|-------------|
|
|
80
73
|
| `-i, --interactive` | off | Interview mode — Claude asks clarifying questions first |
|
|
81
74
|
| `--label LABEL` | none | Add this label to every created issue |
|
|
82
75
|
| `--model MODEL` | CLI default | Claude model to use |
|
|
83
|
-
| `-h, --help` | | Show help for create |
|
|
84
|
-
|
|
85
|
-
#### Create examples
|
|
86
76
|
|
|
87
77
|
```bash
|
|
88
|
-
#
|
|
89
|
-
claude-queue create "Add user avatars, implement search, and fix the 404 on /settings"
|
|
90
|
-
|
|
91
|
-
# Interactive mode — Claude asks questions first
|
|
78
|
+
# Interactive mode
|
|
92
79
|
claude-queue create -i
|
|
93
80
|
|
|
94
|
-
#
|
|
95
|
-
claude-queue create
|
|
96
|
-
|
|
97
|
-
# Add a label to all created issues (useful with --label on solve)
|
|
81
|
+
# Add a label to all created issues
|
|
98
82
|
claude-queue create --label backlog "Refactor the auth module and add rate limiting"
|
|
99
83
|
```
|
|
100
84
|
|
|
101
|
-
###
|
|
85
|
+
### Create then solve workflow
|
|
102
86
|
|
|
103
|
-
The `--label` flag on both commands lets you create a
|
|
87
|
+
The `--label` flag on both commands lets you create a pipeline where `create` plans the issues and `claude-queue` solves them:
|
|
104
88
|
|
|
105
89
|
```bash
|
|
106
|
-
# Plan
|
|
90
|
+
# Plan
|
|
107
91
|
claude-queue create --label nightshift "Add dark mode and fix the login bug"
|
|
108
92
|
|
|
109
|
-
# Solve
|
|
93
|
+
# Solve
|
|
110
94
|
claude-queue --label nightshift
|
|
111
95
|
```
|
|
112
96
|
|
|
@@ -120,64 +104,58 @@ Use TypeScript strict mode.
|
|
|
120
104
|
Never modify files in the src/legacy/ directory.
|
|
121
105
|
```
|
|
122
106
|
|
|
123
|
-
These instructions are appended to the prompt Claude receives for each issue.
|
|
107
|
+
These instructions are appended to the prompt Claude receives for each issue. Useful for project-specific conventions that aren't in `CLAUDE.md`.
|
|
124
108
|
|
|
125
109
|
## How It Works
|
|
126
110
|
|
|
127
|
-
###
|
|
111
|
+
### Preflight
|
|
128
112
|
|
|
129
|
-
Verifies all dependencies
|
|
113
|
+
Verifies all dependencies (`gh`, `claude`, `git`, `jq`), checks that `gh` is authenticated, and ensures the working tree is clean.
|
|
130
114
|
|
|
131
|
-
###
|
|
115
|
+
### Label setup
|
|
132
116
|
|
|
133
117
|
Creates three labels on the repo (skips if they already exist):
|
|
134
118
|
|
|
135
|
-
| Label |
|
|
136
|
-
|
|
137
|
-
| `claude-queue:in-progress` |
|
|
138
|
-
| `claude-queue:solved` |
|
|
139
|
-
| `claude-queue:failed` |
|
|
140
|
-
|
|
141
|
-
These labels let you see at a glance which issues were handled and what the outcome was.
|
|
119
|
+
| Label | Meaning |
|
|
120
|
+
|-------|---------|
|
|
121
|
+
| `claude-queue:in-progress` | Currently being worked on |
|
|
122
|
+
| `claude-queue:solved` | Successfully fixed |
|
|
123
|
+
| `claude-queue:failed` | Could not be solved after all retries |
|
|
142
124
|
|
|
143
|
-
###
|
|
125
|
+
### Branching
|
|
144
126
|
|
|
145
|
-
Creates a
|
|
127
|
+
Creates a branch `claude-queue/YYYY-MM-DD` off your default branch. All fixes go into this one branch. If the branch already exists, a timestamp suffix is added.
|
|
146
128
|
|
|
147
|
-
###
|
|
129
|
+
### Issue processing
|
|
148
130
|
|
|
149
131
|
For each open issue (up to 200, oldest first):
|
|
150
132
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
133
|
+
1. **Skip** — issues with any `claude-queue:*` label are skipped. Remove the label to re-process.
|
|
134
|
+
2. **Label** — marks the issue `claude-queue:in-progress`.
|
|
135
|
+
3. **Solve** — launches Claude Code with a prompt to read the issue, explore the codebase, implement a fix, and run tests.
|
|
136
|
+
4. **Evaluate** — if Claude produced file changes, they are committed. If not, the attempt is retried.
|
|
137
|
+
5. **Retry** — on failure, the working tree is reset and Claude gets a fresh context. Up to 3 attempts (configurable with `--max-retries`).
|
|
138
|
+
6. **Result** — marks the issue `claude-queue:solved` or `claude-queue:failed`.
|
|
139
|
+
|
|
140
|
+
Issues are solved sequentially so later fixes build on earlier ones within a single branch.
|
|
141
|
+
|
|
142
|
+
### Review pass
|
|
161
143
|
|
|
162
|
-
|
|
144
|
+
After all issues are processed, Claude does a second pass reviewing all committed changes for bugs, incomplete implementations, and style issues — fixing anything it finds.
|
|
163
145
|
|
|
164
|
-
###
|
|
146
|
+
### Pull request
|
|
165
147
|
|
|
166
|
-
Once
|
|
148
|
+
Once done, the branch is pushed and a PR is opened with:
|
|
167
149
|
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
- **Chain logs** — collapsible per-issue logs showing Claude's full output for each attempt
|
|
150
|
+
- Summary table with solved/failed/skipped counts and run duration
|
|
151
|
+
- Tables of solved and failed issues with links
|
|
152
|
+
- Collapsible per-issue logs showing Claude's full output
|
|
172
153
|
|
|
173
|
-
|
|
154
|
+
No PR is created if nothing was solved.
|
|
174
155
|
|
|
175
|
-
### Interruption
|
|
156
|
+
### Interruption handling
|
|
176
157
|
|
|
177
|
-
If
|
|
178
|
-
- Removes the `claude-queue:in-progress` label from the current issue
|
|
179
|
-
- Marks it as `claude-queue:failed`
|
|
180
|
-
- Prints where your commits and logs are so nothing is lost
|
|
158
|
+
If interrupted (Ctrl+C, SIGTERM), the script removes the `claude-queue:in-progress` label from the current issue, marks it as failed, and prints where your commits and logs are.
|
|
181
159
|
|
|
182
160
|
## Logs
|
|
183
161
|
|
|
@@ -190,7 +168,7 @@ Full logs for each run are saved to `/tmp/claude-queue-DATE-TIMESTAMP/`:
|
|
|
190
168
|
├── issue-42-attempt-2.log # Raw Claude output, attempt 2
|
|
191
169
|
├── issue-57.md
|
|
192
170
|
├── issue-57-attempt-1.log
|
|
193
|
-
└── pr-body.md #
|
|
171
|
+
└── pr-body.md # Generated PR description
|
|
194
172
|
```
|
|
195
173
|
|
|
196
174
|
## License
|
package/claude-queue.sh
CHANGED
|
@@ -49,6 +49,7 @@ declare -a SOLVED_ISSUES=()
|
|
|
49
49
|
declare -a FAILED_ISSUES=()
|
|
50
50
|
declare -a SKIPPED_ISSUES=()
|
|
51
51
|
CURRENT_ISSUE=""
|
|
52
|
+
CHILD_PID=""
|
|
52
53
|
START_TIME=$(date +%s)
|
|
53
54
|
|
|
54
55
|
show_help() {
|
|
@@ -108,6 +109,17 @@ cleanup() {
|
|
|
108
109
|
log "Logs saved to: ${LOG_DIR}"
|
|
109
110
|
fi
|
|
110
111
|
}
|
|
112
|
+
|
|
113
|
+
handle_interrupt() {
|
|
114
|
+
if [ -n "$CHILD_PID" ] && kill -0 "$CHILD_PID" 2>/dev/null; then
|
|
115
|
+
kill -TERM "$CHILD_PID" 2>/dev/null || true
|
|
116
|
+
wait "$CHILD_PID" 2>/dev/null || true
|
|
117
|
+
fi
|
|
118
|
+
CHILD_PID=""
|
|
119
|
+
exit 130
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
trap handle_interrupt INT TERM
|
|
111
123
|
trap cleanup EXIT
|
|
112
124
|
|
|
113
125
|
preflight() {
|
|
@@ -267,7 +279,10 @@ description of what you changed and why."
|
|
|
267
279
|
--dangerously-skip-permissions \
|
|
268
280
|
--max-turns "$MAX_TURNS" \
|
|
269
281
|
$MODEL_FLAG \
|
|
270
|
-
> "$attempt_log" 2>&1
|
|
282
|
+
> "$attempt_log" 2>&1 &
|
|
283
|
+
CHILD_PID=$!
|
|
284
|
+
wait "$CHILD_PID" || claude_exit=$?
|
|
285
|
+
CHILD_PID=""
|
|
271
286
|
|
|
272
287
|
if [ "$claude_exit" -ne 0 ]; then
|
|
273
288
|
log_warn "Claude exited with code ${claude_exit}"
|
|
@@ -377,7 +392,10 @@ When you are done, output a line that says CLAUDE_QUEUE_REVIEW followed by a bri
|
|
|
377
392
|
--dangerously-skip-permissions \
|
|
378
393
|
--max-turns "$MAX_TURNS" \
|
|
379
394
|
$MODEL_FLAG \
|
|
380
|
-
> "$review_log" 2>&1
|
|
395
|
+
> "$review_log" 2>&1 &
|
|
396
|
+
CHILD_PID=$!
|
|
397
|
+
wait "$CHILD_PID" 2>/dev/null || true
|
|
398
|
+
CHILD_PID=""
|
|
381
399
|
|
|
382
400
|
local changed_files
|
|
383
401
|
changed_files=$(git diff --name-only 2>/dev/null; git ls-files --others --exclude-standard 2>/dev/null)
|