Skip to content

fix(installer): scope chmod to shebang scripts instead of chmod -R 755#1090

Open
keegoid wants to merge 1 commit intodanielmiessler:mainfrom
keegoid:fix/installer-chmod-scope
Open

fix(installer): scope chmod to shebang scripts instead of chmod -R 755#1090
keegoid wants to merge 1 commit intodanielmiessler:mainfrom
keegoid:fix/installer-chmod-scope

Conversation

@keegoid
Copy link
Copy Markdown

@keegoid keegoid commented Apr 19, 2026

The configuration step runs chmod -R 755 on the entire paiDir, flipping every .md/.json/.yaml/.txt under ~/.claude to executable. Users who manage ~/.claude under git see thousands of mode-only diffs on every upgrade.

This replaces the blanket chmod with a targeted walk that only sets +x on (a) files ending in .sh, and (b) files with a common script extension (.ts/.js/.mjs/.cjs/.py) whose first two bytes are '#!'. Everything else is left alone.

Skips .git and node_modules. All chmod errors and unreadable files are ignored (non-fatal, matching the original try/catch semantics).

Verified: bun type-check passes; unit-run against a synthetic tree flips only scripts, no data files.

The configuration step runs `chmod -R 755` on the entire paiDir, which flips every .md, .json, .yaml, .txt (etc.) under ~/.claude to executable. Users who manage ~/.claude under git see this as thousands of mode-only diffs on every upgrade.

Replace the blanket chmod with a targeted walk that only sets +x on (a) files ending in .sh, and (b) files with a common script extension (.ts/.js/.mjs/.cjs/.py) whose first two bytes are '#!'. Everything else is left at whatever mode the filesystem / cp gave it.

Skips .git and node_modules during the walk. All chmod errors and unreadable files are ignored (non-fatal, matching the original try/catch around the chmod block).

Verified: type-checks with bun; unit-run against a synthetic tree flips only scripts, no data files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant