Getting Started with Claude Code
You need an org with Agentforce enabled. Get a LabBox if you need one.
1. Install Claude Code
Other platforms and installation options.
2. Connect Salesforce
Install Salesforce CLI if needed:
sf --version
The output should start with @salesforce/cli/.
If the org is already authorized, skip sign-in and use its existing alias.
Use your chosen alias with --target-org in later commands. If you're signed in to Labs, select that org before copying the build prompt.
3. Install the Agentforce plugin
In your project directory, run claude and follow the sign-in prompts. Then install the plugin inside Claude Code:
/plugin install agentforce-adlc@claude-plugins-official
Requires Python 3.9+. Run /plugin to confirm the plugin is installed and enabled; restart Claude Code if its skills are missing.
For Apex, Flow, and other platform work, you can also install Salesforce Development. See Skills and plugins for commands and prerequisites.
4. Build an agent
Paste this prompt into Claude Code.
Check setup:
1. Check SF CLI: `sf --version`
Reuse installed tools and working authentication. If setup is needed, follow https://labs.agentforce.com/llms.txt. Check command-runtime connectivity before installation or device approval; stop and report a blocked host and operation.
2. Reuse installed agentforce-generate and agentforce-test skills. Install only missing skills, preferably in the project.
For Claude Code plugins, use `claude plugin install agentforce-adlc@claude-plugins-official`; plugin skill names have the agentforce-adlc: prefix. For portable skills, use `npx skills add forcedotcom/sf-skills` and select your coding tool. Other supported options: https://github.com/SalesforceAIResearch/agentforce-adlc.
Verify the skills load. Reuse prior setup approval; ask before an unapproved global change. If discovery fails, read installed SKILL.md and references when supported; use only host-supported reload steps.
3. Select the intended org alias or username from the setup page or user request. Replace <org-alias> below with that value; if the intended org is unclear, ask before continuing.
Verify the org privately: `sf data query --query "SELECT Id, Name, IsSandbox FROM Organization" --target-org <org-alias> --json`
Confirm the returned org name and Id match the intended target. If authentication fails, follow https://labs.agentforce.com/llms.txt to reconnect the intended org using a supported login method, then verify it again.
Pass `--target-org <org-alias>` on every subsequent org command; do not rely on or change the default org.
Use my request to determine the agent's behavior, data, actions, and tests. Ask only for missing details that change the result.
Use agentforce-generate to implement the agent and its actions. Show me the changes before publishing. After publishing, run agentforce-test and report passing tests, failures, and remaining limitations.
Keep credentials out of chat, logs, and source files. Deploy only when the user's request explicitly asks; obtain authorization before tests that deploy metadata or run live actions.