fix: pre-approve CLAUDE.md external includes in seeded prefs#26
Draft
dlovell wants to merge 1 commit into
Draft
Conversation
setup-claude.py forces hasTrustDialogAccepted for the workspace key but leaves hasClaudeMdExternalIncludesApproved unset. When a project's CLAUDE.md @imports a file that resolves outside the container workspace path (common under bind mounts, where the import canonicalizes to a sibling mount point), Claude Code prompts to allow external imports on every container init, since the regenerated prefs never carry the approval. Set it alongside the trust flag so seeded containers don't re-prompt. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
setup-claude.py'scopy_user_prefs()force-setshasTrustDialogAcceptedfor the container workspace key but never setshasClaudeMdExternalIncludesApproved.CLAUDE.md@imports a file that resolves outside the container workspace path, Claude Code shows the "Allow external CLAUDE.md file imports?" prompt. This is common under bind mounts: the import canonicalizes to a sibling mount point (e.g. cwd/workspaces/srcbut the import resolves to/home/vscode/repos/github/xorq/...), so it reads as "external" even though it's the same file.Fix
Set
hasClaudeMdExternalIncludesApproved = Truealongside the existing trust flag for the seeded workspace key, so containers stop re-prompting.Test plan
CLAUDE.mdimports a file resolving outside the workspace path; confirm no "Allow external CLAUDE.md file imports?" prompt on first session.~/.claude.jsonshowshasClaudeMdExternalIncludesApproved: trueunder the workspace key after init.🤖 Generated with Claude Code