claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

@~/.claude/file.md syntax in CLAUDE.md not loading personal preferences into context

Open uptownhr opened this issue 3 months ago • 5 comments

According to the Memory documentation, CLAUDE.md files should support importing additional files using @path/to/import syntax, including files from the user's home directory like @~/.claude/my-project-instructions.md.

Expected Behavior

When a project's CLAUDE.md contains:

# Individual Preferences
- @~/.claude/CLAUDE_PROJECT.md

The referenced file should be loaded into context and appear in /context output under "Memory files".

Actual Behavior

The file is NOT loaded. Running /context shows:

Memory files · /memory
└ User (/home/uptown/.claude/CLAUDE.md): 737 tokens
└ Project (/home/uptown/Projects/project/project-app/sql-view/CLAUDE.md): 783 tokens

No entry for CLAUDE_PROJECT.md appears, even though the file exists and is readable.

Steps to Reproduce

  1. Create a file at ~/.claude/CLAUDE_PROJECT.md
  2. Reference it in a project CLAUDE.md using: - @~/.claude/CLAUDE_PROJECT.md
  3. Run /context in Claude Code
  4. Observe the file is not listed in "Memory files"

Environment

  • Claude Code CLI
  • Platform: Linux

Additional Notes

The file can be read directly via Read tool, confirming it exists and has proper permissions. The @ syntax appears to work for other files but not for home directory references in list format.

uptownhr avatar Oct 02 '25 15:10 uptownhr

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/1041
  2. https://github.com/anthropics/claude-code/issues/7605
  3. https://github.com/anthropics/claude-code/issues/724

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Oct 02 '25 16:10 github-actions[bot]

Confirm. Tried to do the same, but had to put the files outside of .claude folder

IAkumaI avatar Oct 02 '25 20:10 IAkumaI

I have similar behaviour which previously worked.

CLAUDE.md

# Other instructions 
Read carefully the instructions in @project.md

then in the root of the project (same dir as CLAUDE.md) I have project.md

but

     Memory files · /memory
     └ Project (/Users/matt/projects/tere/tere-fastapi/CLAUDE.md): 1.2k tokens

And have tested by asking Claude via CLI info that would be in the project.md file.

Claude Code v2.0.5

feels like a regression since I previously had this working and have an open source project that relies on this behaviour : https://github.com/opioinc/opio-prompts

mrmattwright avatar Oct 03 '25 00:10 mrmattwright

It used to work and seems to not anymore

Nucs avatar Nov 06 '25 05:11 Nucs

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.

github-actions[bot] avatar Dec 12 '25 10:12 github-actions[bot]