Salesforce Developers Blog

Unlock Deeper Code Insights with User-Specified Context in Dev Assistant

Avatar for Mohith ShrivastavaMohith Shrivastava
The user-specified context feature in Dev Assistant generates more precise and relevant responses and offers comprehensive explanations of intricate logic.
Unlock Deeper Code Insights with User-Specified Context in Dev Assistant
June 11, 2025
Listen to this article
0:00 / 0:00

Developers often face the challenge of understanding and enhancing code written by others, primarily when the logic is spread across multiple files and involves complex abstractions. When using Dev Assistant, its default behavior of only considering currently open files as context can lead to incomplete explanations of business logic and potentially misdirected code enhancements. For instance, if a developer is working on a trigger, but the core logic resides in a separate service class, the assistant might not grasp the whole picture and therefore provide a superficial analysis or suggest changes in the wrong place.

The User-Specified Context feature in Dev Assistant offers a robust solution to this problem by allowing developers to enrich the assistant’s understanding manually. Users can provide a complete operational picture by adding specific files, methods, or even selected lines of code to the prompt. 

As a result, interactions with Dev Assistant are significantly improved: the tool can generate more precise and relevant responses, offer comprehensive, step-by-step explanations of intricate logic, and correctly place new code in the appropriate files. This capability is invaluable when dealing with deeply nested code, ensuring that developers receive accurate guidance and can efficiently build upon existing structures.

To learn how to use the User-Specified Context feature in Dev Assistant with the Agentforce for Developers extension, check out the video below.

To learn more about how we do context prioritization, best practices, and limits, check out the official developer docs.

Resources

About the author

Mohith Shrivastava is a Principal Developer Advocate at Salesforce with 14 years of experience building enterprise-scale products on the Salesforce Platform. Mohith is currently among the lead contributors on Salesforce Stack Exchange, a developer forum where Salesforce Developers can ask questions and share knowledge. You can follow him on LinkedIn.

More Blog Posts

The Salesforce Developer’s Guide to the Winter ’26 Release

The Salesforce Developer’s Guide to the Winter ’26 Release

Learn about highlights for developers in the Winter '26 release across Lightning Web Components, Apex, Salesforce Platform developer tools, APIs, and more.September 08, 2025

Discover the Highlights of TDX 2025

Discover the Highlights of TDX 2025

Explore a recap of TDX 2025, with highlights from Agentforce, AgentforceDX, and more autonomous AI innovations.March 25, 2025

Streamline AI Code Generation with Customization Rules

Streamline AI Code Generation with Customization Rules

AI Customization Rules are a step forward in making AI-generated code more reliable and aligned with your development practices.May 23, 2025