Repository navigation
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
The Incident
While using Claude Code v2.1.50 across multiple terminal windows, a command to "restart application" resulted in the immediate disappearance or "emptying" of the project directory. The project files were later discovered at a different absolute path, while the original working directory was reduced to empty "stubs."
What Should Happen?
Potential Root Cause: Multi-Instance Session Bleed
The user was operating three simultaneous terminal windows, each running a separate project. It was observed that:
Command Leakage: Prompts/history entered in Project A’s terminal appeared in Project B’s terminal.
State Collision: The CLI tool appears to use a shared global state or cache (~/.claude/ or similar).
Faulty Path Resolution: When a "restart" or rm command is issued in a multi-instance environment, the tool may lose track of which PID (Process ID) is associated with which absolute path, leading it to execute destructive commands (like clearing a build cache) on the wrong directory or a temporary worktree.
Symptoms to Watch For
Shared History: If you see a prompt you typed in one window appearing in the history (Ctrl+O) of another window.
Path Confusion: Claude starts referencing files in /Users/apple/projects/www/... when you are clearly working in /Users/apple/projects/applications/....
Sudden "No Source Found": After a build or restart command, Claude claims it "couldn't find any app directory" despite you being inside it.
Interim Mitigation for the Community
Avoid Parallel Sessions: Until a fix is issued, try to run only one active Claude Code session at a time for "heavy" operations (restarts, builds, or file deletions).
Check pwd Frequently: If Claude seems confused, verify the path using the pwd tool before allowing it to run any rm or reset commands.
Git is Mandatory: Do not run Claude Code on uncommitted code. If the session bleeds and triggers a reset, your uncommitted work may be lost or moved to an obscure path.
Error Messages/Logs
Steps to Reproduce
Try to work on multiple projects by switching the projects from within the Claude Code CLI, like focus /apple/projects/ .... and then do some work, and after that say "restart application".
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
v2.1.50
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
No response
Activity
github-actions commentedon Feb 26, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
mantrahq502 commentedon Feb 26, 2026
Session bleed — where one session's context contaminates another — is particularly hard to debug because it's invisible during the session itself and only shows up as unexpected behavior downstream.
The structural issue is that Claude Code doesn't maintain strict session isolation at the JSONL level when multiple sessions share an overlapping workspace context. Without hard session boundaries anchored to git state, bleed is essentially a race condition.
Mantra (mantra.gonewx.com) helped me get visibility into this: it anchors each session to a specific git commit, so when I see unexpected context in a session, I can use the session timeline to trace exactly which prior session state could have bled in. It's not a fix for the underlying isolation bug, but it gives you forensic capability to identify and isolate the bleed source.
azharmateen commentedon Feb 26, 2026
The issue is not that multiple sessions are open and one session interferes with another. The real problem is that the entire project folder gets moved to a different location due to confusion in the workspace path—even when it is not in the same directory as the other session.
For example:
/User/apple/projects/applications/projects/project.1, project.2, project.3 … project.30
All of these projects were suddenly moved to an unknown location. After searching, I discovered they had been relocated to:
/User/apple/www/gift/project/...
There was no warning and no indication that this was happening. Thankfully, the projects were not deleted—only moved.
github-actions commentedon Mar 26, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Apr 5, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.