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. Install any missing agentforce-generate and agentforce-test skills using `npx skills add forcedotcom/sf-skills`, selecting this coding tool. Reuse installed skills and verify they load. Prefer project-local installs; ask before unapproved global changes.
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. Connecting does not authorize org changes. Save changes to the org, publish, or activate an agent only when explicitly requested, and obtain authorization before tests that deploy metadata or run live actions.