VS Code extension ignores external @imports in project CLAUDE.md (terminal loads them)
Status Open
Reported on v2.1.286
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 3 comments · opened Oct 2, 2026
Environment
- Claude Code CLI 2.1.286, VS Code extension 2.1.285, Windows
- Same behaviour with CLI 2.1.287
Description
An @import in a project CLAUDE.md that points outside the project folder is loaded in the terminal but not in the VS Code extension panel. Imports inside the project folder are loaded in both.
Steps to reproduce
- C:\dev\shared\rules.md with a distinctive line, e.g. "Marker: ALPHA-7".
- C:\dev\probe\CLAUDE.md containing:
@./local.md
@../shared/rules.md
and C:\dev\probe\local.md with "Marker: BETA-3".
- Terminal: cd C:\dev\probe, claude, answer "Allow external CLAUDE.md file imports?" with Yes. /memory lists both files; asking for both markers without reading files works. ~/.claude.json now has hasClaudeMdExternalIncludesApproved: true for C:/dev/probe.
- VS Code: open C:\dev\probe, open the Claude Code panel, new session, ask for both markers without reading any file.
Expected
Both markers known, as in the terminal.
Actual
Only BETA-3 (internal import). The panel does not know ALPHA-7; /memory shows no imported files. Unchanged after "Developer: Reload Window".
Workaround
Importing the same file from ~/.claude/CLAUDE.md with an absolute path (@C:/dev/shared/rules.md) works in panel and terminal.
3 Comments
I was just about to report the same issue. I used Canary phrases instead of Markers, but same result.
I found adding this to my user CLAUDE.md allowed project level imports to function the same as in terminal:
@ Import Resolution (VS Code Extension Compatibility)
At the start of EVERY session, before responding to the first user message:
@followed by a file path~asC:\Users\Name\)@imports in those files (max 5 levels deep)inclusionrules from imported file frontmatter:inclusion: always— always applyinclusion: fileMatchwithfileMatchPattern— apply only when working on matching filesWhen the user asks for canaries: Include canaries from all imported files you've loaded.
This ensures the VS Code extension behaves like the terminal version, which auto-loads @ imports. Without this, the VS Code extension ignores @ import directives.
Reproduced on macOS, so this isn't Windows-only. Claude Code 2.1.296, VS Code extension current as of 2026-10-13.
Repro: a project
CLAUDE.mdcontaining one line,@~/import-probe-target/marker.md, where that file lives outside the project and is imported by nothing else.Terminal (
claudein the project folder): the "Allow external CLAUDE.md file imports?" dialog appears at launch, before the first prompt. After approving,/memorylists the file as@-importedunder Project instructions, and~/.claude.jsongetshasClaudeMdExternalIncludesApproved: trueandhasClaudeMdExternalIncludesWarningShown: truefor the project.VS Code panel, same folder, fresh chat, _before_ the terminal approval: no dialog at any point,
/contextdoes not list the file under Memory files, the model only knows the file's content if it reads it with a tool, and no project entry is written to~/.claude.jsonat all.Workaround (dirty but confirmed)
VS Code panel, after the terminal approval: a new chat lists the file under Memory files and the import loads. It costs one claude CLI approval per project but any VS Code panel that opens in that project after will honor the import approval.
So the panel honors the per-project approval flag; it never presents the dialog, and never writes the never-asked state either. A developer who only uses the panel has no path to approval except a terminal session in the same folder. Worth noting for anyone hitting this: the terminal dialog's default selection is "No, disable external imports", so Enter declines, and a decline is sticky.
Same issue here, in a Dev Container on Windows 11. Adding my case since the setup is different from the Windows/macOS reports above.
Environment
6.18.54.1-microsoft-standard-WSL2) → Docker Dev Container (Linux, usernode)anthropic.claude-code-2.1.296-linux-x64(installed in the container's~/.vscode-server/extensions)2.1.197(npm global)~/.claude/is bind-mounted from the Windows host (H:\Programing\ClaudeCode\.claude, 9p)Paths
/workspaces/obsidian-eagle/CLAUDE.md@/home/node/.share/instructions/test.md(absolute path, outside the project → external import)What I observed
@/home/node/.share/instructions/test.mdline.```json
"/workspaces/obsidian-eagle": {
"hasClaudeMdExternalIncludesApproved": true,
"hasClaudeMdExternalIncludesWarningShown": true
}
After that, claude -p in the project loads the import, and a new VS Code panel session also loads it.
This matches @msuter-cbre's finding: the panel honors an existing approval but never asks for one. In a Dev Container this happens again for every new project, and because ~/.claude.json sits in a volume that isn't visible from the host, users are unlikely to find the flag on their own.
Expected: the panel shows the same approval dialog as the terminal, or there is a user-level setting to approve external imports for all projects.
Investigated and written up with Claude Code (Opus 5.5).