Every Bash tool call fails on Windows with claude-XXXX-cwd: No such file or directory

Resolved 💬 3 comments Opened Apr 16, 2026 by slootsky-oleg Closed Apr 20, 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?

On Windows, every Bash tool call exits 1 because the shell wrapper's epilogue references a CWD-persist file
($TEMP/claude-XXXX-cwd) that the wrapper never creates. The wrapped command itself runs — its output reaches stderr —
but the CLI reports the tool call as failed. This also breaks any slash command that uses ! shell-eval in its markdown
frontmatter (e.g. /commit-message), which aborts before the model turn starts because the ! command's exit code is
non-zero.

What Should Happen?

Bash tool calls should exit with the wrapped command's actual exit code (0 for echo "test", etc.), and ! frontmatter
shell-evals should succeed and feed their output into the slash-command context.

Error Messages/Logs

Exit code 1
  test
  /cygdrive/q/Projects/bks.ges.services
  /usr/bin/bash: line 1: /c/Users/OLEGSL~1/AppData/Local/Temp/claude-99a2-cwd: No such file or directory

  Relevant debug log lines appearing for every Bash call:

  [DEBUG] Session environment not yet supported on Windows
  [DEBUG] Spawning shell without login (-l flag skipped)
  [DEBUG] Bash tool error (828ms): Shell command failed
  [DEBUG] Permission suggestions for Bash: [... "//c/Users/Xxxx~1/AppData/Local/Temp//**" ...]
  [DEBUG] Permission suggestions for Bash: [... "//c/Users/XxxYyyy/AppData/Local/Temp//**" ...]

  Note the path-casing inconsistency — short name Xxxx~1 in some suggestions, long name XxxYyyy in others, within
   the same session.

Steps to Reproduce

On Windows with 8.3 short names enabled on C: and a project on a Dev Drive (Q:):

  1. Start claude --debug in the project dir.
  2. Invoke any Bash tool call — e.g. ask: "run echo test for me". Tool reports exit 1 even though test is printed.
  3. Check $TEMP for claude--cwd files: Get-ChildItem $env:TEMP -Filter 'claude--cwd' returns nothing. A fresh random

suffix is referenced on each call (99a2, 10ff, 0568, e0ef, b38c, c003, ... observed in one session) but no file is
ever written.

  1. Verify it's not antivirus: manually write a file at $TEMP/claude-test-cwd — it survives. Defender (RTP on, Tamper

Protected) does not delete it.

  1. Run any slash command that uses ! in frontmatter (e.g. a custom command, which has !git branch --show-current) —

command aborts with "Shell command failed" before the model turn starts.

Persists across claude --debug restart.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.110

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

  • Windows 11 Enterprise 10.0.26200
  • Native install at C:\Users\<user>\.local\bin\claude.exe
  • Project dir on a Windows Dev Drive (Q:\Projects\...) — /cygdrive/q/... in bash
  • 8.3 short names enabled on C: (C:\Users\XxxYyyy\ ↔ C:\Users\Xxx~1\)
  • Wrapper shell is /usr/bin/bash (Cygwin)
  • Possibly related: #7918 (Windows Dev Drive file-modification issues)
  • Hypothesis: the CLI computes the CWD-persist file path using one casing (short name) but the actual file write step

uses another (long name) or is being skipped entirely on Windows — consistent with the debug line Session environment
not yet supported on Windows. Can attach full debug log on request.

View original on GitHub ↗

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