Architectural Overview
Salesforce Code Builder provides a full-featured, browser-based Visual Studio Code environment preloaded with the Salesforce Extension Pack, sf CLI, Apex Replay Debugger, and Einstein for Developers. The CodeBuilderSettings metadata type (CodeBuilder.settings-meta.xml) governs the org-wide activation of Code Builder.
From a DevSecOps perspective, managing CodeBuilderSettings declaratively in version control allows platform engineering teams to automatically enable Code Builder in developer sandboxes while enforcing strict access controls in production orgs.
Directory Location and File Suffix
In Salesforce DX projects, CodeBuilderSettings is stored in the settings directory as CodeBuilder.settings-meta.xml.
| Property | Value |
|---|---|
| Directory Path (SFDX) | force-app/main/default/settings/ |
| File Name (SFDX) | CodeBuilder.settings-meta.xml |
| Classic Metadata File | settings/CodeBuilder.settings |
| Package.xml Type & Member | <name>Settings</name> with <members>CodeBuilder</members> |
Key Metadata Fields
CodeBuilderSettings exposes a single boolean flag in API version 68.0 (Winter ’27):
| Field Name | Field Type | Architectural Description |
|---|---|---|
enableCodeBuilder |
boolean |
Enables (true) or disables (false) Salesforce Code Builder across the organization. Defaults to false. |
Declarative Metadata Example
The following CodeBuilder.settings-meta.xml file enables Code Builder in the target environment:
<?xml version="1.0" encoding="UTF-8"?>
<CodeBuilderSettings xmlns="http://soap.sforce.com/2006/04/metadata">
<enableCodeBuilder>true</enableCodeBuilder>
</CodeBuilderSettings>Package Manifest (package.xml)
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>CodeBuilder</members>
<name>Settings</name>
</types>
<version>68.0</version>
</Package>SFDX CLI Retrieval and Deployment
Retrieve and deploy CodeBuilderSettings using the sf CLI:
# Retrieve CodeBuilderSettings from an org
sf project retrieve start --metadata Settings:CodeBuilder
# Deploy CodeBuilderSettings to enable or disable Code Builder
sf project deploy start --metadata Settings:CodeBuilderArchitect Best Practices and Gotchas
Tip
Even when enableCodeBuilder is true in Production so developers can launch a cloud IDE connected to their sandboxes, ensure developers connect Code Builder to Sandboxes or Scratch Orgs and commit via Git rather than deploying directly from a Code Builder workspace into Production.
- Least-Privilege Access via Permission Sets: Do not grant Code Builder access via standard Profile assignments. Instead, assign the
CodeBuilderPermissionSet only to licensed developers and technical architects. - Edition Support: Verify that the target org edition supports Code Builder before including
Settings:CodeBuilderin universal multi-org deployment manifests.
Frequently asked questions
What does CodeBuilderSettings control in a Salesforce org?
It controls the org-wide enableCodeBuilder toggle, which determines whether Salesforce Code Builder (the web-based IDE powered by Visual Studio Code for the Web) is enabled in the org.
How do I include CodeBuilderSettings in package.xml?
Specify Settings as the metadata type name and CodeBuilder as the member name in package.xml, corresponding to force-app/main/default/settings/CodeBuilder.settings-meta.xml.
Should CodeBuilderSettings be enabled in Production orgs?
In strict enterprise CI/CD governance models, architects often enable CodeBuilder in Developer Sandboxes for rapid prototyping while disabling it or restricting its PermissionSet in Production so all changes flow through Git.
Does enabling CodeBuilderSettings automatically grant all users access to launch Code Builder?
No, enabling CodeBuilderSettings activates the feature at the org level, but individual developers still require the CodeBuilder permission set to launch workspaces.
Comments
Questions, corrections and tips are welcome. Comments are GitHub Discussions, so you sign in with GitHub.