Fix tarball permission stripping and allowedTools flag format#149
Merged
Fix tarball permission stripping and allowedTools flag format#149
Conversation
df32b8b to
632dd38
Compare
1. Preserve full file permissions in _tar_inputs(): Files now retain their complete mode (rwx bits) instead of being normalized. Only mtime/uid/gid are normalized for reproducibility. 2. Fix --allowedTools flag format: Use shlex.quote() for proper shell escaping instead of manual quoting. 3. Add test for full permission mode preservation after tar round-trip. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
632dd38 to
1ec86a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_tar_inputs()to usetarfile.add()directly (preserves permissions by default)--allowedToolsCLI flag quoting usingshlex.quote()Problem
The tarball creation was hardcoding all files to 0o644, stripping executable permissions. This caused Claude Code to see spurious
100755 -> 100644permission changes when runninggit diff HEAD~1 --raw, leading to false positives.Fix
Simplified from complex manual TarInfo construction to just:
This preserves file permissions naturally. The in-memory cache (keyed by path names) already prevents duplicate uploads within a process, so we dont need deterministic tarball hashes for GCS deduplication.
Test plan
🤖 Generated with Claude Code