Skip to content

Core Concepts4 min read

Context Mentions

Pull files, folders, problems, and git context into your request

Mentions are how you hand the agent context instead of making it hunt. Type @ in the chat box and pick a file, folder, or workspace resource; when you send the message, the mention is expanded — the file’s contents, the folder’s listing, the Problems panel — and delivered alongside your words. A well-mentioned request skips the agent’s entire discovery phase, which means fewer tool calls, lower cost, and answers grounded in exactly the code you meant.

Mention Syntax What gets pulled in
File @/path/to/file The file’s contents, delivered formatted like a completed file read (with truncation info for very long files).
Folder @/path/to/folder/ (trailing slash) A tree listing of the folder plus the contents of every readable text file directly inside it.
URL any scheme:// address, e.g. https://… The exact address, passed to the agent as part of your request.
Git commit a commit hash, 7–40 hex characters That commit’s details from your repository — message, author, date, and diff.
Problems @problems The VS Code Problems panel: current errors and warnings (up to 50 diagnostic messages by default).
Git changes @git-changes Your working state: uncommitted changes in the working tree.
Terminal @terminal Recent output from the active terminal.

Paths are workspace-relative and always start with / after the @.

  • Position: a mention is only recognized at the start of a line or after whitespace. An @ embedded in pasted text (log lines, email addresses mid-token) is left alone.
  • Escaping: write \@ when you mean a literal at-sign at a mention position.
  • Spaces in paths: escape them with a backslash — @/docs/release\ notes.md.
  • Punctuation: trailing ., ,, !, ?, ;, : are not swallowed, so a mention can end a sentence naturally: Check @/src/index.ts.
  • Folders need the trailing slash@/src/utils/ is a folder mention; @/src/utils would be treated as a file path.

You rarely type mentions by hand. Typing @ opens a menu offering Problems, Terminal, URL, Folder, File, and Git Commits (including a “Working changes” entry for @git-changes). Keep typing to fuzzy-search files by name; for commits, search by hash or message. Arrow keys plus Enter, or a click, inserts the mention.

The file search behind this menu indexes up to 10,000 workspace files by default. On very large monorepos, raise the nexgile-code.maximumIndexedFilesForFileSearch setting if files you expect aren’t appearing in the menu (higher values cost some memory and startup scan time).

Explain what @/src/services/auth.ts does and how it's used by @/src/routes/.
@problems Fix the TypeScript errors — start with the ones in src/models/.
Review @git-changes and tell me if anything looks risky before I commit.
a1b2c3d introduced this regression. Compare its diff with the current
@/src/parser/tokenizer.ts and find what changed in error handling.
The build just failed — see @terminal. Diagnose the root cause.
Implement the client for the API described at https://api.example.com/docs/v2
in @/src/clients/, following the pattern in @/src/clients/billing.ts.

Understanding the mechanics helps you predict cost and behavior:

  • Files arrive pre-read. A mentioned file is injected into the conversation formatted exactly like the result of a completed read_file call — so the agent treats it as already read and starts working instead of re-reading. Very long files are truncated with a note telling the agent how to read more. Binary files are noted and omitted; files excluded by .nexgileignore show up as blocked rather than leaking content.
  • Folders are recursive in breadth, not depth. A folder mention includes the listing plus the contents of each text file directly inside the folder — not nested subfolders’ contents.
  • @problems snapshots diagnostics at send time — errors and warnings with file and line, capped at 50 messages by default.
  • @git-changes and commit hashes come from your real git repo — handy for “review what I’m about to commit” and regression archaeology respectively.
  • URLs are references, not downloads. The agent receives the address itself; page content is not fetched into context automatically. When you need the agent to actually browse a page, pair the URL with browser automation via the built-in Playwright MCP server.

Mentions work anywhere you type to the agent — the initial request, follow-up replies, and feedback attached to approvals. You can also push context the other direction: select code in the editor and press Ctrl+K Ctrl+A (Add To Context, Cmd+K Cmd+A on macOS), right-click a selection and use the Nexgile Code submenu, or use the terminal’s right-click menu to add terminal content to the conversation.

  • Mention folders sparingly. @/src/ on a large project can inject an enormous amount of file content and crowd out room for actual work. Prefer two or three specific files; let codebase search find the rest.
  • @problems + Debug mode is a natural pair. Switch to 🪲 Debug, send @problems fix the type errors, and the agent starts from the full diagnostic list as evidence — no copy-pasting error text. The same pattern works with @terminal for build failures.
  • Mention before you ask, not after. Context supplied up front shapes the plan; context supplied after a wrong plan only patches it.
  • Watch the context budget. Every mention consumes context-window space. If a long session starts condensing early, trim the habit of mentioning entire folders. See Context Management.