[BUG] Read refuses any path containing a backslash: "its symlink resolution changed after permission was checked"
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 Linux, Read refuses every file whose path contains a backslash, even a plain regular file that is not a symlink:
Refusing to read /tmp/x/a\x2db.txt: its symlink resolution changed after permission was checked (its real path can no longer be determined). If a link in the working directory is being rewritten concurrently, stop that and retry.
Backslash is a valid filename character on Linux, and systemd escapes - in unit names as \x2d, so every mount or automount unit for a path with a dash looks like mnt-foo\x2dbar.mount. Write creates such a file fine, but after that the file can't be read, and since Edit and overwriting Write need a prior Read, it can't be edited either. The only way left is shell commands.
It looks like the path is normalized with \ treated as a separator somewhere between the permission check and the real-path check, so the two never match.
What Should Happen?
On POSIX platforms a backslash in a path is an ordinary character: Read, Edit and Write should work on mnt-foo\x2dbar.mount like on any other file.
Steps to Reproduce
mkdir -p /tmp/x && printf 'x\n' > '/tmp/x/a\x2db.txt'- Ask Claude to read
/tmp/x/a\x2db.txtwith the Read tool. - Read fails with the message above.
ls -lashows a regular file, no symlinks anywhere in the path.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Claude Code Version
2.1.284 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other