claude-queue 1.3.3 → 1.4.0

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/Makefile ADDED
@@ -0,0 +1,37 @@
1
+ .PHONY: patch minor major publish
2
+
3
+ patch:
4
+ npm version patch --no-git-tag-version
5
+ @echo "Bumped to $$(node -p "require('./package.json').version")"
6
+
7
+ minor:
8
+ npm version minor --no-git-tag-version
9
+ @echo "Bumped to $$(node -p "require('./package.json').version")"
10
+
11
+ major:
12
+ npm version major --no-git-tag-version
13
+ @echo "Bumped to $$(node -p "require('./package.json').version")"
14
+
15
+ publish: patch
16
+ git add -A
17
+ git commit -m "v$$(node -p "require('./package.json').version")"
18
+ git tag "v$$(node -p "require('./package.json').version")"
19
+ npm publish
20
+ git push origin main --tags
21
+ @echo "Published v$$(node -p "require('./package.json').version")"
22
+
23
+ publish-minor: minor
24
+ git add -A
25
+ git commit -m "v$$(node -p "require('./package.json').version")"
26
+ git tag "v$$(node -p "require('./package.json').version")"
27
+ npm publish
28
+ git push origin main --tags
29
+ @echo "Published v$$(node -p "require('./package.json').version")"
30
+
31
+ publish-major: major
32
+ git add -A
33
+ git commit -m "v$$(node -p "require('./package.json').version")"
34
+ git tag "v$$(node -p "require('./package.json').version")"
35
+ npm publish
36
+ git push origin main --tags
37
+ @echo "Published v$$(node -p "require('./package.json').version")"
package/README.md ADDED
@@ -0,0 +1,141 @@
1
+ # claude-queue
2
+
3
+ Automated GitHub issue solver. Queue up issues, let Claude Code solve them, wake up to a PR.
4
+
5
+ claude-queue fetches all open issues from your repo, uses [Claude Code](https://docs.anthropic.com/en/docs/claude-code) to solve each one, and opens a pull request with a summary of what was solved, what failed, and the full changelog.
6
+
7
+ ## Prerequisites
8
+
9
+ - [GitHub CLI](https://cli.github.com/) (`gh`) — authenticated
10
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude`) — installed and configured
11
+ - `git` and `jq`
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ npm install -g claude-queue
17
+ ```
18
+
19
+ Or run directly with npx:
20
+
21
+ ```bash
22
+ npx claude-queue
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ Run from inside any git repository with GitHub issues:
28
+
29
+ ```bash
30
+ claude-queue
31
+ ```
32
+
33
+ ### Options
34
+
35
+ | Flag | Default | Description |
36
+ |------|---------|-------------|
37
+ | `--max-retries N` | `3` | Max retry attempts per issue before marking it failed |
38
+ | `--max-turns N` | `50` | Max Claude Code turns per attempt (prevents runaway sessions) |
39
+ | `--label LABEL` | all issues | Only process issues that have this label |
40
+ | `--model MODEL` | CLI default | Claude model to use (e.g. `claude-sonnet-4-5-20250929`) |
41
+ | `-h, --help` | | Show help |
42
+
43
+ ### Examples
44
+
45
+ ```bash
46
+ # Solve all open issues
47
+ claude-queue
48
+
49
+ # Only solve issues labeled "bug"
50
+ claude-queue --label bug
51
+
52
+ # Use a specific model with more retries
53
+ claude-queue --max-retries 5 --model claude-sonnet-4-5-20250929
54
+ ```
55
+
56
+ ## Configuration
57
+
58
+ Create a `.claude-queue` file in your repo root to add custom instructions to every issue prompt:
59
+
60
+ ```
61
+ Always run `npm test` after making changes.
62
+ Use TypeScript strict mode.
63
+ Never modify files in the src/legacy/ directory.
64
+ ```
65
+
66
+ 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`.
67
+
68
+ ## How It Works
69
+
70
+ ### 1. Preflight
71
+
72
+ 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.
73
+
74
+ ### 2. Label Setup
75
+
76
+ Creates three labels on the repo (skips if they already exist):
77
+
78
+ | Label | Color | Meaning |
79
+ |-------|-------|---------|
80
+ | `claude-queue:in-progress` | Yellow | Currently being worked on |
81
+ | `claude-queue:solved` | Green | Successfully fixed |
82
+ | `claude-queue:failed` | Red | Could not be solved after all retries |
83
+
84
+ These labels let you see at a glance which issues were handled and what the outcome was.
85
+
86
+ ### 3. Branch
87
+
88
+ 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.
89
+
90
+ ### 4. Issue Processing
91
+
92
+ For each open issue (up to 200, oldest first):
93
+
94
+ - **Skip check** — issues that already have any `claude-queue:*` label are skipped. Remove the label to re-process.
95
+ - **Label** — marks the issue `claude-queue:in-progress`
96
+ - **Solve** — launches a fresh Claude Code process (`claude -p`) with a prompt that tells it to:
97
+ - Read the issue via `gh issue view`
98
+ - Explore the codebase
99
+ - Implement a fix
100
+ - Run existing tests
101
+ - **Evaluate** — if Claude produced file changes, they are committed. If not, the attempt is retried.
102
+ - **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`).
103
+ - **Label result** — marks the issue `claude-queue:solved` or `claude-queue:failed`
104
+
105
+ Each issue is solved sequentially so later fixes build on top of earlier ones — all in a single branch.
106
+
107
+ ### 5. Pull Request
108
+
109
+ Once all issues are processed, the branch is pushed and a PR is opened with:
110
+
111
+ - **Summary table** — solved/failed/skipped counts and run duration
112
+ - **Solved issues** — table of all issues that were fixed with links
113
+ - **Failed issues** — table of issues that couldn't be solved
114
+ - **Chain logs** — collapsible per-issue logs showing Claude's full output for each attempt
115
+
116
+ If no issues were solved, no PR is created.
117
+
118
+ ### Interruption Handling
119
+
120
+ If the script is interrupted (Ctrl+C, SIGTERM), it:
121
+ - Removes the `claude-queue:in-progress` label from the current issue
122
+ - Marks it as `claude-queue:failed`
123
+ - Prints where your commits and logs are so nothing is lost
124
+
125
+ ## Logs
126
+
127
+ Full logs for each run are saved to `/tmp/claude-queue-DATE-TIMESTAMP/`:
128
+
129
+ ```
130
+ /tmp/claude-queue-2025-03-15-220530/
131
+ ├── issue-42.md # Combined log for issue #42
132
+ ├── issue-42-attempt-1.log # Raw Claude output, attempt 1
133
+ ├── issue-42-attempt-2.log # Raw Claude output, attempt 2
134
+ ├── issue-57.md
135
+ ├── issue-57-attempt-1.log
136
+ └── pr-body.md # The generated PR description
137
+ ```
138
+
139
+ ## License
140
+
141
+ MIT