Mac app creating a new git worktree for every new chat session
Resolved 💬 3 comments Opened May 12, 2026 by boog70 Closed May 15, 2026
Description
The macOS Claude Code app repeatedly created a new git worktree on every new chat session, resulting in 6 worktree directories and 9 orphaned claude/* branches, none of which contained any meaningful work. The worktrees appeared to be created at session start rather than in response to any explicit task that would require isolation.
Steps to reproduce
- Open a project in the macOS Claude Code app
- Open multiple new chat sessions (or the app glitches during session init)
- Each session creates a new
.claude/worktrees/<name>/directory and a correspondingclaude/<name>branch
Observed behavior
After the glitch, the project had:
- 6 directories under
.claude/worktrees/(e.g.cranky-varahamihira-f5d379,epic-meitner-6b0ee1,frosty-kepler-772e5c,quirky-mirzakhani-e5ba24,upbeat-sinoussi,vibrant-robinson-119b4a) - 9
claude/*local branches, all pointing to the same commit asmainor within 1-2 commits - Two of the directories were not even registered in
git worktree list(fully orphaned) - None of the worktrees contained work that wasn't already reflected in the main working tree
Expected behavior
Worktrees should only be created when a task explicitly requires isolation, not on every new chat open.
Environment
- Claude Code version: 2.1.139
- Platform: macOS (Darwin 25.4.0)
- Invocation: macOS desktop app
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗