Stop Claude Pasting Whole Files Into Your Chat
When you type @ and a file name, Claude Code sends the file's contents. One setting sends only the path, so Claude reads what it needs. The setup line, the catch, and a prompt to find your biggest wasted files
2min read
1prompts to copy
3numbered steps
4sections
By default, an @ file mention in Claude Code puts the whole file into the conversation before Claude reads your question. On a big file, that is a lot of tokens you pay for on every message that follows.
Here is the one-line setting, the catch, and a way to check where it matters.
Step 1: turn it on
- Set the environment variable CLAUDE_CODE_DISABLE_FILE_MENTIONS before you start Claude Code.
- On Mac or Linux, run: export CLAUDE_CODE_DISABLE_FILE_MENTIONS=1 and then start claude.
- Type @ and a file as usual. Claude now receives only the file's path, and reads the file with its own file tools when it needs it.
Keep reading
Free, for an email.
Unlocks 3 more sections, 1 copy-paste prompt, the document version, and every other guide on the site, for free. Enter your email once to keep reading.
45,000+ follow where these guides come from.No spam. Unsubscribe in one click.