claude-code - 💡(How to fix) Fix [FEATURE] make `claude agents` not launch agents with worktrees by default

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

This "workaround" is ok but still very awkward

Code Example

SessionStart hook (auto) (Recommended)
     Wire a sweep script into ~/.claude/settings.json SessionStart so every new Claude Code session prunes stale worktree-* branches whose
     commits are already in HEAD/origin. Set-and-forget; works across all projects.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When trying to use claude agents dashboard, all agents launched use awkward worktrees which

  1. Adds an extra step to merge back into actual working branch (ask it to commit/merge back)
  2. Sometimes adds 2-3 more unnecessary (or even empty) branches when working within an agent session
  3. When trying to delete (ctrl+x) a session the worktree does not get deleted automatically leaving a lot of branches/worktrees for manual cleanup

Proposed Solution

Add a .claude/settings.json option or dashboard ui option to disable worktree launch when starting a task inside claude agents

Alternative Solutions

This "workaround" is ok but still very awkward

SessionStart hook (auto) (Recommended)
     Wire a sweep script into ~/.claude/settings.json SessionStart so every new Claude Code session prunes stale worktree-* branches whose
     commits are already in HEAD/origin. Set-and-forget; works across all projects.

Priority

High - Significant impact on productivity

Feature Category

Configuration and settings

Use Case Example

No response

Additional Context

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] make `claude agents` not launch agents with worktrees by default