Roo-Code/apps/docs/docs/basic-usage/context-mentions.md
Bruno Bergher 28acb6acf2
Add docs app and GitHub Pages deploy (#12344)
* Add docs app and Pages deploy

* Configure knip for docs app
2026-05-12 14:23:21 +01:00

11 KiB

description keywords
Learn how to use context mentions (@) in Roo Code to reference files, folders, problems, terminal output, and Git commits for more accurate AI assistance.
Roo Code context mentions
@ mentions
file references
folder mentions
problems panel
terminal mentions
Git integration

Context Mentions

Context mentions are a powerful way to provide Roo Code with specific information about your project, allowing it to perform tasks more accurately and efficiently. You can use mentions to refer to files, folders, problems, and Git commits. Context mentions start with the @ symbol.

Context Mentions Overview - showing the @ symbol dropdown menu in the chat interface

Context mentions overview showing the @ symbol dropdown menu in the chat interface.


Types of Mentions

File mention example showing a file being referenced with @ and its contents appearing in the conversation

File mentions add actual code content into the conversation for direct reference and analysis.

Mention Type Format Description Example Usage
File @/path/to/file.ts Includes file contents in request context "Explain the function in @/src/utils.ts"
Image @/path/to/image.png Includes image as inline visual content (file mention with vision support) "What's wrong with this UI? @/screenshots/bug.png"
Folder @/path/to/folder/ Includes contents of all files directly in the folder (non-recursive) "Analyze the code in @/src/components/"
Problems @problems Includes VS Code Problems panel diagnostics "@problems Fix all errors in my code"
Terminal @terminal Includes recent terminal command and output "Fix the errors shown in @terminal"
Git Commit @a1b2c3d References specific commit by hash "What changed in commit @a1b2c3d?"
Git Changes @git-changes Shows uncommitted changes "Suggest a message for @git-changes"
URL @https://example.com Imports website content "Summarize @https://docusaurus.io/"
Slash Command /<command-name> Executes a slash command (uses / not @) "/test Run all tests"

File Mentions

File mention example showing a file being referenced with @ and its contents appearing in the conversation

File mentions incorporate source code with line numbers for precise references.

Capability Details
Format @/path/to/file.ts (always start with / from workspace root)
Provides Complete file contents with line numbers
Supports Text files, PDFs, and DOCX files (with text extraction)
Works in Initial requests, feedback responses, and follow-up messages
Limitations Very large files may be truncated; binary files not supported

Image Mentions

Image mentions are file mentions with special visual processing. When you mention an image file, and the model supports vision, the image is sent as inline visual content rather than text.

Capability Details
Type Sub-type of file mentions (not a separate mention type)
Format @/path/to/image.png (same path format as file mentions)
Provides Image sent as inline visual content to the model
Supports PNG, JPG, JPEG, GIF, BMP, SVG, WEBP, ICO, AVIF
Best for UI reviews, screenshot debugging, diagram analysis
Requires A model with vision support (non-vision models can't interpret images)

Folder Mentions

Folder mention example showing directory contents being referenced in the chat

Folder mentions include the content of all files within the specified directory.

Capability Details
Format @/path/to/folder/ (trailing slash required to distinguish from file mentions)
Provides Complete contents of all files within the directory
Includes Contents of non-binary text files directly within the folder (not recursive)
Best for Providing context from multiple files in a directory
Tip Be mindful of context window limits when mentioning large directories

Problems Mention

Problems mention example showing VS Code problems panel being referenced with @problems

Problems mentions import diagnostics directly from VS Code's problems panel.

Capability Details
Format @problems
Provides All errors and warnings from VS Code's problems panel
Includes File paths, line numbers, and diagnostic messages
Groups Problems organized by file for better clarity
Best for Fixing errors without manual copying

For comprehensive details on how Roo Code integrates with VSCode's diagnostics system, see Diagnostics Integration.

Terminal Mention

Terminal mention example showing terminal output being included in Roo's context

Terminal mentions capture recent command output for debugging and analysis.

Capability Details
Format @terminal
Captures Last command and its complete output
Preserves Terminal state (doesn't clear the terminal)
Limitation Limited to visible terminal buffer content
Best for Debugging build errors or analyzing command output

Git Mentions

Git commit mention example showing commit details being analyzed by Roo

Git mentions provide commit details and diffs for context-aware version analysis.

Type Format Provides Limitations
Commit @a1b2c3d Commit message, author, date, and complete diff Only works in Git repositories
Working Changes @git-changes git status output and diff of uncommitted changes Only works in Git repositories

URL Mentions

URL mention example showing website content being converted to Markdown in the chat

URL mentions import external web content and convert it to readable Markdown format.

Capability Details
Format @https://example.com
Processing Uses headless browser to fetch content
Cleaning Removes scripts, styles, and navigation elements
Output Converts content to Markdown for readability
Limitation Complex pages may not convert perfectly

Slash Command Mentions

Slash commands are processed by the mentions system but use a / prefix instead of @. They execute predefined commands to perform specific actions.

Capability Details
Format /<command-name> (uses / not @)
Provides Executes the specified command and includes relevant context
Content Type Processed as content block type "command"
Examples /test, /init, /deploy, and other custom commands
Best for Quick access to predefined workflows and actions

For comprehensive details on available slash commands and how to create custom ones, see Slash Commands.


How to Use Mentions

  1. Type @ in the chat input to trigger the suggestions dropdown
  2. Continue typing to filter suggestions or use arrow keys to navigate
  3. Select with Enter key or mouse click
  4. Combine multiple mentions in a request: "Fix @problems in @/src/component.ts"

The dropdown automatically suggests:

  • Recently opened files
  • Visible folders
  • Recent git commits
  • Special keywords (problems, terminal, git-changes)
  • All currently open files (regardless of ignore settings or directory filters)

The dropdown respects .rooignore by default, hiding ignored files from suggestions. Enable the showRooIgnoredFiles setting to include ignored files in the dropdown (they'll appear with a 🔒 indicator). Common directories like node_modules, .git, dist, and out are also filtered to reduce noise.


Important Behaviors

Ignore File Interactions

Behavior Description
Dropdown filtering The @ dropdown hides .rooignore-matched files by default. Enable showRooIgnoredFiles to see them (marked with 🔒).
.rooignore bypass File and folder @mentions bypass .rooignore checks when fetching content for context. Content from ignored files will be included if directly mentioned.
.gitignore bypass Similarly, file and folder @mentions do not respect .gitignore rules when fetching content.
Git command respect Git-related mentions (@git-changes, @commit-hash) do respect .gitignore since they rely on Git commands.