Skip to content

Is it safe to delete Claude Code worktrees?

A separate copy of a project that Claude Code made for a session, on its own branch, so parallel work doesn't collide.

Review first

It's your own data, or hard to recreate. Decide item by item.

~/**/.claude/worktrees/*

  • Only when it contains .git
  • Never inside ~/Library, ~/.claude

What it is

Claude Code creates a git worktree in the project's .claude/worktrees folder when a session or a subagent runs in its own worktree, from the desktop app or the command line. Each worktree is a full copy of the project's files with a .git file that points back to the main repository, and it grows as the session installs dependencies and builds, so a project can have its node_modules and build folders once per worktree. Claude Code removes a worktree when a session ends with nothing in it, and keeps it when it holds changes or commits.

If it's removed

Changes in the worktree that you haven't committed are lost with the folder. Commits on the worktree's branch stay in the main repository, which keeps working, and git forgets the missing worktree the next time it tidies up. Sessions that ran in it resume in the folder you start Claude Code from instead.

How it's removed

Moved to the Trash, where you can restore it.

PRO

The free analyzer finds it and explains it. Removing it is Pro, after a review sheet that lists every move and command. It's never checked for you: it waits for your choice.

Sources

Last checked on 14 Oct 2026. Every entry is written and checked by hand; the app and the command-line tool use the same words.