File References with @
Reference specific files in your prompts for targeted operations:
bash
# Single file
Review @src/auth/login.tsx for security issues
# Multiple files
Refactor @src/utils/validation.ts and @src/utils/helpers.ts to remove duplication
# With wildcards (in some contexts)
Analyze all test files @src/**/*.test.ts
# Relative paths work
Check @./CLAUDE.md for project conventionsWhy use @:
- Precision: Target exact files instead of letting Claude search
- Speed: Skip file discovery phase
- Context: Signals Claude to read these files on-demand via tools
- Clarity: Makes your intent explicit
Example:
# Without @
You: Fix the authentication bug
Claude: Which file contains the authentication logic? [Wastes time searching]
# With @
You: Fix the authentication bug in @src/auth/middleware.ts
Claude: [Reads file on-demand and proposes fix]