Back to Features

@ Symbols - Context is Everything

Master @ symbols to give AI perfect context for better results

๐Ÿ’ก What You'll Learn

  • All 5 @ symbol types and when to use each
  • How @ symbols 10x your AI accuracy
  • Advanced @ combinations for power users
  • Pro tips from real developers

๐ŸŽฏ Why @ Symbols Matter

@ symbols are the secret to getting 10x better AI responses. Without context, the AI guesses. With @ symbols, it knows.

โŒ Without @ Symbols

How do I handle authentication?

Result: Generic answer about authentication that may not match your codebase

โœ… With @ Symbols

How do I handle authentication like @src/lib/auth.ts?

Result: Specific answer using your exact patterns, types, and conventions

๐Ÿ“š The 5 @ Symbol Types

๐Ÿ“„

@Files

Reference specific files

// Examples:
Explain @src/lib/api.ts
Update @components/Button.tsx to use variants
How does @utils/auth.ts validate tokens?

When to use: When you need to reference a specific file's code, logic, or patterns

Pro Tips:

  • โœ… Type @ and start typing - autocomplete will help
  • โœ… Can reference multiple files: @file1.ts @file2.ts
  • โœ… Works in Chat, Composer, and Cmd+K prompts
๐Ÿ“

@Folders

Reference entire directories

// Examples:
Explain the structure of @src/components/
Create a new component following @components/ patterns
Refactor @src/utils/ to use TypeScript

When to use: When you need context about multiple related files or overall structure

Pro Tips:

  • โœ… Great for understanding project structure
  • โœ… Helps AI learn your naming conventions
  • โœ… Use for "create similar to what's in @folder/"
๐Ÿ—‚๏ธ

@Codebase

Semantic search across your entire project

// Examples:
@Codebase where do we handle user authentication?
@Codebase find all database queries
@Codebase show me error handling patterns

When to use: When you don't know where something is or need to find patterns across files

Pro Tips:

  • โœ… Requires codebase indexing (check status bar)
  • โœ… Searches by meaning, not exact text
  • โœ… Can be slow on large projects (>100MB)
  • โš ๏ธ Works best with specific questions
๐Ÿ“–

@Docs

Query official documentation

// Examples:
@Docs React explain useEffect
@Docs Next.js how do I use App Router?
@Docs TypeScript what are utility types?

When to use: When you need authoritative answers from official framework/library docs

Supported Docs:

โœ… React
โœ… Next.js
โœ… TypeScript
โœ… Vue
โœ… Python
โœ… Node.js
โœ… And 100+ more...
๐ŸŒ

@Web

Search the internet for current info

// Examples:
@Web what's new in Next.js 15?
@Web best practices for React Server Components 2025
@Web how to fix [specific error message]

When to use: When you need the latest information, breaking changes, or recent best practices

Pro Tips:

  • โœ… Great for checking latest versions/updates
  • โœ… Useful for obscure error messages
  • โš ๏ธ Slower than other @ types
  • โš ๏ธ Requires internet connection

๐Ÿ”ฅ Advanced @ Combinations

You can combine multiple @ symbols for ultra-precise context:

Create a new API route similar to @src/app/api/users/route.ts but for posts. Follow the patterns in @src/app/api/ and use types from @src/types/

๐Ÿ’ก Combines @File + @Folder + @Folder for perfect context

@Codebase where do we validate user input? Then update @src/lib/validation.ts to follow the same pattern for email validation

๐Ÿ’ก Combines @Codebase search + @File editing

@Docs Next.js explain the new caching in App Router, then apply it to @src/app/

๐Ÿ’ก Combines @Docs learning + @Folder application

๐Ÿ“Š @ Symbol Comparison

@ TypeScopeSpeedBest For
@FilesSingle fileโšกโšกโšก FastSpecific code
@FoldersDirectoryโšกโšก MediumStructure/patterns
@CodebaseEntire projectโšก SlowerFinding things
@DocsExternal docsโšกโšก MediumLearning APIs
@WebInternetโšก SlowestLatest info

โšก Pro Tips from Power Users

๐Ÿ’ก Tip 1: Start narrow (@File), expand if needed (@Folder โ†’ @Codebase)

๐Ÿ’ก Tip 2: Use @Files to teach AI your coding style and patterns

๐Ÿ’ก Tip 3: @Codebase is expensive - use it when you really don't know where code is

๐Ÿ’ก Tip 4: Combine @Docs with your files: "@Docs React + @myComponent.tsx"

๐Ÿ’ก Tip 5: @Web is best for "what's new in X 2025" type questions

๐ŸŽ“ Practice Exercise

Master @ Symbols:

  1. Use @Files: "Explain @[pick any file in your project]"
  2. Use @Folders: "What's the structure of @src/?"
  3. Use @Codebase: "@Codebase where do we handle errors?"
  4. Use @Docs: "@Docs [your framework] explain [concept]"
  5. Use @Web: "@Web what's new in [your tech stack] 2025?"
  6. Combine: Use 2-3 @ symbols in one prompt

๐Ÿ› Common Issues

@ autocomplete doesn't work

Wait a second after typing @ for autocomplete to load. Check that indexing is complete (bottom status bar).

@Codebase returns no results

Codebase not indexed yet, or your project is too large. Be more specific with your search query.

@Docs doesn't have my library

Use @Web instead to search the internet for that library's docs.

๐Ÿ”— Next Steps

Learn how to customize AI behavior with Cursor Rules: Cursor Rules Tutorial โ†’