Cline Mentions Feature Guide
Overview
The mentions feature is a powerful capability that allows you to reference various resources in your conversations with Cline using the "@" symbol. This includes file contents, directory structures, webpage URLs, VSCode diagnostic information, terminal output, Git change status, and more - all easily incorporated into your conversations.
By using this feature, Cline can gain more accurate context and provide more relevant assistance for your tasks.
Basic Syntax
Mentions always start with the "@" symbol, followed by the path or identifier of the resource you want to reference:
You can place mentions anywhere in your user messages, and Cline will automatically retrieve the referenced content.
Supported Mention Types
1. File References
To reference file contents, use @/
followed by the relative path within your project:
Example:
In this example, Cline automatically retrieves the contents of Button.tsx and uses it to perform the analysis.
2. Directory References
To reference directory contents, use @/
followed by the relative path of the directory, ending with a trailing /
:
Example:
In this example, Cline retrieves a listing of the components directory and its contents.
3. URL References
To reference web page contents, use @
followed by the URL:
Example:
In this example, Cline fetches the response from the GitHub API and analyzes the JSON.
4. Diagnostic References
To reference VSCode diagnostic information (errors and warnings) in the current workspace, use @problems
:
Example:
In this example, Cline retrieves the current errors and warnings from your workspace and identifies high-priority issues.
5. Terminal Output References
To reference the latest terminal output, use @terminal
:
Example:
In this example, Cline examines the latest terminal output and analyzes the error's cause.
6. Git Working Directory References
To reference the current Git working directory change status, use @git-changes
:
Example:
In this example, Cline retrieves the list of changed files in the current Git working directory and identifies candidates for commit.
7. Git Commit References
To reference information about a specific Git commit, use @
followed by the commit hash:
Example:
In this example, Cline retrieves information about the specified commit hash and analyzes the changes made in that commit.
Usage Scenarios
Code Review
Debugging Assistance
Project Analysis
Code Generation
Version Control Integration
Combining Multiple Mentions
You can combine multiple mentions to provide more complex context:
Limitations and Considerations
Large Files: Referencing very large files may take time to process and could consume a significant amount of tokens.
Binary Files: Binary files (such as images) will not be properly processed and will show a "Binary file" message.
Directory Structure: Directory references will only show top-level files and directories, not recursively showing the contents of subdirectories.
URL Limitations: Some websites may block automated crawling, which could prevent accurate content retrieval.
Path Syntax: File paths or URLs with special characters (such as spaces) may not be recognized correctly.
Troubleshooting
Mentions Not Recognized
If your mentions aren't being recognized correctly, check that:
There's no space after the
@
symbolFile paths are accurate (case-sensitive)
URLs include the full format (with
https://
)
Content Not Retrieved
If the content of referenced resources can't be retrieved:
Verify the file exists
Ensure you have access permissions for the file
Check that the file isn't too large or the URL too complex
Performance Issues
If mention processing is slow:
Reference smaller files or specific file sections
Reduce the number of mentions used at once
Conclusion
Mastering the mentions feature makes your communication with Cline more efficient. By providing appropriate context, Cline can deliver more accurate assistance, significantly improving your development workflow.
Last updated