swift-audit

swift-audit is a command for Claude Code from SethCalkins/claude-ios-swift-plugin. It costs 13 tokens per session (496 once invoked), scanned A, original, MIT.

A command that checks Swift source code for common concurrency problems. Concurrency means running work at the same time, and Swift’s newer rules require shared data and UI work to be handled safely.

In plain words
What is it for?
Use it to audit a Swift file, directory, or project and receive findings grouped by severity with file locations and suggested fixes.
Why use it?
It highlights unsafe shared state, missing UI isolation, questionable Sendable usage, and tasks that may not cancel correctly.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the swift-skills plugin — 10 skills, 4 commands, 3 agents shipped together

Good fit Use it to audit a Swift file, directory, or project and receive findings grouped by severity with file locations and suggested fixes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/sethcalkins/claude-ios-swift-plugin/swift-audit
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/SethCalkins/claude-ios-swift-plugin

Made for: Claude Code.

Or install swift-skills, the plugin that ships this one along with the rest of its 10 skills, 4 commands, 3 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 swift-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/sethcalkins/claude-ios-swift-plugin/swift-audit/github.svg)](https://agentmods.dev/commands/sethcalkins/claude-ios-swift-plugin/swift-audit)
Your own site
<a href="https://agentmods.dev/commands/sethcalkins/claude-ios-swift-plugin/swift-audit"><img src="https://agentmods.dev/badge/commands/sethcalkins/claude-ios-swift-plugin/swift-audit/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 swift-audit

Your own site · 80×15
<a href="https://agentmods.dev/commands/sethcalkins/claude-ios-swift-plugin/swift-audit"><img src="https://agentmods.dev/badge/commands/sethcalkins/claude-ios-swift-plugin/swift-audit.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 496 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.00496
Opus 5 $0.00006 $0.00248
Sonnet 5 $0.00003 $0.00099
Haiku 4.5 $0.00001 $0.00050

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

Security

Grade A, and why

swift-audit 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 9d 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/swift-audit.md · 71 lines

What it actually says

Swift Concurrency Audit

Analyze Swift files for concurrency issues, focusing on Swift 6.2+ patterns.

Instructions

  1. Determine scope:

    • If argument provided, audit that file or directory
    • If no argument, detect current context:
      • If a Swift file is open/recent, audit that file
      • Otherwise, audit the entire Sources/ or project Swift files
  2. Find Swift files:

    • Use Glob to find **/*.swift files in the target scope
    • Exclude test files unless explicitly requested
  3. Analyze each file for these concurrency issues:

    • Missing @MainActor on UI-bound types
    • @unchecked Sendable usage (flag for review)
    • Global/static mutable state without actor isolation
    • Protocol conformances missing isolation annotations
    • Async functions that should be nonisolated or @concurrent
    • Task creation without proper cancellation handling
  4. Check project settings:

    • Look for Package.swift or .xcodeproj concurrency settings
    • Note Swift language version and strict concurrency level
  5. Report findings:

    • Group by severity: errors, warnings, suggestions
    • Include file path and line number
    • Provide specific fix recommendations
    • Reference swift-concurrency-expert skill for detailed fixes

Output Format

## Swift Concurrency Audit Results

### Scope: [files audited]

### Errors (must fix)
- `File.swift:42` - Global mutable state `var cache` needs actor isolation

### Warnings (should fix)
- `ViewModel.swift:15` - UI-bound class missing `@MainActor`

### Suggestions
- `Service.swift:88` - Consider making `fetchData()` nonisolated

### Summary
- X errors, Y warnings, Z suggestions
- Project concurrency level: [strict/complete/minimal]

Tips

  • For detailed remediation, invoke the swift-concurrency-expert skill
  • Use --strict argument to also flag potential issues (not just definite problems)
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. 9d ago First seen · 71 lines · 13 tokens per session scan A 2fc0efdf40de

Subscribe to this mod's changes

swift-audit is a command published in the GitHub repository SethCalkins/claude-ios-swift-plugin (2 stars, last pushed 7mo ago), licensed MIT. It adds 13 tokens to every session and 496 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.