PAIInstallWizard.ts contains a fixPermissions function which runs
try {
// Step 1: chmod first - make files accessible
execSync(`chmod -R 755 "${targetDir}"`, { stdio: 'pipe' });
printSuccess('Step 1: chmod -R 755 (make accessible)');
// Step 2: chown - change ownership to current user
execSync(`chown -R ${info.uid}:${info.gid} "${targetDir}"`, { stdio: 'pipe' });
printSuccess(`Step 2: chown -R to ${info.username}`);
// Step 3: chmod again - set final permissions
execSync(`chmod -R 755 "${targetDir}"`, { stdio: 'pipe' });
printSuccess('Step 3: chmod -R 755 (final permissions)');
// Make scripts executable
for (const pattern of ['*.ts', '*.sh', '*.hook.ts']) {
try {
execSync(`find "${targetDir}" -name "${pattern}" -exec chmod 755 {} \\;`, { stdio: 'pipe' });
} catch (e) { /* ignore */ }
}
All files should NOT be set to 755 permissions. This should only be set on executable files as in the final "Make scripts executable" describes.
One fix for the fixPermissions() bug in PAIInstallWizard.ts on Linux where it "chmod -R 755 ~/.claude" making every file executable looks to be (in this specific order):
#!/usr/bin/bash
#
# Fix PAI permissions for Linux
#
# Set directories to 750
find ~/.claude -type d -exec chmod 750 {} +
# Set all regulare files to 640
find ~/.claude -type f -exec chmod 640 {} +
# Set scripts to 750
find ~/.claude -type f -name "*.ts" -exec chmod 750 {} +
find ~/.claude -type f -name "*.py" -exec chmod 750 {} +
find ~/.claude -type f -name "*.sh" -exec chmod 750 {} +
PAIInstallWizard.ts contains a fixPermissions function which runs
All files should NOT be set to 755 permissions. This should only be set on executable files as in the final "Make scripts executable" describes.
One fix for the fixPermissions() bug in PAIInstallWizard.ts on Linux where it "chmod -R 755 ~/.claude" making every file executable looks to be (in this specific order):