Don't describe files vaguely — reference them directly using tab completion in your terminal.
claude "refactor the auth logic in src/services/auth<TAB>"
When you press Tab, your terminal auto-completes the file path, giving Claude the exact location. No ambiguity, no guessing.
This matters because Claude Code reads the files you reference. Vague descriptions like "the auth file" force it to search your codebase and sometimes pick the wrong one. An explicit path means it loads the right file immediately.
You can also use the @ symbol to reference files inline:
Fix the type error in @src/utils/helpers.ts using the
interface defined in @src/types/index.ts
A few habits that help:
- Reference specific files when the project has similarly named files across directories
- Include multiple file paths when the task spans several files
- Use relative paths from the project root for clarity
# Be specific — Claude loads exactly what you point to
claude "add error handling to @src/api/users.ts and
update the tests in @tests/api/users.test.ts"
The more precise your file references, the less time Claude spends searching and the more time it spends solving.
Log in to leave a comment.
Before asking Claude to scaffold a new feature, point it at your existing code first — it will match your naming, structure, error handling, and test patterns exactly rather than defaulting to framework boilerplate.
Give Claude the full picture upfront before it writes any code, so it builds the right thing the first time with fewer correction rounds.
Complex prompts are unreadable as escaped single-liners. Use shell HEREDOCs to write clean, structured prompts directly in your scripts.