claude-issue-solver 1.39.1 → 1.40.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.
@@ -135,10 +135,28 @@ echo ""
135
135
 
136
136
  # Remove worktree (need to cd out first)
137
137
  cd "${projectRoot}"
138
+
139
+ # Try git worktree remove first
138
140
  git worktree remove "${worktreePath}" --force 2>/dev/null
139
141
 
140
- echo "✅ Worktree removed. Branch '${branchName}' preserved on remote."
141
- echo " Fetch it in main repo: git fetch origin ${branchName}"
142
+ # If folder still exists, force delete it
143
+ if [ -d "${worktreePath}" ]; then
144
+ echo "Git worktree remove didn't fully clean up, force deleting..."
145
+ /bin/rm -rf "${worktreePath}" 2>/dev/null || rm -rf "${worktreePath}" 2>/dev/null
146
+ fi
147
+
148
+ # Prune any stale worktree references
149
+ git worktree prune 2>/dev/null
150
+
151
+ # Verify cleanup
152
+ if [ -d "${worktreePath}" ]; then
153
+ echo "⚠️ Could not fully remove worktree. You may need to manually delete:"
154
+ echo " rm -rf '${worktreePath}'"
155
+ else
156
+ echo "✅ Worktree removed. Branch '${branchName}' preserved on remote."
157
+ echo " Fetch it in main repo: git fetch origin ${branchName}"
158
+ fi
159
+
142
160
  echo ""
143
161
  echo "Terminal will close in 3 seconds..."
144
162
  sleep 3
@@ -156,8 +174,8 @@ exit 0
156
174
  const interactiveEnding = `
157
175
  echo ""
158
176
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
159
- echo "Claude session ended. Terminal staying open."
160
- echo "To clean up after merge: claude-issue clean ${issueNumber}"
177
+ echo "Claude session ended. Terminal staying open (--keep mode)."
178
+ echo "To clean up: claude-issue clean ${issueNumber}"
161
179
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
162
180
  echo ""
163
181
 
@@ -165,8 +183,8 @@ echo ""
165
183
  exec bash --norc --noprofile
166
184
  `;
167
185
  const modeMessage = autoClose
168
- ? 'Terminal will close after PR is created.'
169
- : 'The terminal stays open for follow-up changes.';
186
+ ? 'Worktree will be cleaned up after session ends.'
187
+ : 'Terminal and worktree will stay open (--keep mode).';
170
188
  const runnerContent = `#!/bin/bash
171
189
  cd "${worktreePath}"
172
190
 
package/dist/index.js CHANGED
@@ -52,18 +52,19 @@ program.hook('preAction', (thisCommand) => {
52
52
  // Default command - interactive selection
53
53
  program
54
54
  .argument('[issue]', 'Issue number to solve')
55
- .option('-c, --auto-close', 'Close terminal and clean up worktree after PR is created')
55
+ .option('-k, --keep', 'Keep terminal and worktree open after PR is created (default: auto-close)')
56
56
  .action(async (issue, options) => {
57
+ const solveOptions = { autoClose: !options.keep };
57
58
  if (issue) {
58
59
  const issueNumber = parseInt(issue, 10);
59
60
  if (isNaN(issueNumber)) {
60
61
  console.log(chalk_1.default.red(`❌ Invalid issue number: ${issue}`));
61
62
  process.exit(1);
62
63
  }
63
- await (0, solve_1.solveCommand)(issueNumber, { autoClose: options.autoClose });
64
+ await (0, solve_1.solveCommand)(issueNumber, solveOptions);
64
65
  }
65
66
  else {
66
- await (0, select_1.selectCommand)(options);
67
+ await (0, select_1.selectCommand)(solveOptions);
67
68
  }
68
69
  });
69
70
  // List command
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-issue-solver",
3
- "version": "1.39.1",
3
+ "version": "1.40.0",
4
4
  "description": "Automatically solve GitHub issues using Claude Code",
5
5
  "main": "dist/index.js",
6
6
  "bin": {