[BUG] Write tool creates directories with incorrect permissions (doesn't inherit from parent)

Status Fixed / completed
Maintainer reply ✓ Yes — whyuan-cc
Activity 5 comments · opened Nov 19, 2025 · closed Dec 30, 2025
💡 Likely answer: A maintainer (whyuan-cc, contributor) responded on this thread — see the highlighted reply below.

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?

The Write tool creates new files and directories with default permissions (755 for
directories, 644 for files) instead of inheriting permissions from the parent directory.

This seems to be a new problem. Ive made a point to make sure new files get the right permissions and this happens correctly if creating files with my IDE or any other tool. But Claude code has recently been creating files with specific permissions that do not work for my applications.

What Should Happen?

It should just create files with the defaults assigned by the file system.

When creating files/directories in a parent with specific permissions and setgid bit, the
new files should inherit:

  • The parent's group ownership (via setgid)
  • Similar permission modes as sibling files/directories
  • Any ACLs set on the parent directory

Error Messages/Logs

No errors, just the constant annoyance of having to fix permissions for every file and folder Claude code creates.

Steps to Reproduce

  1. Create a test directory with setgid bit and restrictive permissions:

``bash
mkdir -p /tmp/test-permissions/parent
chmod 2770 /tmp/test-permissions/parent
chgrp www-data /tmp/test-permissions/parent
``

  1. Verify the parent directory has correct permissions:

``bash
ls -la /tmp/test-permissions/
# Should show: drwxrws--- ... www-data ... parent
``

  1. Manually create a subdirectory to confirm inheritance works:

``bash
mkdir /tmp/test-permissions/parent/manual-dir
ls -la /tmp/test-permissions/parent/
# Should show: drwxrws--- ... www-data ... manual-dir (inherits correctly)
``

  1. Ask Claude Code to create a file in the parent directory:

``
"Please create a file at /tmp/test-permissions/parent/test.txt with the content 'test'"
``

  1. Ask Claude Code to create a directory:

``
"Please create a directory at /tmp/test-permissions/parent/claude-dir/"
``

  1. Check the permissions of files created by Claude:

``bash
ls -la /tmp/test-permissions/parent/
# Claude-created file shows: -rw-r--r-- (644 - wrong, should be 660)
# Claude-created dir shows: drwxr-xr-x (755 - wrong, should be 2770)
``

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.45 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Jetbrains ide terminal.

Additional Information

_No response_

View original on GitHub ↗

5 Comments

em · 9 months ago

Why did the anthropic team not immediately rollback critically broken claude-code with such a catastrophic bug?

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

LeoWare · 8 months ago

Hi. This issue is still occurring with v2.0.76

whyuan-cc contributor · 8 months ago

This issue has been fixed in PR anthropics/claude-cli-internal#12383 (commit 80e16ef323).

The fix removes hardcoded permissions (0o600 for files, 0o700 for directories) and now respects the system umask for user-created files. With umask 022, files will now be created with 644 permissions (-rw-r--r--) instead of 600 (-rw-------).

The fix has been merged and will be available in the next release.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.