[BUG] `--worktree` flag: Claude freezes at "Removing worktree…" on exit

Resolved 💬 3 comments Opened Mar 11, 2026 by sakaritoru Closed Mar 14, 2026

Bug description

When exiting a Claude Code session started with the --worktree flag, the process hangs indefinitely at the "✻ Removing worktree…" step. It never completes and requires a force kill (Ctrl+C or kill the process) to exit.

Steps to reproduce

  1. Start Claude Code with claude --worktree in a git repository
  2. Perform some work in the session
  3. Exit the session (e.g., /exit or Ctrl+C)
  4. Observe the output freezes at:

``
✻ Removing worktree…
``

  1. The process never returns to the shell

Expected behavior

The worktree should be cleaned up and the process should exit normally.

Environment

  • Claude Code version: 2.1.72
  • OS: macOS 26.2 (Darwin 25.2.0)
  • Shell: zsh

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗