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 CHANGED
@@ -1,10 +1,10 @@
1
1
  # claude-queue
2
2
 
3
- Automated GitHub issue solver & creator. Create well-structured issues from a text dump or interactive interview, then let Claude Code solve them overnight.
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 has two modes:
6
- - **Solve** (default) — fetches open issues, uses [Claude Code](https://docs.anthropic.com/en/docs/claude-code) to solve each one, and opens a pull request
7
- - **Create**decomposes a description into well-structured GitHub issues, either from inline text or via an interactive interview
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 with npx:
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 (prevents runaway sessions) |
43
- | `--label LABEL` | all issues | Only process issues that have this label |
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 well-structured GitHub issues from a text description or an interactive interview with Claude.
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
- In all modes, Claude decomposes the input into individual, actionable issues with titles, markdown bodies, and labels (reusing existing repo labels where possible). You get a preview before anything is created.
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
- # Create issues from a text description
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
- # Paste a longer description via stdin
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
- ### Workflow: create then solve
85
+ ### Create then solve workflow
102
86
 
103
- The `--label` flag on both commands lets you create a workflow where `create` plans the issues and bare `claude-queue` solves them:
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: create issues tagged "nightshift"
90
+ # Plan
107
91
  claude-queue create --label nightshift "Add dark mode and fix the login bug"
108
92
 
109
- # Solve: only process those issues
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. This is useful for project-specific conventions that aren't captured in `CLAUDE.md`.
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
- ### 1. Preflight
111
+ ### Preflight
128
112
 
129
- Verifies all dependencies are available (`gh`, `claude`, `git`, `jq`), checks that `gh` is authenticated, and ensures the git working tree is clean. Aborts immediately if anything is missing.
113
+ Verifies all dependencies (`gh`, `claude`, `git`, `jq`), checks that `gh` is authenticated, and ensures the working tree is clean.
130
114
 
131
- ### 2. Label Setup
115
+ ### Label setup
132
116
 
133
117
  Creates three labels on the repo (skips if they already exist):
134
118
 
135
- | Label | Color | Meaning |
136
- |-------|-------|---------|
137
- | `claude-queue:in-progress` | Yellow | Currently being worked on |
138
- | `claude-queue:solved` | Green | Successfully fixed |
139
- | `claude-queue:failed` | Red | Could not be solved after all retries |
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
- ### 3. Branch
125
+ ### Branching
144
126
 
145
- Creates a single branch `claude-queue/YYYY-MM-DD` off your default branch. All fixes for the night go into this one branch. If the branch already exists (e.g. from a previous run), a timestamp suffix is added.
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
- ### 4. Issue Processing
129
+ ### Issue processing
148
130
 
149
131
  For each open issue (up to 200, oldest first):
150
132
 
151
- - **Skip check** — issues that already have any `claude-queue:*` label are skipped. Remove the label to re-process.
152
- - **Label** — marks the issue `claude-queue:in-progress`
153
- - **Solve** — launches a fresh Claude Code process (`claude -p`) with a prompt that tells it to:
154
- - Read the issue via `gh issue view`
155
- - Explore the codebase
156
- - Implement a fix
157
- - Run existing tests
158
- - **Evaluate** if Claude produced file changes, they are committed. If not, the attempt is retried.
159
- - **Retry** — on failure, the working tree is reset to the last checkpoint (`git reset --hard`) and Claude gets a completely fresh context. Up to 3 attempts per issue (configurable with `--max-retries`).
160
- - **Label result** — marks the issue `claude-queue:solved` or `claude-queue:failed`
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
- Each issue is solved sequentially so later fixes build on top of earlier onesall in a single branch.
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
- ### 5. Pull Request
146
+ ### Pull request
165
147
 
166
- Once all issues are processed, the branch is pushed and a PR is opened with:
148
+ Once done, the branch is pushed and a PR is opened with:
167
149
 
168
- - **Summary table** solved/failed/skipped counts and run duration
169
- - **Solved issues** table of all issues that were fixed with links
170
- - **Failed issues** table of issues that couldn't be solved
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
- If no issues were solved, no PR is created.
154
+ No PR is created if nothing was solved.
174
155
 
175
- ### Interruption Handling
156
+ ### Interruption handling
176
157
 
177
- If the script is interrupted (Ctrl+C, SIGTERM), it:
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 # The generated PR description
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 || claude_exit=$?
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 || true
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-queue",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Automated GitHub issue solver powered by Claude Code",
5
5
  "bin": {
6
6
  "claude-queue": "./claude-queue.sh"