I Built a Salesforce Org Audit Tool With Claude Code and Zero Lines of Code

Here is what a few focused hours of AI-assisted development actually looks like.

Let me show you something that changed how I think about building tools.

Salesforce is where I spend most of my time. I direct projects, make architecture decisions, and write code when needed. So the question I wanted to answer was straightforward: could I use Claude Code to build a complete, production-worthy tool faster than I ever could alone?

The answer was yes. And the tool is live on GitHub right now.

Here is the full story: what I set out to prove, what the tool does, how it keeps your org data safe, and how you can run it today.

The tool its not perfect, its work in progress and it can always be improved

The Goal: Build Something Real

Let me be direct about what I was testing.

The promise of AI-assisted development is that the distance between “I have an idea” and “the idea exists as working software” is getting much shorter. I wanted to find out if that was true for a real Salesforce tool with proper architecture, not just a quick utility script.

So I sat down with Claude Code and described the problem. Salesforce orgs accumulate technical debt silently. Security configurations drift. Automation ages out. Test coverage slips. Nobody audits regularly because it takes too long to do manually.

What if there was a tool that did it automatically, scored the results, and produced a report you could hand to a stakeholder?

I described that vision. Claude Code built it. A few focused hours later, the tool was working.

Throughout the build, my role was product manager and architect. Requirements were mine to define. Every design decision went through me, and when something wasn’t right, I pushed back. Claude Code handled the rest. Every agent, every scoring function, and every PDF generation script.

That distinction matters. And it is actually the point.

What the Tool Does

The tool is called AI Salesforce Audit with Claude Code. It is open source, free, and installs in one command.

It runs 9 parallel AI agents against your Salesforce org. Each agent owns one audit domain. They all run at the same time and return scored findings to an orchestrator. The orchestrator applies a weighted formula and produces a composite Org Health Score from 0 to 100, with a letter grade from A+ to F.

You also get two output files automatically:

  • SF-AUDIT.md for full findings in structured Markdown
  • SF-AUDIT-REPORT.pdf for an executive-ready report with a priority action matrix

Here is what each of the 9 domains audits.

The 9 Audit Domains

1. Security and Access (20% weight)

This is the highest-weighted domain, and deliberately so. A single misconfigured profile can expose every record in your org. The security agent checks:

  • Profiles with Modify All Data or View All Data permissions
  • Permission set sprawl and over-permissioned users
  • Object-Wide Default sharing settings
  • MFA enforcement status
  • IP restrictions and session policies
  • Login failure patterns and suspicious activity
  • Stale active users with no login in 90+ days

Security carries 20% of the composite score because the blast radius of an access control failure is immediate and organisation-wide. No other domain has that risk profile.

2. Data Quality (15% weight)

Bad data degrades every downstream process that depends on your CRM. This agent checks:

  • Contact completeness: Email, Phone, Account linkage
  • Account completeness: Industry, Type, Phone, BillingCity
  • Lead hygiene: stale open leads and missing email addresses
  • Opportunity hygiene: stale pipeline and overdue close dates
  • Active duplicate rules coverage
  • Orphaned and unlinked records

3. Automation Health (15% weight)

Most Salesforce orgs are carrying automation debt they have not dealt with yet. This agent surfaces it:

  • Active Flows inventory and error analysis
  • Process Builder processes (deprecated, migration required)
  • Workflow Rules (deprecated, migration required)
  • Apex trigger quality: handler pattern and multi-trigger conflicts
  • Validation rule documentation quality
  • Legacy automation debt score

Process Builder and Workflow Rules are both deprecated by Salesforce. If your org still runs them, this is urgent work, not someday work.

4. Org Architecture (12% weight)

Governor limits and API version debt cause deployment failures. The architecture agent checks:

  • Governor limit consumption: API calls, data storage, file storage
  • Custom object and field sprawl versus edition limits
  • Apex class API version distribution
  • Classes not modified in 2+ years (dead code risk)
  • Installed managed packages and license utilisation
  • Custom Settings versus Custom Metadata Types usage

5. Test Coverage (8% weight)

Low Apex test coverage does not just feel bad. It blocks production deployments. This agent checks:

  • Org-wide Apex test coverage percentage
  • Classes and triggers below the 75% deployment threshold
  • Recent test run results and failure analysis
  • Test class quality and test-to-production ratio

6. Naming Conventions (8% weight)

Inconsistent naming slows every developer who joins your project. The naming agent checks:

  • Apex class suffix compliance (Controller, Service, Handler, Batch, etc.)
  • Trigger naming pattern ([Object]Trigger)
  • Custom field naming quality with no generic or single-character names
  • Flow and validation rule naming standards

You can also configure this agent with your own naming standards using a local config file. No need to edit installed files.

7. Orphaned Metadata (8% weight)

Dead metadata adds overhead and deployment risk without delivering any value. This agent finds:

  • Inactive Flows with no active version
  • Deactivated validation rules and workflow rules
  • Custom fields unmodified for 365+ days

8. Description Completeness (7% weight)

Missing documentation compounds over time. Organisations that skip descriptions today inherit confusion tomorrow. The agent checks:

  • Missing inline help text on custom fields
  • Flows and validation rules without descriptions
  • Custom objects without descriptions
  • Apex classes without doc comments

9. Custom Field Sprawl (7% weight)

Objects with 100+ custom fields are a design warning sign. This agent flags:

  • Objects with 100+ custom fields (critical)
  • Objects with 50 to 99 custom fields (warning)
  • Fields unmodified for 2+ years
  • Duplicate-purpose fields on the same object

The Scoring System

Each domain scores 0 to 100. The orchestrator applies the weighted formula to produce a single composite Org Health Score.

Score Grade What It Means
90–100 A+ Excellent, production-grade org
80–89 A Strong, minor improvements recommended
70–79 B Good, some areas need attention
60–69 C Fair, multiple risk areas identified
50–59 D Poor, significant remediation required
< 50 F Critical, immediate action required

The grade is a forcing function for conversation. Telling your CTO “our Flows are a mess” is vague. Telling them “we scored 58 out of 100, Automation Health is at 34 and Test Coverage is at 41, here is the priority action matrix” is a business conversation.

You can also override domain weights with a local config file. If your org deprioritises naming conventions, set that weight to 0 and redistribute elsewhere.

Is It Safe? Understanding the Security Model

This is the question most Salesforce professionals ask first, and it deserves a direct answer.

The tool is read-only by design. It uses only SOQL queries and Tooling API calls. It does not:

  • Modify any data or configuration in your org
  • Store your org data anywhere outside your local Claude Code session
  • Transmit org data to any external service
  • Require System Administrator credentials beyond what SOQL and Tooling API access needs

Your audit data never leaves your machine. Everything runs locally within your Claude Code session. When the session ends, the session context is gone. What remains are the output files saved locally on your machine.

The recommended user for running the audit is a System Administrator profile. That is not because the tool needs write access. It is because some queries (LoginHistory, PermissionSets, Tooling API metadata) require sufficient read permissions to return complete results. A lower-privileged user will get partial results.

A few specific points worth knowing:

  • MFA enforcement status cannot always be determined via SOQL alone. The tool flags this and recommends manual verification in Setup under Identity Verification.
  • Sharing rules beyond Object-Wide Defaults require Metadata API access. The audit covers OWDs and notes that detailed sharing rules need manual review.
  • Field-Level Security is assessed heuristically. A complete FLS audit requires Metadata API retrieval for every Profile and Permission Set, so the tool flags patterns rather than exhaustive gaps.
  • Flow Interview Logs require Flow Debug Logging to be enabled in your org. The tool adapts when these are not available.

Run it on a sandbox first. Then production. The tool will not change anything it reads.

How to Install and Run It

Prerequisites

You need three things installed before running the tool:

Authenticate your org with:

bash
sf org login web --alias my-org

For PDF reports, you also need Python 3 and reportlab:

bash
pip3 install reportlab

Install

One command:

bash
curl -fsSL https://raw.githubusercontent.com/iaesteman/ai-salesforce-audit-claude/main/install.sh | bash

Then start a new Claude Code session so the installed skills load.

Run a Full Audit

/sf-audit [org-alias]

All 9 agents run in parallel. You get SF-AUDIT.md and SF-AUDIT-REPORT.pdf.

Run a Single Domain

Every domain is also available as a standalone command:

Command Domain
/sf-audit-security Security and Access
/sf-audit-data Data Quality
/sf-audit-automation Automation Health
/sf-audit-architecture Org Architecture
/sf-audit-coverage Test Coverage
/sf-audit-naming Naming Conventions
/sf-audit-orphaned Orphaned Metadata
/sf-audit-descriptions Description Completeness
/sf-audit-field-sprawl Custom Field Sprawl

Add [org-alias] to any command to target a specific authenticated org.

Audit All Your Orgs

/sf-audit-all

This audits every authenticated org and produces a comparison table. Useful for comparing sandbox health against production.

What the Output Looks Like

The PDF report has four sections:

  1. Cover page with Org Health Score, letter grade, and timestamp
  2. Executive Summary written in plain English for non-technical stakeholders
  3. Priority Action Matrix with findings categorised as Critical, Important, or Strategic
  4. Detailed Domain Findings with full results for all 9 domains

The executive summary section was a deliberate design choice. Audit tools typically produce output for the person who ran the audit. But findings need to reach people who did not run it. The PDF bridges that gap.

What This Build Actually Proved

I said at the start that I wanted to test something. Here is what I found out.

The constraint on building tools is no longer “can I write the code.” For well-defined problems, Claude Code handles the code reliably and completely. The real constraint is whether you can describe the problem clearly enough.

That is a different skill. And it is one that Salesforce professionals, admins, architects, consultants, and business analysts already have.

The ability to specify requirements, reason about tradeoffs, push back on incomplete solutions, and iterate toward something production-ready is not a developer skill. It is a thinking skill. And it applies directly to building with AI.

This tool took a few focused hours. It covers 9 audit domains, produces scored, graded, PDF-formatted reports. Is an open source, free, and ready to use.

That ratio of hours spent to a production-grade tool is going to keep improving. The question for Salesforce professionals is not whether to engage with this. It is when.

Try It

The repo is live and public:

github.com/iaesteman/ai-salesforce-audit-claude

Start on a sandbox. Run /sf-audit. See what number your org gets.

Then decide whether you want to explain that number or improve it.

Share this article...

As Managing Partner and CTO at codeSTREETS, I help global businesses scale through robust Salesforce architecture and custom software solutions. With 10+ years of experience in enterprise transformation, I lead teams to deliver results-driven, future-ready digital platforms. My expertise spans cloud architecture, product innovation, and mentorship, earning recognition as a speaker and community leader. Let’s connect if you’re seeking tailored solutions, seamless implementation, or strategic partnerships to accelerate your business growth.

Leave a Reply

Your email address will not be published. Required fields are marked *