Context Mentions

Providing the right context helps Kilo Code understand your project and perform tasks accurately. All platforms support @-mentions for referencing files, and the agent can also discover context on its own using built-in tools like read, grep, and glob.

The extension supports @-mention autocomplete for file paths and also uses a tool-based context model where the agent can automatically discover and read files using built-in tools.

How Context Works

When you describe a task, the agent uses its tools — read, grep, glob, and others — to find and read relevant files on its own. You don't need to explicitly point it at files in most cases; just describe what you want done and the agent will locate the right code.

@-Mention Autocomplete

Type @ in the chat input followed by a filename to get autocomplete suggestions. Selecting a file attaches its contents to your message. This is the quickest way to reference a specific file.

Automatic Editor Context

The extension automatically includes context from your editor with each message — your currently focused file and all open editor tabs. You don't need to mention these explicitly.

Selected code and editor diagnostics (errors/warnings) are not included automatically. However, you can send these to Kilo Code through VS Code's Code Actions: select code or hover over an error, then use the lightbulb menu to find context-dependent actions like "Explain with Kilo Code" or "Fix with Kilo Code."

Tool-Based File Access

Rather than attaching file contents up front, the agent reads files on demand during its work:

ToolPurposeExample
readRead the contents of a specific fileAgent reads src/utils.ts to understand it
globFind files matching a patternAgent searches for **/*.test.ts
grepSearch file contents for a patternAgent searches for function handleError
bashRun shell commands including git operationsAgent runs git diff or git log

This means the agent can explore your entire project as needed, rather than being limited to files you explicitly mention.

Best Practices

PracticeDescription
Describe the task clearlyThe agent finds context on its own — focus on what you want done rather than where the code is
Mention files when helpfulIf you know the exact file, mention its path to save the agent a search step
Keep editor tabs relevantOpen tabs are passed as context, so keep relevant files open
Trust the agent's toolsThe agent can search, read, and explore your codebase — let it do the discovery work