Skip to content

fix: enforce Claude setup file protections - #80

Merged
cooper (czxtm) merged 1 commit into
mainfrom
fix/claude-setup-permissions
Nov 24, 2026
Merged

cooper (czxtm) merged 1 commit into
mainfrom
fix/claude-setup-permissions

Conversation

@czxtm

Copy link
Copy Markdown
Member

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 Edit deny rules before either Edit or Write can change those files, including canonical/symlink targets, and retain the post-run guard. Keep .envrc under 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:

  • Public Run regression failed before the fix and passes after it: protected writes were actually attempted and denied while ordinary writing succeeded.
  • 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-types passed in the original checkout. Isolated-worktree bun run check / type checking were blocked by missing generated config and package-local dependency links.
  • Full Go tests retain the unrelated pkg/nixdata/TestSetKey failure, freshly reproduced without this patch. nix flake check retains the removed nixfmt-rfc-style hook failure, tracked by stackpanel-jk2.
  • Scoped formatting/diff checks and calldiff passed.

Fixes stackpanel-lxf.

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.
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Preview pr-80 has been destroyed.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview pr-80 has been destroyed.

@czxtm
cooper (czxtm) merged commit b3980eb into main Nov 24, 2026
14 checks passed
@linear-code

linear-code Bot commented Nov 24, 2026

Copy link
Copy Markdown

ENG-1535

This branch was successfully deployed

2 active deployments
docs-preview — 8388ea7e Deployed Nov 8, 2026 by czxtm via deploy #263
pr-80 — 8388ea7e Deployed Nov 8, 2026 by czxtm via deploy #274
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