[BUG] Claude commands fail with EACCES permission denied error when creating files

Resolved 💬 3 comments Opened Apr 16, 2026 by asperpharma Closed May 27, 2026

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?

When I run a Claude command like claude "create a new Python file" or claude "add type hints to test.py", Claude shows an error "EACCES: permission denied" and the file isn't created.

The command fails immediately after accepting the file write permission prompt. The error occurs consistently across multiple commands that involve file creation or modification.

What Should Happen?

Claude should execute the command successfully and create or modify the Python file without any permission errors. The file write operation should complete after the user accepts the permission prompt.

Error Messages/Logs

Error: EACCES: permission denied, open '/path/to/project/test.py'
    at Object.openSync (node:fs:601:3)
    at Object.writeFileSync (node:fs:2249:35)
    at ClaudeCode.writeFile (/usr/local/lib/node_modules/@anthropic-ai/claude-code/dist/index.js:123:10)
    at async ClaudeCode.executeCommand (/usr/local/lib/node_modules/@anthropic-ai/claude-code/dist/index.js:456:5)

Steps to Reproduce

  1. Create a new project directory: mkdir my-project && cd my-project
  2. Run a Claude command: claude "create a Python file called hello.py that prints Hello World"
  3. When prompted for file write access, accept/allow the permission
  4. Observe the error: "EACCES: permission denied"
  5. The file hello.py is not created in the directory

Note: This also happens with commands that modify existing files, e.g., claude "add type hints to existing_file.py"

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

1.0.100

Claude Code Version

1.0.123 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗