Skip to content

Conversation

@m4nt0de4
Copy link

@m4nt0de4 m4nt0de4 commented Feb 3, 2026

Summary

  • Replaces chmod -R 755 (makes ALL files executable) with granular Linux permissions
  • Directories: 750 (rwxr-x---), files: 640 (rw-r-----), scripts: 750 (rwxr-x---)
  • Uses find -exec ... + instead of \; for better performance

Problem

fixPermissions() in INSTALL.ts runs chmod -R 755 on the entire ~/.claude directory, making every file executable — including JSON configs, markdown files, and YAML. On Linux/WSL, only directories and scripts should have the execute bit. This is both a security issue (unnecessary execute permissions) and breaks expectations for standard Linux file permissions.

The function also runs chmod -R 755 three times (steps 1, 3, and the script step), which is redundant.

Fix

Replace the three-step chmod/chown/chmod approach with:

  1. chown -R — set ownership first
  2. find -type d -exec chmod 750 — directories only
  3. find -type f -exec chmod 640 — regular files (no execute)
  4. find -type f -name "*.ts|*.sh|*.py" -exec chmod 750 — scripts only

Test plan

  • Run INSTALL.ts on Linux/WSL
  • Verify .ts and .sh files have execute permission (750)
  • Verify .json, .md, .yaml files do NOT have execute permission (640)
  • Verify directories have 750

Fixes #484

🤖 Generated with Claude Code

The fixPermissions() function was running chmod -R 755 on the entire
~/.claude directory, making every file executable including configs,
markdown, and JSON files. This is incorrect on Linux/WSL where only
directories and scripts should have the execute bit.

Replaces the blanket chmod -R 755 with granular permissions:
- Directories: 750 (rwxr-x---)
- Regular files: 640 (rw-r-----)
- Scripts (.ts, .sh, .py): 750 (rwxr-x---)

Also uses find -exec ... + instead of \; for better performance.

Fixes danielmiessler#484

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PAIInstallWizard.ts sets improper permissions on all files in ~/.claude on at least Linux

1 participant