[BUG] Claude crashes when loading .env/.env.local/.env.development on Linux 4.x kernels
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?
Environment:
- OS: Linux 4.4.0-146-generic (Ubuntu 16.04)
- Claude Version: 2.0.42
- Kernel: 4.4.0-146-generic
Issue:
Claude crashes with exit code 1 (no error message) when loading these files at startup:
.env.env.local.env.development
Root Cause:
Claude calls syscall 332 (fsconfig) when loading these files, which returns ENOSYS on
Linux 4.x kernels. syscall 332 was added in Linux 5.1+.
Strace Log:
openat(AT_FDCWD, ".env", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 13
syscall_332(0xd, ...) = -1 (errno 38: ENOSYS)
exit_group(1)
What Should Happen?
When .env/.env.local/.env.development files exist:
- Claude should detect that syscall 332 is unavailable (ENOSYS)
- Skip the fsconfig call and use standard file reading methods (open + read)
- Continue execution normally
- Display the help message when running
claude -h
The program should work correctly regardless of kernel version, either by using fallback methods
or by gracefully handling unsupported syscalls.
Error Messages/Logs
Steps to Reproduce
- Check your kernel version (must be Linux 4.x or earlier):
``bash``
uname -r
# Output: 4.4.0-146-generic (or any 4.x kernel)
- Create a test directory:
``bash``
mkdir /tmp/claude-test
cd /tmp/claude-test
- Create a
.envfile (content doesn't matter):
``bash``
touch .env
# or with content:
echo "TEST=value" > .env
- Try to run Claude Code:
``bash``
claude -h
# Expected: Show help message
# Actual: No output, process exits with code 1
- Verify with strace:
``bash``
strace claude -h 2>&1 | tail -5
# You will see:
# openat(AT_FDCWD, ".env", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 13
# syscall_332(...) = -1 (errno 38)
# exit_group(1)
- Remove the
.envfile and verify Claude works:
``bash``
rm .env
claude -h
# Now it works correctly and shows help message
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.42 (Claude Code)
Platform
Other
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗