Salesforce Review & Deploy for Claude Code
Reviews a Salesforce component with Claude before you deploy it. Click the button, and Claude lists the required optimizations. Then you choose whether to deploy.
This is a community extension built on Claude Code. It is not made or endorsed by Anthropic or Salesforce.
Requirements
- Claude Code, installed and signed in. Reviews run through the Claude Code CLI and count against your Claude plan. No API key is needed. Install it from claude.com/claude-code, then run
claude once in a terminal to sign in.
- Salesforce CLI (
sf), for deploying. See developer.salesforce.com/tools/salesforcecli.
- A Salesforce DX project (a folder with
sfdx-project.json) open in VS Code 1.90 or later.
- Optional: Microsoft Edge or Google Chrome, to download review reports as PDF.
How it works
Click 🚀 Review & Deploy with Claude. You'll find it in the editor title bar, or by right-clicking a file or folder under force-app.
The extension works out what to review:
- a file inside an LWC or Aura bundle → the whole bundle
- an Apex class, trigger or VF page → the file plus its
-meta.xml
- any other folder → every source file inside it
You can type extra instructions for this run, for example "focus on bulk performance". Press Enter to skip.
Claude reviews the code against:
- built-in Salesforce best practices (security, governor limits, performance, LWC/Apex patterns, accessibility)
- the standard rules shipped with the extension in
rules/standard-rules.md
- the project's rules in
.review-deploy/rules.md, if the project has any. They override the standard rules. See Standard rules and project rules.
- your personal rule overrides, if you have any. See Overriding team rules.
- the instructions you typed
A results panel shows the verdict and each optimization: severity, file:line (click to jump there), and the fix. Click an optimization to expand it and see the exact code change:
- Changes: a line diff using your file's line numbers. Red
− lines are removed from the code, green + lines are added.
- ⇄ Show changes in editor opens VS Code's side-by-side diff: your current file on the left, the file with the fix applied on the right. Your file is not modified until you click Apply Changes, either in the notification that appears when the diff opens or as the ✓ icon in the diff editor's title bar (top right, shown as an icon only). That writes the fix into the file and saves it, closes the diff, and selects the changed lines. If the file has unsaved edits, you're asked to save first. The finding still counts toward the deploy gate until you Re-review.
- The fix is matched against your file as it is now. If Claude cited the wrong line, the code is found where it really is. If you've changed that code since the review, the diff is marked as out of date and the editor button is hidden, so re-review.
- When a fix can't be shown as a single change in that file (for example, it needs a new class), a code snippet is shown instead.
Choose Deploy, Re-review, or Cancel. If critical, high or medium findings remain, deployment is blocked. See Deploy gate. Deploy runs sf project deploy start --source-dir … --json in the background, with progress and a Cancel button, and reads the result:
- On success you see what was deployed and to which org.
- On failure you get an error message saying what went wrong and what to do, and the panel lists the errors: component errors with a link to the file and line, failing tests, and code coverage warnings. 💬 Ask Claude to fix sends them to the chat, where Claude proposes the changes. Show details opens the full
sf output in the Claude Review & Deploy output channel.
- Common problems get a plain explanation and a button to fix them: no default org (Set Target Org), an org that isn't logged in or whose login expired (Log In), the
sf CLI not installed, nothing deployed because the component is held back in .forceignore, and network errors.
If a finding isn't useful, click ✕ Dismiss on it. The finding is removed for this review session:
- It disappears from the panel. It also no longer blocks deployment.
- On Re-review, Claude is given the dismissed list and told not to report those findings again. If Claude reports one anyway (same file, category and title), it is filtered out.
- Dismissed findings are listed in a collapsible Dismissed by developer section. Click ↺ Restore to bring one back.
- Starting a new review with the rocket button starts with an empty dismissed list.
Choose ⬇ Download Report to save the review. In the save dialog, pick a format:
- PDF (
.pdf, the default): ready to attach, share or print. It is printed from the HTML report by the Microsoft Edge or Google Chrome already on your machine, running headless, so nothing extra is installed. If neither browser is found, set reviewDeploy.pdfBrowserPath.
- HTML (
.html): a standalone page you can open in any browser or email
- Markdown (
.md): good for pull requests, wikis or Jira
- JSON (
.json): the raw findings, for scripts or CI
The default file name is <component>-review-<yyyymmdd-hhmm>.pdf, saved in the workspace root. In PDF and HTML reports, every finding is shown expanded. Each report includes the date, model, verdict, deploy-gate status and severity counts, then the list of findings with their fixes and sample code, the dismissed findings, the files reviewed, and your instructions for that run.
Choosing the Claude model
You can change the model (and effort) used for reviews and for the chat. The choice is saved in this project's workspace settings (.vscode/settings.json).
- For reviews: click ⚙ Next review: … at the top of the results panel, or the ⚙ button in the extra-instructions prompt before a review. The new model is used from the next review; click ↻ Re-review to review again with it.
- For the chat: click the model name in the chat header. Same as the project goes back to using the review's model (or Claude Code's project setting).
- From anywhere: run Review & Deploy: Change Claude Model from the Command Palette.
- Each choice offers Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2, or any other model ID. You then pick an effort; Esc keeps the current one.
Showing a review again
Every review is saved in this workspace (VS Code's per-workspace extension storage, not in your project files). You can open it again later, even after restarting VS Code, without running Claude again or using any tokens. The saved copy includes dismissed findings, applied fixes and the chat.
- 🚀 Review & Deploy on a component that has already been reviewed asks whether to Show last review or Review again. If the code has changed since that review, the choice says so and recommends reviewing again.
- Show Last Claude Review (the history icon in the editor title bar, or right-click a reviewed file or folder) opens the last review directly. From the Command Palette, it lists every saved review in the workspace.
- Open last review of … also appears in the Deploy Blocked: Show Why list.
- If the review's panel is still open, it's brought to the front instead of opening a second copy.
- The panel shows when the review ran. If the code has changed since (for example, after you applied fixes), a note warns that the findings may be out of date and suggests ↻ Re-review. Deploy still reviews changed code before deploying it.
- ↻ Re-review always runs a new review. The latest review of each component is kept, up to the 50 most recent components.
Chatting about the review
You can discuss the findings with Claude right in the results panel and have it change the code, without opening the component.
- 💬 on a finding opens the chat for that finding. Use it to ask why something is a problem, or to reject the suggested fix and ask for a different one, for example "Don't remove the debug, use
LoggingLevel.FINE instead" or "Use a Map here, not a nested loop".
- 💬 Chat in the bottom bar opens the chat for the whole review, for example "Fix all the high findings" or "Explain the security findings". The drop-down at the top of the chat switches between the whole review and each finding. Each one keeps its own conversation, and the 💬 button on a finding shows how many messages you've sent about it.
- When Claude proposes a change, it appears under its reply as a red/green diff:
- ✓ Apply writes it into the file and saves it.
- ⇄ Show in editor opens the side-by-side diff first, with the usual Apply Changes button.
- ✓ Apply all applies every change in the reply.
- Applying a change made for a finding marks that finding as fixed. As with other fixes, Re-review to clear it before deploying.
- Apply changes automatically (off by default) controls when Claude's changes reach your files. Off: each change is shown as a diff and nothing is written until you click Apply. On: every change in a reply is written and saved as soon as the reply arrives, and the diff is shown marked as applied. The setting is remembered.
- To resize the chat, drag the bar with the grip at its top. Double-click the edge or click ⤢ to maximize it, and do it again to restore. The size is remembered for later reviews.
- Claude sees the files as they are now, including changes you applied earlier in the chat, and follows the same rules as the review. It can only change the files that were reviewed. For a new file (a test class, say), it gives you the code in its reply instead.
- Chats last as long as the results panel. A Re-review opens a new panel with new findings and empty chats.
- The chat uses the project's Claude model and effort, shown in the chat header (hover to see where they come from). Each is taken from the first place that sets it:
reviewDeploy.chatModel / reviewDeploy.chatEffort, to give the chat its own model
reviewDeploy.model / reviewDeploy.effort, set in this workspace's or your user settings (the same model as the review)
- Claude Code's settings for the project:
model and effortLevel (or modelSettings.<model>.effortLevel) in .claude/settings.local.json, .claude/settings.json, then ~/.claude/settings.json
- the extension's defaults
Standard rules and project rules
Rules come in three layers. Each layer overrides the one before it:
| Layer |
File |
Who it applies to |
| 1. Standard rules |
rules/standard-rules.md, shipped inside the extension |
Every project |
| 2. Project rules |
.review-deploy/rules.md in the Salesforce project (commit it) |
Everyone working on that project |
| 3. Personal overrides |
.review-deploy/rules.local.md (not committed) |
Only you |
A project with no rules.md is reviewed against the standard rules as they are. To customise them for a project:
- Run Review & Deploy: View Standard Rules to see the standard rules and their section headings.
- Run Review & Deploy: Edit Project Review Rules. This creates
.review-deploy/rules.md with instructions.
- Add only what differs from the standard rules. Overriding works the same way as personal overrides (below):
- a section with the same heading as a standard section replaces it, and an empty one removes it
- other rules are added, and win over conflicting standard rules
- a
## Severity rules section sets severities. Project severity rules win over standard ones.
To skip the standard rules in a project and use only its own rules file, set reviewDeploy.useStandardRules to false in the workspace settings.
To change the standard rules for every project, edit rules/standard-rules.md in the extension repo and release a new version.
Overriding team rules
Each developer can override team rules, such as naming conventions, for their own reviews only. The team rules file is not changed, and nobody else's reviews are affected.
Run Review & Deploy: Edit My Rule Overrides from the Command Palette. This creates .review-deploy/rules.local.md with instructions and an example. The file is in .gitignore, so it stays on your machine.
Add your rules. There are two ways to override:
- Replace a whole section. Use the same heading as a section in the team rules. Numbers and punctuation are ignored, so
## Naming & structure replaces ## Part 3 — Naming & structure. Everything under your heading replaces that section. A heading with nothing under it removes the section.
- Add or change individual rules. Write them above your first section heading, or under a heading that doesn't match a team section, such as
## Other overrides. When one conflicts with a team rule, yours wins, and Claude won't report violations of the team rule it replaces.
Anything below a matching heading belongs to that section, up to the next heading.
- System.debug is allowed in test classes.
## Naming & structure
- Apex classes use PascalCase with a functional suffix: AccountService, AccountSelector.
- LWC folders use camelCase with no namespace prefix.
Setting your own severity and category
To decide for yourself how serious an issue is, add a ## Severity rules section, one rule per line:
## Severity rules
- [high] System.debug statement left in Apex code
- [critical | security] Hard-coded password, token or API key
- [low | naming] Variable name that doesn't follow camelCase
- The format is
- [severity] what to look for or - [severity | category] what to look for. Severity is critical, high, medium or low. Category is any word you choose, for example logging or naming. If you leave it out, Claude picks one.
- Claude checks every rule and reports each place the code matches it. The extension then sets your severity and category on that finding, so Claude can't rate it lower or higher. Under the finding, the panel and reports show Severity set by rule.
- The severity drives the deploy gate. With the default
blockingSeverities, a [high] rule blocks deployment until the issue is fixed or dismissed.
- Your other rules can still limit where a severity rule applies. For example,
- System.debug is allowed in test classes. together with - [high] System.debug statement reports debug statements as high everywhere except test classes.
- The team can add the same section to
rules.md. When a team severity rule and one of yours cover the same issue, yours wins.
- A line that isn't in this format is ignored, and you're warned when the review starts.
When rules conflict, this order applies, highest first: the instructions you type for a run, your overrides, the project rules, the standard rules, then built-in best practices.
The results panel and downloaded reports list which overrides a review used, under Rules.
To use the same overrides in every project, set reviewDeploy.overrideRulesFile in your User settings to an absolute path or a ~/ path, for example ~/.review-deploy/my-rules.md.
Deploy gate
A component with unresolved critical, high or medium findings can't be deployed until it is fixed and re-reviewed. Dismissing those findings also unblocks it. Low findings never block. To change which severities block, use reviewDeploy.blockingSeverities.
The gate applies to every way of deploying:
| Deploy route |
How it's blocked |
What the developer sees |
| Deploy in the review panel |
The extension refuses to deploy |
A dialog listing each blocking finding |
| SFDX: Deploy This Source to Org, deploy-on-save, manifest deploys (Salesforce Extensions) |
The component is listed in a managed section of .forceignore |
The Salesforce Extensions report the generic error "Expected ComponentSet to be non-empty, but got size 0", which this extension can't change. The full information is shown here instead: a ⛔ badge on the component in the Explorer, a ⛔ Deploy Blocked: Show Why item in the right-click menu (next to SFDX: Deploy), a ⛔ Deploy blocked status bar item while a file of the component is open, and a warning with the findings when deploy-on-save skips it |
sf project deploy start / validate in a terminal |
The sf CLI gate plugin |
The deploy stops with the list of findings. A whole-project deploy goes ahead without the blocked components, with a warning |
sf project deploy start / generate manifest in a VS Code terminal, without the sf CLI gate |
The managed .forceignore section |
sf prints a misleading "NothingToDeploy: No local changes to deploy" (or writes an empty package.xml). Once the command finishes, the extension shows a Deploy blocked notification naming the component and its findings, with Show Findings and Re-review buttons. This needs VS Code 1.93+ with terminal shell integration (on by default) and doesn't apply to terminals outside VS Code |
Review required before deploy
Apex classes and triggers, LWC, Aura and Visualforce can only be deployed once Claude has reviewed their current code. A component that was never reviewed, or that changed since its last review, is reviewed automatically when you deploy it:
| Deploy route |
What happens to a component without an up-to-date review |
sf CLI (sf project deploy start / validate, with the sf CLI gate installed) |
The gate runs the Claude review before sf deploys, printing "Claude is reviewing AccountService…". If the review finds critical, high or medium issues, the deploy stops and lists them. If the review passes, the deploy continues. With --source-dir, --metadata or --manifest, only the components in the deploy are checked. A whole-project deploy checks every component. |
| Deploy-on-save |
When you save, the component is held back from the automatic deploy, and Claude reviews it. If the review passes, the extension deploys it (SFDX: Deploy This Source to Org). If it fails, you get a "Deploy-on-save blocked" message with Show Findings. |
| SFDX: Deploy This Source to Org (right-click) |
The Salesforce Extensions give this extension no way to run code before their deploy, so the review can't run here automatically. Instead, every component without an up-to-date review is held back (via .forceignore) until it's reviewed: code that was never reviewed, code you edited, and code that changed outside VS Code (a git pull, another editor, a script). This is checked when the project opens and whenever source files change on disk. It gets a ⚠ badge in the Explorer, a Review required before deploy status bar item, and a ⛔ Deploy Blocked: Show Why → Review now item in the right-click menu. |
| Deploy in the review panel |
If you've edited the code (or applied a fix) since the review, Claude reviews it again before deploying. |
- Only edits matter. Line-ending differences, for example from a git checkout on another OS, don't count as a change.
- Findings you dismissed are remembered for that component, so automatic re-reviews don't report them again.
- If the review can't run, for example because Claude Code isn't signed in, the sf CLI gate blocks the deploy rather than letting unreviewed code through.
- The sf CLI gate reviews at most
maxAutoReviewComponents components (10 by default) per deploy. A deploy that needs more reviews is blocked, with a list of the components.
- Starting to use this on an existing project: every component that was never reviewed is held back, and a notification says how many. If that code is already trusted, run Review & Deploy: Mark Current Code as Reviewed once (the notification has a button for it). Every component is then recorded as reviewed in its current state, and is only reviewed again when it changes.
- To turn this off and only block components with known findings, set
reviewDeploy.requireReview to false.
How it works:
- Review results are recorded in
.review-deploy/deploy-gate.json. It holds blocked components and their findings, a fingerprint of each component's code at its last review, and the components edited since then. The extension keeps the .forceignore section in sync with it; don't edit that section by hand.
- A component is blocked when its review finishes with blocking findings. It is unblocked when a re-review finds none, or when those findings are dismissed.
- Install the sf CLI gate once per machine. You'll be offered it the first time a component is blocked, or you can run Review & Deploy: Install sf CLI Deploy Gate from the Command Palette. It runs
sf plugins link on a copy kept in ~/.review-deploy/sf-deploy-gate. When the extension is updated, it updates that copy too. It also saves your review settings in ~/.review-deploy/settings.json for the gate. To remove it, run sf plugins unlink review-deploy-gate.
- If you commit
.review-deploy/deploy-gate.json and .forceignore, the block also applies to teammates and CI. If you want the gate to stay on your machine only, keep both files out of commits.
- While a component is blocked, it is also skipped by retrieves, because they read
.forceignore too.
- Review & Deploy: Show Deployment-Blocking Findings lists everything that is blocked. You can jump to a finding or start a re-review from there.
Overrides & bypasses in the report
Anyone reading a review, in the panel or in a downloaded report, can see whether it was weakened and by whom. When anything was overridden, a ⚠ This review was overridden banner appears at the top, followed by two sections after the findings:
- Findings bypassed by overrides: the review findings affected.
- Hidden or downgraded by overrides: issues the team's rules would have reported (or reported higher), but which this review left out or lowered because of a personal rule or one-off instructions. Each one shows the override that applied and the team rule it bypassed.
- Not blocking deployment because of gate settings: findings that would block deployment with the default
blockingSeverities.
- Dismissed by developer: who dismissed each finding, when, and whether it was blocking deployment.
- Override details: the overrides themselves: personal rules (sections replaced or removed, added rules, severity rules, and the file as applied), gate settings below the defaults, and one-off instructions.
The report header also says who ran the review (your git user.name and user.email, or your OS account name).
Setup
No API key is needed. The review runs through the Claude Code CLI (claude -p) and uses your existing Claude Code sign-in. Usage counts against your Claude plan. Each developer needs Claude Code installed and signed in: run claude once in a terminal to sign in.
- Install: search for Salesforce Review & Deploy for Claude Code in the VS Code Extensions view, or run
code --install-extension appsavio.claude-review-deploy.
- Run from source: clone this repository inside your Salesforce DX project, open the clone in VS Code and press F5 (Run Claude Review & Deploy): the development window opens the folder that contains the clone. Or build a package with
npx @vscode/vsce package and use Extensions → … → Install from VSIX. The extension has no npm dependencies.
If the extension can't find claude, set reviewDeploy.claudePath to the full path, for example C:\Users\<you>\.local\bin\claude.exe.
Settings (reviewDeploy.*)
| Setting |
Default |
Purpose |
claudePath |
claude |
Path to the Claude Code CLI (found automatically in ~/.local/bin) |
model |
claude-opus-5-5 |
Claude model |
effort |
high |
Review depth (low … max) |
chatModel |
(empty) |
Model for chatting about a review. Empty uses the project's model (see Chatting about the review) |
chatEffort |
(empty) |
Effort for the chat. Empty uses the project's effort |
rulesFile |
.review-deploy/rules.md |
Project rules, which override the standard rules |
useStandardRules |
true |
Apply the standard rules shipped with the extension underneath the project rules |
overrideRulesFile |
.review-deploy/rules.local.md |
Your personal overrides of the team rules (see Overriding team rules) |
askForInstructions |
true |
Ask for one-off instructions on each click |
blockingSeverities |
["critical","high","medium"] |
Finding severities that block deployment (see Deploy gate) |
requireReview |
true |
Code must have an up-to-date review to deploy. Unreviewed code is reviewed automatically on deploy (see Review required before deploy) |
maxAutoReviewComponents |
10 |
Most components the sf CLI gate reviews automatically for one deploy |
targetOrg |
(empty) |
--target-org alias (empty means the project default) |
maxFiles |
60 |
Most files sent per review |
pdfBrowserPath |
(empty) |
Edge or Chrome executable used to create PDF reports (found automatically when empty) |
| |