Intermediate8 min

The @ Reference System and Rich Context Injection

@ references, image paste, the ! bash prefix, and Ctrl+G editor mode are the four mechanisms for injecting rich context into Claude Code prompts. Used together, they eliminate the gap between what you know and what Claude knows.

Quick Reference

  • @filename: Claude reads the file before responding — content is in context before reasoning starts
  • @directory/: Claude reads the directory listing for navigation context
  • Image paste: Cmd+V (Mac/Linux) or Alt+V (Windows) — screenshots, mockups, error messages
  • ! prefix: run shell commands inline — output injected as context (!git log -10)
  • Ctrl+G: open in $EDITOR for multi-paragraph prompts
  • Ctrl+S: stash the current message to finish later

@ File and Directory References

@ references are processed before the prompt is sent to the model. The file content is in Claude's context before it reasons about your request — not injected as part of a 'please read this' instruction Claude might deprioritize.

@ reference syntax
@ vs telling Claude to read

Writing '@src/auth.ts' injects the file content upfront. Writing 'read src/auth.ts' is a tool call instruction Claude processes as part of the response. @ references are more reliable for critical context you need Claude to reason from.