[BUG] CRITICAL ISSUE BRIEF: Workspace Corruption & Session Bleed

Resolved 💬 5 comments Opened Feb 26, 2026 by azharmateen Closed Mar 26, 2026

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?

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_

View original on GitHub ↗

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