What
Claude Code can write and run small scripts that call its tools. In a file path, ~ is shorthand for your home folder. Claude Code now checks how scripts use it:
- A script that passes
~without typing it directly into the script gets the warning "~ was read as a folder in the working directory." - A write to a path that still contains an unexpanded
~, or that starts with spaces, is refused with "Nothing was written: ~ isn't expanded in this path."
To point at the home folder, the script should start the path with text typed into the script itself, such as '~/'.
Why
Without this check, a script could create a folder actually named ~ inside your project folder and write files there, rather than writing into your home folder as intended.