File reads are now hardened against symlink-swap race conditions
A new internal function, boundRead, is used for file reads. It resolves a file's real path first, then opens it using flags that refuse to follow symlinks (O_NOFOLLOW on Linux, F_NOFOLLOW_ANY on macOS), and on Linux also double-checks /proc/self/fd to confirm the opened file matches the expected path. If a symlink (a file that points to another location) is found along the way, or the opened file doesn't match what was expected, the read is refused and a warning is shown.
This protects against a class of security bug sometimes called TOCTOU (time-of-check-to-time-of-use), where a file is swapped for a symlink to a different, unintended file between the moment Claude Code checks it and the moment it actually reads it.