---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/context-mentions.md
  - https://sourcecraft.dev/portal/docs/ru/code-assistant/operations/agent/context-mentions.md
title: Managing SourceCraft Code Assistant chat context in Visual Studio Code
description: How to use context mentions in SourceCraft Code Assistant chat for links to files, folders, VS Code Problems, and Git commits.
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt


# Managing SourceCraft Code Assistant chat context in Visual Studio Code

{% note warning %}

This page describes chat context features in Visual Studio Code. To learn about the chat context features in the JetBrains IDE, see [Managing SourceCraft Code Assistant chat context in the JetBrains IDE](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/chat-context.md).

{% endnote %}

Context mentions are a powerful way to give Code Assistant specific information about your project for more accurate and efficient task execution. You can use context mentions for links to files, folders, VS Code Problems, and Git commits. All context mentions start with `@`.

## Mention types {#types}

| Mention type | Format | Description | Usage example |
| --- | --- | --- | --- |
| **File** | `@/path/to/file.ts` | Includes the file's contents in the prompt context | `Explain the function in @/src/utils.ts` |
| **Folder** | `@/path/to/folder` | Includes the contents of all files residing in the folder (non-recursively) | `Analyze the code in @/src/components` |
| **Problems** | `@problems` | Includes diagnostics from the VS Code Problems panel | `@problems Fix all errors in my code` |
| **Terminal** | `@terminal` | Includes the most recent terminal command and its output | `Fix the errors displayed in @terminal` |
| **Git Commits** | `@a1b2c3d` | References a specific commit by its hash | `What changed in commit @a1b2c3d?` |
| **URL** | `@https://example.com` | Imports website contents | `Summarize @https://sourcecraft.dev/portal/code-assistant/` |

### File mention features {#file-mentions}

| Feature | Details |
| --- | --- |
| Format | `@/path/to/file.ts`<br>Always start with `/` relative to the workspace root. |
| Extracted data | Full file contents with line numbers. |
| Supported files | Text files, PDF and DOCX (text-extractable formats). |
| Allowed use | Initial prompts, follow-up clarifications, and subsequent messages. |
| Constraints | Very large files may be truncated. Binary files are not supported. |

## How to use mentions {#how-to-use}

1. In the chat input field, type `@` to open the dropdown with suggested mentions.
1. Continue typing to filter suggestions or use arrow keys for navigation.
1. Select the mention you need by pressing **Enter** or using your mouse.

    You can use multiple mentions in a single prompt, e.g., `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 opened files, regardless of ignore settings or directory filters.

## Ignoring files {#ignore-files}

| Behavior | Description |
| --- | --- |
| Bypassing `.codeassistantignore` | File and folder mentions ignore `.codeassistantignore` checks when fetching content for context. If you explicitly mention an ignored file, its content will be included in the context. Also, there are [exceptions](codeassistantignore.md#excludes) to `.codeassistantignore`. |
| Bypassing `.gitignore` | Similarly, mentions of files and folders disregard `.gitignore` rules when fetching file contents. Also, there are [exceptions](codeassistantignore.md#excludes) to `.gitignore`. |
| Accounting for Git commands | Git-related mentions, e.g., `@git-changes` or `@commit-hash`, account for `.gitignore`, as they depend on Git commands. |

#### Useful links {#see-also}

* [Using .codeassistantignore to manage file access in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/codeassistantignore.md)
* [Terminal integration in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/shell-integration.md)