CLAUDE.md: @ file import fails silently for paths containing spaces (e.g. iCloud Drive on macOS)

Resolved 💬 2 comments Opened May 7, 2026 by devRavit Closed Jul 7, 2026

Summary

The @ file import syntax in CLAUDE.md silently fails when the path contains spaces. No error or warning is shown — the file is simply not loaded.

Environment

  • Platform: macOS
  • Shell: zsh
  • Claude Code version: latest

Reproduction

  1. On macOS, iCloud Drive files are stored at a path with spaces:

``
~/Library/Mobile Documents/com~apple~CloudDocs/
``

  1. Add the following to ~/.claude/CLAUDE.md:

``
@~/Library/Mobile Documents/com~apple~CloudDocs/my-project/_index.md
``

  1. Start a new Claude Code session.
  1. Expected: The referenced file is loaded into context at session start.

Actual: The file is silently not loaded. No error or warning is displayed.

Impact

This makes it impossible to use @ imports for any files stored on iCloud Drive without a workaround, since iCloud Drive's filesystem path always contains a space (Mobile Documents).

Workaround

Creating a symlink to a space-free path works around the issue:

ln -s ~/Library/Mobile\ Documents/com~apple~CloudDocs/my-project ~/.my-project

Then use @~/.my-project/_index.md in CLAUDE.md.

Suggested Fix

  • Support paths with spaces in \@\ imports (treat the entire rest of the line as the path, or support quoted paths: \@"path with spaces/file.md"\)
  • Alternatively, emit a warning when an \@\ import path cannot be resolved, so the failure is not silent

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗