> ## Documentation Index
> Fetch the complete documentation index at: https://termmate.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat with File or Selection

> Send a file or selected code directly into the agent context.

Instead of describing what to change, you can attach the exact code you want the agent to work on.

TermMate provides a single **Chat with Agent** command that handles both files and selections. When text is selected it references the selected lines; otherwise it references the file at the cursor.

## VS Code

* Right-click in the editor → **TermMate: Chat with Agent**
* Right-click a file in the Explorer → **TermMate: Chat with Agent**
* `Cmd+Shift+P` → `TermMate: Chat with Agent`

The file or selection is added as context in the agent's next message.

## Sublime Text

* Right-click in the editor → **TermMate: Chat with Agent**
* Right-click a file or folder in the sidebar → **TermMate: Chat with Agent**

Instead of sending content immediately, this opens the chat view (if needed) and inserts a reference tag into the prompt: `@path` for a sidebar file or folder, or `@filename#L1-10` for the cursor line or selection in the editor. Add your instructions and send — tagged files are delivered as context with the message. The file must be saved to disk, since the tag references the file path.

### Smart `@` Completion

You don't need the right-click menu to reference files. Type `@` anywhere in the chat prompt to get real-time suggestions of workspace files and symbols, then keep typing to filter. This is the fastest way to pull specific files into context while you write your instructions.
