"@file Import Fails for Global CLAUDE.md Instruction Files"
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 13 comments · opened May 9, 2025 · closed Jan 6, 2026
Bug Description
The import feature for CLAUDE.md files appears to be functioning inconsistently. While @file imports work properly in project-level CLAUDE.md files, they fail when used in the global instructions file (~/.claude/CLAUDE.md). When attempting to import system instructions with "@~/.claude/system-instructions.md", Claude doesn't recognize the content, and the imported file doesn't appear in the /memory output despite documentation stating it should. This suggests a potential permissions issue or bug specific to global instruction imports, as the same syntax works correctly in project-specific contexts.
Environment Info
- Platform: macos
- Terminal: Apple_Terminal
- Version: 0.2.107
- Feedback ID: e1883750-c156-49d8-9901-283fe8375b44
13 Comments
After tonight's update, everything started working great once I approved the use of imports at the PROJECT level via the dialog that comes up the first time you do that. Prior to that, none of the global imports were working, but after, everything is working perfectly even though the dialog pertained to project level instructions, not the global instructions.
I'm actually seeing a similar issue. Global imports don't work in project using the @ nomenclature. Steps to reproduce.
1) Open up claude in a non-git/project
2) Ask it what it knows about something stored in a @ path. If it's relevant I'm using
@~/.claude/memory/file.md3) It recognizes it and tells me what I expect. Same with any direct memory in the CLAUDE.md
4) cd to a project/git repo. Call claude.
5) repeat above, it cannot auto-load my @path. I get no such project dialogs.
Think I got this figured out. Here is the full description and workaround in case it helps anyone else:
Description
When starting Claude Code in a new project, the "hasClaudeMDExternalIncludesApproved" setting in ~/.claude.json is set to false, but the approval dialog that should appear to let users enable this feature never shows up. This prevents external includes in CLAUDE.md files (using @ syntax) from working properly.
Steps to reproduce
Workaround
Manually edit ~/.claude.json to set "hasClaudeMDExternalIncludesApproved": true for the project entry.
Expected behavior
Claude should either automatically set "hasClaudeMDExternalIncludesApproved" to true for new projects or reliably show the approval dialog to let users enable this feature.
I can't get this to work with the global memory on WSL with v1.0.6. Not natively and also not with the workaround. Maybe I'm missing something:
I have the memory file at
~/.claude/CLAUDE.md. Claude, without reading files, can recall the .md, but the imported instructions are not resolved. Here's claudes response:I added
hasClaudeMDExternalIncludesApproved": truefor the project in which I started claude to the~/.claude.json.The
/memorycommand also shows the same as claudes response. The docs use this exact scenario as an example:The only difference is probably that this example is used in the project memory, while I'm trying to do it for the user memory.
Did you have to ADD
"hasClaudeMDExternalIncludesApproved": trueto the project entry, or was it already there and set tofalse? It should already be there and set tofalse, and setting it totrueis the fix. If you want, post some or all of your~/.claude.jsonand I'll take a look.TLDR: Manually adding
"hasClaudeMdExternalIncludesApproved": true,(notice the lower capitald) to my project entry in~/.claude.jsonmade the user context file import work (for me).---
I did have to add it. I can't post my claude.json, but heres some random greps:
Out of all projects I have initialized on this machine (many of which I have used over the past 4 weeks or so, only a single one had
hasClaudeMDExternalIncludesApproved. There, it was set to true. The other occurence I added manually. The project in question is one I have last worked on 27 days ago. In the meantime, there have been at least 5-10 projects (probably more) that I had open in claude, without the parameter being added.Edit: Looking back, its more probable that I added this one by accident in the wrong project.
I did some more debugging and moved my old
~/.claude.json, reauthenticated and opened claude in a project. I was then able to see the following two params added to the newly created fresh config:After moving back to the old config and setting "hasClaudeMdExternalIncludesApproved", claude seemed to get the correct memory, with the context from the file I imported.
/memorystill showed the unresolved path. Makes sense for this to be intentional – tho it would be nice to have confirmation of correctly imported files without having to quiz claude about its internal context.Switching the
dto uppercase made it not work again!After having played around with this for a while, I have seen the two parameters added to more projects now – not all, but some. Cannot see a pattern in the projects that have it and the ones that don't. Seems to be there are some bugs left to be squashed here.
Also, if claude is to be trusted here, the files seem to be provided separately, not as I thought, with the imports resolved:
As such, one has to be careful about phrasing when asking about context file contents. However, this wasn't the reason for my earlier problems, as I always asked about the context generally, not specific files.
This is still not working for me - i can only make the references work in the project memory file - changing those keys has no effect on reading files referenced from my user memory.
Changing the keys works for me (but yes, it's still broken as I have to do this every time I start a new project). But this workaround does work every time (at least on Mac and Linux). Make absolutely sure your project looks like this in
~/.claude.jsonBefore changing
hasClaudeMdExternalIncludesApproved(make sure it's a lowercasedinMdas I messed this up before) totrue, CC will look like this when you enter/memory:!Image
After, it should look like this (with whatever
@file.mdyou have set up in place of mine):!Image
Same for me, I just verified this behavior with 1.0.18 again on wsl. Setting
hasClaudeMdExternalIncludesApprovedhas a direct effect on whether the imports are evaluated.Maybe you can share your project json and memory files with their paths to help debug (with anything unrelated removed).
Also sad to see this still not fixed as the feature is mostly working as intended from what I can tell – claude would just have to prompt whether to resolve the imports and set the boolean.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.