[BUG] Uncommitted changes in an "additional working directory" disappear from disk after /clear / starting a new session (Claude Desktop)

Status Fixed / completed
Reported on v2.1.219
Maintainer reply None cached
Activity 1 comment · opened Jul 30, 2026 · closed Jul 30, 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?

After running /clear (or ending one session and starting a new one) in the Claude Desktop app, files that had already been written to disk by the Edit/Write tools in the previous session — but not yet git committed — disappeared from disk by the time the new session started.

This happened specifically to a secondary project directory configured as an "additional working directory" of the primary session (not the session's main cwd). No destructive command (rm, git clean, git reset, git checkout) appears anywhere in either session's tool-call history, and no manual editor action was taken.

What Should Happen?

Uncommitted changes saved to disk in additional working directories should persist across session boundaries (/clear or starting a new session), exactly like changes in the primary session cwd.

Error Messages/Logs

No error messages were shown in the UI.

Session A JSONL: df4d0612-6915-4f3f-97b3-120f3a12d228
Session B JSONL: 4048026a-0b7b-4ad6-abce-7b563f2e471c

Verification via git status inside secondary dir (D:\mongdol-react):
At 10:04:46Z (Session A):
M src/App.jsx
M src/components/ArcadeHubScreen.jsx
M src/style.css
?? public/game-assets/sounds/mongbyte/
?? src/components/MongbyteGame.jsx
?? src/game/mongbyteGame.js

At 10:28:33Z (Session B, post-/clear):
git status returned completely clean (all edits lost).

Steps to Reproduce

  1. Open a primary project in Claude Desktop (e.g., D:\mongdol-backend).
  1. Configure a secondary project directory as an "additional working directory" (e.g., D:\mongdol-react).
  1. Ask Claude to edit/create files in the additional working directory via Write/Edit tools without running git commit.
  1. Run /clear (or end the session and start a new session).
  1. In the new session, run git status inside the additional working directory.
  1. Observe that all uncommitted edits made in step 3 have disappeared from disk.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.219

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

What we ruled out
Git-level revert: No git clean/reset/checkout/stash commands in tool logs. Reflog shows branch never moved.

Manual user action: No editor UI revert used.

Local history: Checked VS Code / Cursor local history; affected files were written purely by Claude tools.

Cloud sync / Antivirus: Directories are not in cloud sync (OneDrive/Dropbox) and no antivirus quarantine occurred.

Recovery & Evidence
By replaying Write/Edit tool calls from Session A's JSONL transcript, the exact lost state was reconstructed. Every single Edit's old_string matched pre-edit disk state, proving files were written to disk during Session A and subsequently reverted.

Suspected Mechanism
Client-side session resetting (/clear) in Claude Desktop appears to restore/rewind directory snapshots at session boundaries, but fails to handle or incorrectly wipes uncommitted state in secondary "additional working directories".

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗