Salesforce development

Claude Code for Salesforce Development: A Practical Setup Guide

On August 19, 2026, Salesforce shipped its first official plugin for Claude Code, built to turn it from a general coding assistant into one that knows Salesforce development (Salesforce Developers blog). Together with the Salesforce DX MCP server and the open-source Salesforce skills library, it means a developer can now build, test and deploy Salesforce metadata from a terminal conversation.

This guide covers the setup we use, plus the scoping and guardrails that matter more than the install. The goal is an agent that is fast in a sandbox and harmless near production.

What you get

The Salesforce development plugin bundles four kinds of things:

  • About 40 skills from Salesforce's skills library, covering core platform development. Skills for Data 360, Commerce and mobile are not in this plugin.
  • Specialized agents. salesforce-dev detects Salesforce projects and routes work through skills, then the Salesforce CLI, then the APIs. architecture-review is read-only and grades a project against Salesforce's Well-Architected pillars. A set of Agentforce Development Lifecycle agents helps author and test Agentforce agents.
  • Three MCP servers: API and metadata guidance (salesforce-api-context), metadata type knowledge (salesforce-metadata-experts), and local Apex and SOQL language servers (salesforce-lsp) for diagnostics and completions in the terminal.
  • Hooks and commands. Hooks detect a DX project and its default org on start, validate Agent Script files, and check deployment results. Commands include /setup, /discovery, /org, /login and /logout.

The Salesforce DX MCP server (@salesforce/mcp) is separate. It gives Claude tools to work with your orgs directly: deploy and retrieve metadata, query data, manage users and run tests (DX MCP server docs).

Before you start

Install these first:

  • Claude Code
  • Node.js LTS (v22 or v24 at the time of writing)
  • Salesforce CLI
  • Python 3.8 or later, which some of the plugin's hooks use

And decide one thing: which org the agent will work in. Use a Developer sandbox or a scratch org. Do not authorize your production org on the machine where the agent runs. If the credentials are not there, no prompt and no mistake can reach production.

Step 1: Authorize a sandbox

From your Salesforce DX project folder:

sf org login web --alias dev-sandbox --instance-url https://test.salesforce.com --set-default

If your org uses My Domain, pass your sandbox's My Domain login URL as the instance URL instead.

Step 2: Install the plugin

Open Claude Code in the project and run:

/plugin install salesforce-development@claude-plugins-official

Then check the environment:

/salesforce-development:setup

Claude detects the default org from your project and activates the salesforce-dev agent.

Step 3: Add the DX MCP server, scoped tightly

The server ships over 60 tools, and turning them all on fills the model's context and widens what it can touch. Name one org and only the toolsets you need. A project-level .mcp.json keeps the setting with the repo, so the whole team gets the same scope:

{
  "mcpServers": {
    "salesforce-dx": {
      "command": "npx",
      "args": ["-y", "@salesforce/mcp@latest",
               "--orgs", "dev-sandbox",
               "--toolsets", "orgs,metadata,data,testing"]
    }
  }
}

Three settings to avoid unless you have a reason:

  • ALLOW_ALL_ORGS gives the server every org you have ever authorized. Salesforce's docs recommend naming only the orgs it should reach.
  • --toolsets all loads every tool.
  • --allow-non-ga-tools adds tools that are not generally available yet.

Telemetry is on by default; add --no-telemetry to turn it off.

Step 4: Write the project rules down

Claude Code reads a CLAUDE.md file at the root of the project. Put the rules there that you would tell a new contractor on day one:

# Salesforce project rules

- Target org: dev-sandbox. Never deploy anywhere else.
- API version: [your version]. Match it in every new metadata file.
- Every Apex class gets a test class; run tests after every deploy.
- Naming: custom objects and fields use PascalCase with the __c suffix; no abbreviations.
- Never create or edit profiles; use permission sets.
- Never delete metadata or data. Propose a destructive change in the PR description instead.
- Before any deploy, list every component you will change and wait for approval.

Step 5: Make risky commands ask first

Claude Code's permission rules decide what runs without asking. In the project's .claude/settings.json, make deploys and data commands ask every time, and block reading local secrets:

{
  "permissions": {
    "ask": [
      "Bash(sf project deploy *)",
      "Bash(sf data *)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)"
    ]
  }
}

See Claude Code's settings documentation for the full rule syntax.

A first task, end to end

Try something small and real. For example:

Add a Priority__c picklist to Case with the values Low, Medium, High and Urgent. Add a validation rule that requires a Priority when Status is Escalated. Write the metadata, show me the plan, then deploy to dev-sandbox and confirm the rule works.

What to check before you approve the deploy:

  1. The plan lists the exact files: the field, the validation rule, and any layout or permission set changes.
  2. The field is added to a permission set, not a profile.
  3. The validation rule's formula handles blank Status values.
  4. After the deploy, Claude creates a test Case in the sandbox and shows that the rule fires.

Salesforce's own examples of prompts that work well include creating an Apex service class, generating a custom object with fields, deploying the project, and writing and running a test class.

Keep these with a human

  • Production deploys. Agent work reaches production through a validated deployment that a person approves, never from the agent's session.
  • Destructive changes. Deleted fields keep their data for 15 days, then it is gone.
  • Data. Bulk updates and deletes need a backup and a second pair of eyes.
  • Access. Permission sets and sharing changes get a named reviewer.

Our guide to letting an AI agent change your Salesforce org without breaking production covers approvals, evidence and rollback in more depth.

Running this for a team

On one laptop, this setup works well. Across a team of contractors, two problems show up: org credentials and client code end up on personal machines, and nobody can see which agent session changed what.

Cenario's Cloud Development Environment gives each developer an isolated cloud workspace tied to one project, so code and credentials never land on a laptop and access can be revoked in one click. Cloud Development Environment for AI agents runs coding agents in their own locked environments with budgets and human approval before anything is committed.

Sources

Run like a firm. Scale like a platform.

See Cenario on your own work — bring a real project to the demo.