Skip to main content

How Context Works

When you send a message, the agent assembles context from multiple sources to understand your task. The more relevant context it has, the better the output.
1

Workspace analysis

The agent reads your project’s file structure, dependencies, and language configuration to understand the environment.
2

Active file context

The file currently open in your editor is automatically included. The agent sees the full contents and cursor position.
3

Skill matching

The agent checks available Skills and loads any whose description matches the current task.
4

Explicit context

Anything you attach via @ mentions, file selections, or pasted content is added to the context window.
5

Tool-gathered context

During execution, the agent can search your codebase, read additional files, run shell commands, and query MCP tools to gather more context as needed.

Providing Context with @ Mentions

Use @ in the chat input to attach specific context:
MentionWhat it does
@fileAttaches a specific file from your workspace
@folderAttaches all files in a folder
@JiraPulls issue details from a connected Jira ticket
@urlFetches content from a URL (docs, API references)
Be selective with @folder — attaching a large directory can dilute the relevant context. Prefer @file for targeted results.

Multi-Repository Context

With Multi-Repository Search, agents can search across indexed repositories beyond the current workspace. This is useful for:
  • Understanding cross-service dependencies
  • Finding shared utility implementations
  • Checking how other services handle similar patterns
Multi-repo context is fetched on demand — the agent searches indexed repos when your prompt references other services or projects.
Multi-Repository Search requires Pro Plus or higher. See Multi-Repository Search for setup instructions.

Skills as Context

Skills inject domain knowledge and team conventions into the agent’s context automatically. Unlike @ mentions, skills are loaded based on task matching — you don’t need to attach them manually. Examples of context that skills provide:
  • Coding standards and naming conventions
  • Error handling patterns your team uses
  • Testing requirements and framework preferences
  • API design guidelines
Skills are stored as SKILL.md files in .agents/skills/ and are version-controlled with your repo.

Image Context

Attach images directly in chat to provide visual context:
  • Screenshots of UI bugs or desired designs
  • Figma exports for design-to-code workflows
  • Error screenshots from browsers or terminals
  • Architecture diagrams for reference
Image attachments are available across VS Code and JetBrains IDEs.

Context from External Tools

Chrome Extension DiscontinuedThe Zencoder Chrome Extension has been discontinued and is no longer available. Use @url mentions to pull in context from browser-based tools, or connect them via MCP servers.

MCP Tools

Connected MCP servers let agents query external systems during execution — databases, APIs, Slack, GitHub, and more. The agent decides when to call these tools based on the task.

Tips for Better Context

The active editor file is always included. Open the most relevant file before sending your prompt.
Instead of describing a file’s contents, attach it with @file. The agent gets the exact source instead of your paraphrase.
Long, multi-topic chats accumulate stale context. Start a new chat for each distinct task so the agent’s context stays clean.
You don’t need to attach every relevant file upfront. The agent has codebase search and file read tools — it will find what it needs during execution.
If you find yourself repeating the same instructions across chats, create a Skill so the agent loads that context automatically.

Coding Agent

The primary agent that uses all context sources

Skills

Reusable instruction packages loaded by context matching

Multi-Repository Search

Cross-repository context for multi-service architectures

Integrations & MCP

Connect external tools for richer context