Skip to content

fix: pre-approve CLAUDE.md external includes in seeded prefs#26

Draft
dlovell wants to merge 1 commit into
mainfrom
fix/approve-claudemd-external-includes
Draft

fix: pre-approve CLAUDE.md external includes in seeded prefs#26
dlovell wants to merge 1 commit into
mainfrom
fix/approve-claudemd-external-includes

Conversation

@dlovell

@dlovell dlovell commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • setup-claude.py's copy_user_prefs() force-sets hasTrustDialogAccepted for the container workspace key but never sets hasClaudeMdExternalIncludesApproved.
  • When a project's 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/src but the import resolves to /home/vscode/repos/github/xorq/...), so it reads as "external" even though it's the same file.
  • Because the prefs file is regenerated from the host copy on every container init — and the host copy never carries the includes approval — the prompt reappears after every rebuild.

Fix

Set hasClaudeMdExternalIncludesApproved = True alongside the existing trust flag for the seeded workspace key, so containers stop re-prompting.

Test plan

  • Rebuild a container for a project whose CLAUDE.md imports a file resolving outside the workspace path; confirm no "Allow external CLAUDE.md file imports?" prompt on first session.
  • Confirm ~/.claude.json shows hasClaudeMdExternalIncludesApproved: true under the workspace key after init.

🤖 Generated with Claude Code

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>
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