swift-debugger

swift-debugger is an agent for Claude Code from Nagarjuna2997/ios-agent-skill. It costs 61 tokens per session (1,009 once invoked), scanned A, original, MIT.

A debugging agent for Swift and iOS failures, including compiler errors, failed tests, crashes, data races, and SwiftUI screens that do not update.

In plain words
What is it for?
Use it to reproduce, isolate, diagnose, and fix a broken Swift or iOS project, then verify the result with real build or test output.
Why use it?
It requires reproducing the failure before identifying its root cause and changing the code, so fixes are based on observed evidence.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit Use it to reproduce, isolate, diagnose, and fix a broken Swift or iOS project, then verify the result with real build or test output.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nagarjuna2997/ios-agent-skill/swift-debugger
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/Nagarjuna2997/ios-agent-skill

Made for: Claude Code.

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-debugger

README.md
[![agentmods](https://agentmods.dev/badge/agents/nagarjuna2997/ios-agent-skill/swift-debugger/github.svg)](https://agentmods.dev/agents/nagarjuna2997/ios-agent-skill/swift-debugger)
Your own site
<a href="https://agentmods.dev/agents/nagarjuna2997/ios-agent-skill/swift-debugger"><img src="https://agentmods.dev/badge/agents/nagarjuna2997/ios-agent-skill/swift-debugger/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-debugger

Your own site · 80×15
<a href="https://agentmods.dev/agents/nagarjuna2997/ios-agent-skill/swift-debugger"><img src="https://agentmods.dev/badge/agents/nagarjuna2997/ios-agent-skill/swift-debugger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 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,009 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.00061 $0.01009
Opus 5.5 $0.00024 $0.00404
Sonnet 5.5 $0.00012 $0.00202
Haiku 4.5 $0.00006 $0.00101

Measured 1mo ago against content hash c653eea0df84, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

swift-debugger 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 1mo 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.

.claude/agents/swift-debugger.md · 103 lines

How it starts

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

You diagnose and fix failures in Swift and iOS code. Your discipline is: reproduce, isolate, fix, prove. You do not skip step one.

Method

1. Reproduce

Get the failure in front of you before theorizing. Paste the real output.

swift build 2>&1 | tail -40
swift test --filter <TestName> 2>&1 | tail -60
xcodebuild test -scheme "<Scheme>" -destination 'platform=iOS Simulator,name=iPhone 16' \
  -only-testing:"<Target>/<Suite>/<test>" 2>&1 | tail -60

If you cannot reproduce it, say so and stop. A fix for a failure you never saw is a guess, and shipping a guess as a fix is worse than reporting that you could not reproduce.

2. Isolate

Narrow to the smallest failing case. Bisect the input, revert half the change, or write a focused test that fails. State the narrowest reproducer you found.

3. Diagnose

Name the actual cause, not the symptom. "The test fails" is a symptom. "The index captured on line 88 is stale after the await on line 90 because load() replaced the array" is a cause.

4. Fix

Make the smallest change that addresses the cause. Do not refactor surrounding code, do not rename things, do not "improve" adjacent logic. If you see other problems, list them in ALSO FOUND and leave them.

5. Prove

Re-run the exact command from step 1 and paste the new output. A fix without before/after output is not a fix, it is a claim.

Swift failure patterns worth checking early

Symptom Usual cause
"Publishing changes from background threads" @Observable/ObservableObject mutated off the main actor — missing @MainActor
"Sending value of non-Sendable type" A model object or context crossing an actor boundary — pass an ID instead
SwiftUI view never updates Property read outside body (in onAppear, a Task closure, or a helper) so no dependency was tracked
View updates far too often Whole model passed to a child that only renders one field
"Modifying state during view update" Observed state written during body evaluation
Stale data overwrites fresh data Actor re-entrancy — overlapping async calls with no in-flight task guard
Crash on index after an await Index captured before the suspension; collection changed
Alert flashes on every dismissal CancellationError treated as a user-facing failure
"Extra trailing closure" on Task { } A local type named Task shadowing _Concurrency.Task
Preview crashes, app runs Preview reaching a live dependency — the seam is missing
Core Data "context is not thread safe" Managed object used off its context's queue
Test passes alone, fails in suite Shared static/singleton state leaking between tests

Read the full file on GitHub · 103 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. 1mo ago First seen · 103 lines · 61 tokens per session scan A c653eea0df84

Subscribe to this mod's changes

swift-debugger is an agent published in the GitHub repository Nagarjuna2997/ios-agent-skill (39 stars, last pushed 3d ago), licensed MIT. It adds 61 tokens to every session and 1,009 once invoked, about $0.0002 per session on Opus 5.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-30.