[BUG] macOS EPERM on Node.js fs.open()
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?
amacOS returns EPERM on Node.js fs.open() for dotfiles in user home directory despite correct permissions
Summary:
On macOS Tahoe 26.2, Node.js applications intermittently receive EPERM errors when attempting to open or create dotfiles in a user’s home directory (e.g. ~/.claude.json). This occurs even when permissions, ownership, ACLs, and FileVault state are correct, and reproduces on a freshly created admin user.
Environment:
- macOS: Tahoe 26.2
- Hardware: Apple M3 Pro
- File System: APFS
- FileVault: Enabled
- Node.js: v25.2.1
- Shell: zsh
- User Account: Fresh local admin (no Migration Assistant)
Steps to Reproduce:
- Create a new local admin user in System Settings.
- Log in as that user.
- Install Node.js (e.g. via Homebrew).
- Verify home directory permissions:
ls -ldOe $HOME
Result shows no ACLs and standard permissions.
- Confirm atomic writes work via shell:
echo test > ~/.atomic_test.tmp
mv ~/.atomic_test.tmp ~/.atomic_test
rm ~/.atomic_test
- Run a Node.js tool that writes a dotfile using fs.writeFileSync.
Expected Result:
The dotfile is created successfully.
Actual Result:
Node.js throws:
EPERM: operation not permitted, open '~/.tool.json'
Impact:
Breaks Node.js-based developer tools that rely on writing configuration files to the user home directory.
Notes:
- Reproduces on clean admin users.
- Not resolved by diskutil resetUserPermissions.
- Not caused by ACLs, ownership, or FileVault.
- Appears related to macOS security/TCC behavior.
Request:
Please investigate why Node.js fs.open()/fs.writeFileSync receives EPERM on dotfiles in $HOME under normal macOS configurations.
What Should Happen?
file shall be updated instead of failing the write
<img width="749" height="587" alt="Image" src="https://github.com/user-attachments/assets/cc91cca1-4091-4983-867b-d6577b0d77ea" />
Error Messages/Logs
File shall be written and application start
Steps to Reproduce
included in whats wrong
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.1 Claude Code
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗