org-health

org-health is a command for Claude Code from bhanu91221/sfdx-iq. It costs 13 tokens per session (1,165 once invoked), scanned A, original, MIT.

A command that checks a Salesforce organization for security weaknesses, resource-limit usage, test coverage, unused components, permission complexity, and technical debt.

In plain words
What is it for?
Use it to assess a connected Salesforce production org, sandbox, scratch org, or developer edition and produce a health report.
Why use it?
It brings several important Salesforce maintenance checks into one review instead of requiring separate manual investigations.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the sfdx-iq plugin — 20 commands, 7 agents shipped together

Good fit Use it to assess a connected Salesforce production org, sandbox, scratch org, or developer edition and produce a health report.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/bhanu91221/sfdx-iq/org-health
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bhanu91221/sfdx-iq

Made for: Claude Code.

Or install sfdx-iq, the plugin that ships this one along with the rest of its 20 commands, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for org-health

README.md
[![agentmods](https://agentmods.dev/badge/commands/bhanu91221/sfdx-iq/org-health/github.svg)](https://agentmods.dev/commands/bhanu91221/sfdx-iq/org-health)
Your own site
<a href="https://agentmods.dev/commands/bhanu91221/sfdx-iq/org-health"><img src="https://agentmods.dev/badge/commands/bhanu91221/sfdx-iq/org-health/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for org-health

Your own site · 80×15
<a href="https://agentmods.dev/commands/bhanu91221/sfdx-iq/org-health"><img src="https://agentmods.dev/badge/commands/bhanu91221/sfdx-iq/org-health.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,165 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.01165
Opus 5 $0.00006 $0.00583
Sonnet 5 $0.00003 $0.00233
Haiku 4.5 $0.00001 $0.00117

Measured 12d ago against content hash dce1ef0022ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

org-health scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/org-health.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/org-health

Run a comprehensive health check on a Salesforce org assessing security settings, governor limits usage, code coverage, unused components, permission complexity, and overall technical debt.

Workflow

  1. Validate org connection

    • Confirm an org is connected: run sf org display
    • If no default org is set, prompt the user to specify one
    • Identify org type: production, sandbox, scratch, developer edition
    • Record org limits baseline for comparison
  2. Delegate to specialized agents

    • metadata-analyst: Scan all metadata for unused components, complexity metrics, and dependency issues
    • security-reviewer: Assess security posture across code and configuration
  3. Security assessment

    • Check with sharing usage across all Apex classes — flag classes using without sharing or with no sharing declaration
    • Verify CRUD/FLS enforcement in SOQL queries: WITH SECURITY_ENFORCED or Schema.SObjectType checks
    • Scan for SOQL injection vulnerabilities: string concatenation in queries
    • Check for hardcoded credentials, API keys, or sensitive data in Apex code
    • Review session settings: timeout, IP restrictions, login hours
    • Assess password policies if accessible
    • Check for overly permissive profiles or permission sets
  4. Governor limits assessment

    • Run: sf org list limits --target-org <org> to get current limits usage
    • Flag limits approaching thresholds:
      • Over 80%: Warning
      • Over 90%: Critical
    • Key limits to check:
      • Data Storage and File Storage usage
      • API Request limit (daily)
      • Streaming API events
      • Custom metadata types count
      • Custom objects count
    • Identify Apex classes most likely to hit governor limits based on code patterns
  5. Code coverage analysis

    • Run: sf apex get test --code-coverage --target-org <org> or query ApexCodeCoverageAggregate
    • Report overall org code coverage percentage
    • Identify classes below 75% coverage (deployment risk)
    • Identify classes with 0% coverage (no tests at all)
    • List classes between 75%-90% (improvement candidates)
    • Flag any test classes that are themselves failing

Read the full file on GitHub · 110 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 110 lines · 13 tokens per session scan A dce1ef0022ec

Subscribe to this mod's changes

org-health is a command published in the GitHub repository bhanu91221/sfdx-iq (2 stars, last pushed 4mo ago), licensed MIT. It adds 13 tokens to every session and 1,165 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.