Add Context
Context tells Agentforce Vibes exactly what to look at when responding to your prompt. Without context, the agent gives general answers. With the right context, it gives answers specific to your code, your org, and your current problem.
Click @ in the chat input to open the context picker. The picker groups available context by type, including files from your project. Select one or more items to attach them to your next prompt.
You can also:
- Drag and drop image files directly into the chat input.
- Right-click a selection in the editor and choose Agentforce: Add to Context.
Attaches current errors and warnings from the VS Code Problems panel, including file locations. Use this when debugging a compilation error or deployment failure.
Attaches the complete content of one or more files from your project. The agent sees imports and surrounding code, not just the selection. Use this when you want the agent to work with a specific class, component, or configuration file.
Attaches the schema metadata for sObjects in your connected org—object definitions, field names, field types, and relationships. The picker lists the SObjects available in your org (for example, Account, Contact, Case, and custom objects). The agent uses this to generate code that references real API names rather than placeholder values. Use this when building features against specific objects or when you want the agent to understand your org’s data model.
Attaches an existing plan to the conversation. The agent uses the plan’s context, goals, and task history when responding.
Attaches Git diffs, commit messages, and change history. Use this when you want the agent to understand what changed recently or to troubleshoot a regression.
Attaches the output from your most recent terminal session. Use this when debugging a failed CLI command or deployment error.
| Context Type | What the Agent Sees |
|---|---|
| Workspace Problems | Errors and warnings with file locations |
| Files | Complete file content, imports, and surrounding context |
| Database | SObject schema metadata—object definitions, field names, types, and relationships |
| Plans | Plan document including context, goals, and tasks |
| Git | Diffs, commit messages, and change history |
| Last terminal output | Terminal output with formatting preserved |
Attaching multiple context types gives the agent the complete picture. Some effective combinations:
| Scenario | Context to combine |
|---|---|
| Deployment issues | Files + Last terminal output + Workspace Problems |
| Test failures | Test class + Main class + Last terminal output |
| Component development | Component files + Database + Related Apex |
| Integration debugging | Service classes + Last terminal output + Files |
- The agent’s context window has limits. Very large files or many files attached together may be truncated. Agentforce Vibes manages this automatically, but prefer specific files over entire folders for targeted questions.
- Clear attached context when switching between unrelated tasks to avoid the agent carrying forward irrelevant information.
- Pin frequently used files and metadata to avoid re-selecting them each session.
- Images bypass the Salesforce LLM Gateway trust layer. When you drag an image into the chat input, the image is sent directly to the AI model without passing through the trust layer. Don’t include screenshots or images that contain sensitive data, personally identifiable information, or confidential org configuration.