claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Write tool ignores system umask, hardcodes 600 file permissions

Open harshh-jainn opened this issue 3 weeks ago • 1 comments

Bug Description Title: Write tool still ignores umask in version 2.0.75 - creates files with 600 permissions

Description:

Issue

The Write tool continues to ignore the system umask setting and creates files with hardcoded 600 permissions in version 2.0.75, despite issue #12172 being marked as closed.

Environment

  • Claude Code Version: 2.0.75
  • System umask: 0002
  • Expected permissions: 664 (-rw-rw-r--)
  • Actual permissions: 600 (-rw-------)

Reproduction

$ umask
0002
$ claude "Write a file called test.txt with content: test"
$ ls -la test.txt
-rw-------  1 user group  116 Dec 23 05:41 test.txt

Impact

This bug completely breaks multi-user development environments where:
- Multiple users need to collaborate on the same files
- Service accounts (like Claude running as a different user) need to modify files created by developers
- Group-writable permissions are required for team collaboration

Our entire Exocode container is blocked from upgrading because this breaks the two-user security model (dev + exo users).

Issue #12172 Status

Issue #12172 was closed with a workaround using PostToolUse hooks, but the underlying Write tool bug was never actually fixed. The workaround adds complexity and doesn't address the root cause.

Request

Please fix the Write tool to respect the system umask setting instead of hardcoding permissions. This is breaking production multi-user development environments.

Workaround (temporary)

Add this to .claude/settings.json:
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write",
        "hooks": [
          {
            "type": "command",
            "command": "chmod 664 \"$TOOL_INPUT_FILE_PATH\" 2>/dev/null || true"
          }
        ]
      }
    ]
  }
}

This is a band-aid solution that shouldn't be necessary.


**Environment Info**
- Platform: darwin
- Terminal: vscode
- Version: 2.0.75
- Feedback ID: c15d0870-4909-48b0-9404-9f165a3a1108

harshh-jainn avatar Dec 23 '25 05:12 harshh-jainn

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/12172
  2. https://github.com/anthropics/claude-code/issues/14922
  3. https://github.com/anthropics/claude-code/issues/11912

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 23 '25 05:12 github-actions[bot]

This issue has been automatically closed as a duplicate of #12172.

If this is incorrect, please re-open this issue or create a new one.

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 26 '25 09:12 github-actions[bot]