The only way to prevent @path import is wrapping it in code spans/blocks — please add a plain escape (e.g. \@) or a way to disable it

Open 💬 0 comments Opened Jun 17, 2026 by greyfolk99

I've been using Claude Code daily on the Max plan for months across multiple real projects.

The problem

Claude Code expands every @path token in CLAUDE.md (and imported files) into a file import. If I want a literal @token to stay as normal prose text, my only option is to wrap it in a markdown code span or code block — which forces it into monospace and changes how it reads. There is no lightweight escape (like \@) to keep an @ literal in normal text, and no setting to disable import parsing short of the blunt --safe-mode / --bare, which turn off all of CLAUDE.md.

What I verified (Claude Code 2.1.173)

  • @file.md in normal prose → imported (file content expanded). ✅
  • ` @file.md ` (inline code span) and fenced code blocks → not imported. So code-formatting is currently the only escape.
  • Non-resolving tokens (@scope/pkg, emails) → silently ignored, no error.
  • No flag/env disables import specifically; only --safe-mode (CLAUDE_CODE_SAFE_MODE=1) / --bare disable CLAUDE.md wholesale.

Why code-span-only isn't enough

Wrapping in backticks forces monospace rendering and isn't acceptable when you want a literal @ to read as plain text, or when the @ is part of your own conventions/tooling in shared markdown. The author has no lightweight way to say "this one is literal."

To make it worse, this code-span/code-block escape is no longer documented — the old docs (docs.anthropic.com/en/docs/claude-code/memory) stated "imports are not evaluated inside markdown code spans and code blocks"; the current docs (code.claude.com/docs/en/memory) dropped that sentence (and silently changed the recursion limit from five hops to four). So the one escape that works isn't even documented, which makes relying on it risky.

Request

  1. A plain inline escape (e.g. \@) to keep an @ literal in normal prose without code formatting.
  2. And/or a setting to disable @ import parsing without disabling all of CLAUDE.md.
  3. Restore the code-span/code-block escape note to the docs.

Environment

  • Claude Code 2.1.173, CLI

View original on GitHub ↗