Claude Tips mascot
Claude Tips & Tricks
Claude Code beginner

Reference Files with @ Instead of Pasting

Type @filename in your prompt to have Claude Code read the file directly, avoiding copy-paste and keeping your prompt clean.

Instead of copying file contents into your prompt, just reference them with @:

@src/api/auth.ts has a bug in the token refresh logic. Fix it.

Claude Code will read the file and use its contents as context. You can reference multiple files:

Look at @src/models/user.ts and @src/api/users.ts, the API doesn't match the model.

Tab Completion

Type @ and press Tab to get autocomplete suggestions for file paths. This works with fuzzy matching too.

When to Use @

  • Bug reports: “The function in @src/utils/parse.ts fails on empty input”
  • Cross-file context: “Make @src/api/v2.ts match the patterns in @src/api/v1.ts”
  • Reviews: “Review @src/components/Dashboard.tsx for performance issues”

More efficient than reading the entire codebase. You’re pointing Claude at exactly what matters.

Paste into Claude Code
Read the files I reference with @ and explain how they work together.