Repository navigation
fix: enforce Claude setup file protections - #80
Merged
Merged
Conversation
Setup protected paths were only advisory in Claude prompts, allowing overwrites before the Git guard detected them. Apply native invocation deny rules, preserve host-owned .envrc scaffolding, and identify denied file paths without content. Fixes stackpanel-lxf.
Contributor
|
Preview |
Contributor
|
Docs preview |
This branch was successfully deployed
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.
Claude setup could overwrite a preexisting user file because protected paths were only included in its prompt. Native file permission denials then stopped setup after the damage was detected by the Git guard. Apply invocation-scoped
Editdeny rules before either Edit or Write can change those files, including canonical/symlink targets, and retain the post-run guard. Keep.envrcunder existing host scaffold ownership; identify a denied file in errors without exposing its contents.The Claude permission documentation defines Edit rules for both mutation tools and invocation restrictions that remain effective with managed settings. Protected-path documentation includes
.envrc. Real probes on Claude 2.1.308 and 2.1.319 showed that escaped literal question marks are ignored in deny patterns, so question marks remain conservatively unescaped; similarly named sibling paths may also be denied.Validation:
go build ./...passed; setup-agent and CLI tests passed with canonical TMPDIR. Installed-Claude regression passed in 15.14s. Independent reviewer approved; ADRs 0006 and 0008 remain consistent.bun run check-typespassed in the original checkout. Isolated-worktreebun run check/ type checking were blocked by missing generated config and package-local dependency links.pkg/nixdata/TestSetKeyfailure, freshly reproduced without this patch.nix flake checkretains the removednixfmt-rfc-stylehook failure, tracked by stackpanel-jk2.Fixes stackpanel-lxf.