[BUG] Remove Worktree - Conversations Are Gone!
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bug Description
Lost two Claude Code session conversations when git worktree directories were removed. The session metadata still exists but shows "Folder no longer exists" and conversation history is inaccessible.
Steps to Reproduce
- Claude Code creates git worktree (auto-generated names like "sharp-elgamal")
- Work in that session, create commits
- Remove the worktree directory with
git worktree remove - Return to Claude Code - session shows "Folder no longer exists" and is gone
Expected Behavior
Conversation history should be preserved independently of working directory. Sessions should be:
- Readable even if directory doesn't exist
- Remappable to a new directory
- Or archived but accessible
Actual Behavior
Session completely inaccessible. Metadata exists in:~/Library/Application Support/Claude/claude-code-sessions/
But UI cannot access the conversation.
Impact
Lost critical development conversation history including architectural decisions and implementation details.
Additional Context
- macOS (Darwin 25.2.0)
- Session metadata shows lastActivityAt timestamp but conversation is gone
- This violates user expectation that conversation history is durable
What Should Happen?
Worktree is a pain for me as a single developer. I don't need it. I specified this in my CLAUDE.md, but Claude Code (CC) snuck it in. When it was time to commit, we had to merge from worktree to repo (unnecessary risks). CC then advised me I could remove the worktree now. Which I did.
IT SHOULD NOT HAVE DELETED THE CONVERSATION HISTORY FOR ALL SESSIONS. THAT IS A DISASTER!
Error Messages/Logs
Steps to Reproduce
See main file above
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.7
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗