Explore Context Types and How to Add Them
Learning Objectives
After completing this unit, you’ll be able to:
- Identify the types of context you can provide to Agentforce Vibes.
- Describe the mechanisms for adding context to a conversation
- Explain how different context types serve different development scenarios.
How to Add Context to Agentforce Vibes
Agentforce Vibes provides four mechanisms for attaching context to a conversation.
-
Type @ in the chat input to open the context picker, which organizes available context by type.
-
Click + to open a file picker for uploading files from your filesystem.
-
Drag and drop image files directly into the chat input.
-
Right-click a selection in the editor and choose Agentforce: Add to Context to pull a specific code section into the conversation.
The @ context picker is where you'll spend the most time. It groups available context into types, each described below.

The + button opens a file picker for uploading files from your filesystem. Image files can also be dropped directly into the chat input.
This is especially useful when you want to:
- Share mockups or wireframes that show what you’re trying to build.
- Provide specification documents that describe requirements.
- Upload log files that contain diagnostic information.
Context Type: Files
Files context attaches the complete content of one or more files from your project, including imports and surrounding code (not just a selection). This is useful when you want the agent to work with a specific class, component, or configuration file.
Typical use cases:
- Asking the agent to refactor a specific class (“Look at @AccountService.cls and suggest improvements”)
- Providing an example of your coding style (“Follow the pattern in @ExistingComponent”)
- Giving the agent visibility into related files that affect the task at hand
When you attach a file, the agent sees the whole thing, not just the section you're asking about. This is useful (it sees your imports, class-level variables, method signatures), but attaching a 2,000-line service class when you only need help with one method uses too much context window. In that case, right-click the specific method and choose Agentforce: Add to Context. You get precision without the overhead.
Context Type: Database
Database context attaches sObject schema metadata from your connected org: object definitions, field names, field types, and relationships. The picker lists sObjects available in your org (Account, Contact, Case, custom objects, and so on).
The agent uses this metadata to generate code that references real API names rather than placeholder values. For example, selecting Account from the Database picker gives the agent visibility into every field on your Account object, how it relates to Contacts, Opportunities, and Cases, and what field types exist. The agent can then generate code that uses actual field API names, respects required fields, and navigates relationships correctly.
This is ideal for building features against specific objects or helping the agent understand your data model without describing it manually.
You don’t need to describe your data model in your prompt when you’ve attached Database context. Prompts like “create a trigger on the object with a lookup to the parent” become unnecessary. Attach the relevant sObject and write: “Create a trigger on Renewal__cthat updates the parent Contract__crecord.” The agent already knows the field names, types, and relationships.
If the agent generates a field reference that doesn't exist in your org, that’s a sign Database context wasn’t attached, or the wrong sObject was selected. Add the context and re-prompt before assuming the code needs manual correction.
Context Type: Workspace Problems
Workspace Problems context attaches the current errors and warnings from the VS Code Problems panel, including file locations and severity levels. This is the fastest way to get debugging help because the agent sees exactly what your development environment sees.
Instead of copying error text and pasting it into a prompt, a single @ reference gives the agent the complete diagnostic picture.
Context Type: Last Terminal Output
Last Terminal Output context attaches the output from your most recent terminal session. This preserves the complete output with formatting, which is critical for debugging failed CLI commands, deployment errors, or test execution results.
When a deployment fails or tests produce unexpected results, terminal context gives the agent the full picture of what happened, not just the summary or the last error line.
Context Type: Plans
Plans context attaches an existing plan to the conversation. The agent uses the plan’s context, goals, and task history when responding. This is useful when you’ve already created a plan in Plan Mode and want to continue a conversation that builds on that plan’s scope and decisions.
After you approve and execute a plan in one session, that plan document exists in your project. In a future session, or a new conversation thread, you can attach it using the Plans context type. The agent picks up the original goals, scope decisions, and task history rather than starting cold. For multiday development work, this is how you maintain continuity without reexplaining the project each time.
Context Type: Git
Git context attaches diffs, commit messages, and change history. This is useful when you want to:
- Ask the agent to review what you've changed.
- Troubleshoot a regression by examining recent commits.
- Generate a commit message based on your actual modifications.
Git context works for more than debugging. If you want the agent to write a commit message that describes your changes, attaching Git context is more reliable than asking it to infer from file contents. For code review prompts, like “check these changes for bulkification issues”, the agent works from the diff rather than a full file with ambiguous history.
Pinning Frequently Used Context
You can pin files or metadata that you reference often. Pinned items remain easily accessible throughout your development session, saving you from re-selecting the same resources each time you start a new conversation thread.
Combine Multiple Context Types
No single context type tells the whole story. Real development tasks benefit from combining multiple types.
In a deployment failure, for example: Files alone tells the agent what the code says; Last Terminal Output tells it what went wrong; Workspace Problems tells it what else might be related. Each context type answers a different question. Together they give the agent enough to reason about cause, not just symptoms.
The next unit walks through how to apply this across common development scenarios.
