[BUG] tasks/ directory not created automatically on Windows (v2.1.53)
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?
All Bash/shell tool calls fail with EINVAL because the tasks/ subdirectory inside the project temp folder is never created automatically.
What Should Happen?
Claude Code should create the tasks/ directory automatically on startup, so that Bash tool outputs can be written to disk.
Error Messages/Logs
EINVAL: invalid argument, open 'C:\Users\<user>\AppData\Local\Temp\claude\<project>\tasks\<id>.output'
Steps to Reproduce
- Install Claude Code 2.1.53 natively on Windows
- Open any project (e.g. C:\Users\<user>\Documents\<project>)
- Ask Claude to run any Bash command (e.g.
echo "test") - EINVAL error appears immediately — the tasks/ directory doesn't exist
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.44
Claude Code Version
2.1.53
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
The tasks/ directory can be created manually and file creation works fine:
New-Item "C:\Users\<user>\AppData\Local\Temp\claude\<project>\tasks\test.txt" → succeeds
This means it's not a permissions issue. Even with the directory present and writable, Claude Code still fails with the same EINVAL error. The bug is internal to Claude Code itself — likely in how Node.js opens/writes the output file on Windows (invalid flags or path handling issue).
The root cause is therefore not the missing directory, but something deeper in the Bash tool output writing mechanism on Windows.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗