Forced re-login wipes ~/.claude transcripts; concurrent instance deletes a live session's task output files (Windows)

Status Open
Maintainer reply None cached
Activity 0 comments · opened Sep 4, 2026

Summary

Two related problems on Windows 11 (VS Code extension) that between them destroyed a day of context:

  1. Repeated forced re-authentication recreates ~/.claude from scratch, deleting all session transcripts.
  2. A second Claude Code process starting in the same project deletes the running session's background task output files, so tool calls fail with ENOENT.

Environment

  • OS: Windows 11 Enterprise 10.0.26100.8655
  • Claude Code: VS Code native extension
  • Shells in use: PowerShell 7 and Git Bash
  • Model: Opus 5 (1M context)

1. Forced re-login wipes ~/.claude

I have had to sign in at least 4 times today. Each re-login appears to recreate ~/.claude from scratch rather than reusing the existing directory.

Observed in one single session, roughly 10 minutes apart:

~/.claude/.credentials.json   mtime 05:53   ->   rewritten 06:01 (mid-conversation)
~/.claude/projects/           mtime 05:53   ->   recreated 06:01
~/.claude/projects/<project>/ *.jsonl       ->   empty again after the 06:01 re-login

Consequences:

  • All transcripts from previous days are gone. Yesterday's long planning conversation is unrecoverable.
  • ~/.claude.json contains no history key for any project, so there is no prompt history to fall back on either.
  • The transcript of the currently running conversation disappeared while that conversation was still open.

Expected: re-authentication should refresh credentials only. It must not delete or recreate ~/.claude/projects/** transcripts.

2. A concurrently starting instance deletes another live session's task outputs

Background Bash / PowerShell tool invocations write their output to:

%LOCALAPPDATA%\Temp\claude\<project-slug>\<session-id>\tasks\<task-id>.output

With a second Claude Code process starting in the same project, these files are deleted while the first session is still running and still waiting on them. Three consecutive test runs failed this way, each with:

<bash output unavailable: output file
 C:\Users\<user>\AppData\Local\Temp\claude\<project-slug>\<session-id>\tasks\<task-id>.output
 could not be read (ENOENT). This usually means another Claude Code process in
 the same project deleted it during startup cleanup.>

Directory listing afterwards showed only the newest .output file present; the three earlier ones for that same live session had been removed.

Expected: startup cleanup must scope itself to its own session directory (or to sessions with no live process). It must not delete files belonging to another running session, especially not files a tool call is actively waiting on.

Impact

The two combined mean long-running work cannot be trusted to survive: context is lost on re-login, and in-flight tool results are lost when another instance starts. Exit codes are also masked, since a failed read surfaces instead of the command's real output.

View original on GitHub ↗