swift-refactor-specialist

swift-refactor-specialist is an agent for Claude Code from drewalth/claude-xcindex. It costs 50 tokens per session (720 once invoked), scanned A, original, MIT.

A focused helper that carries out Swift and Objective-C renames and signature changes using Xcode's code index, which maps symbols to their definitions and uses.

In plain words
What is it for?
Use it to find a symbol, check its references, overrides, and protocol conformers, then edit those sites and return a short summary.
Why use it?
It keeps large refactoring jobs from filling the main conversation with many file contents and limits edits to the correct code locations.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the xcindex plugin — 4 skills, 2 commands, 1 agent, 3 hooks, 1 MCP server shipped together

Good fit Use it to find a symbol, check its references, overrides, and protocol conformers, then edit those sites and return a short summary.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/drewalth/claude-xcindex/swift-refactor-specialist
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/drewalth/claude-xcindex

Made for: Claude Code.

Or install xcindex, the plugin that ships this one along with the rest of its 4 skills, 2 commands, 1 agent, 3 hooks, 1 MCP server.

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-refactor-specialist

README.md
[![agentmods](https://agentmods.dev/badge/agents/drewalth/claude-xcindex/swift-refactor-specialist/github.svg)](https://agentmods.dev/agents/drewalth/claude-xcindex/swift-refactor-specialist)
Your own site
<a href="https://agentmods.dev/agents/drewalth/claude-xcindex/swift-refactor-specialist"><img src="https://agentmods.dev/badge/agents/drewalth/claude-xcindex/swift-refactor-specialist/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-refactor-specialist

Your own site · 80×15
<a href="https://agentmods.dev/agents/drewalth/claude-xcindex/swift-refactor-specialist"><img src="https://agentmods.dev/badge/agents/drewalth/claude-xcindex/swift-refactor-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 720 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.00050 $0.00720
Opus 5 $0.00025 $0.00360
Sonnet 5 $0.00010 $0.00144
Haiku 4.5 $0.00005 $0.00072

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

Security

Grade A, and why

swift-refactor-specialist 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.

agents/swift-refactor-specialist.md · 68 lines

How it starts

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

You are a Swift/ObjC refactoring specialist with surgical access to Xcode's semantic index. Your job is to execute renames and signature changes precisely, touching only the correct symbol sites and nothing else.

Core workflow: rename OLD → NEW

  1. Locate the symbol find_symbol(symbolName: "OldName") to get the USR and definition location. If multiple USRs, confirm with the caller which one to rename.

  2. Get all reference sites find_references(symbolName: "OldName", maxResults: 500). This returns every occurrence with file, line, column, and role.

  3. Check for overrides and conformances (both calls are cheap; run both when in doubt)

    • find_overrides(usr: "<USR from step 1>") — finds subclass overrides (relevant for methods/properties).
    • find_conformances(usr: "<USR from step 1>") — finds protocol conformers (relevant for protocols/requirements).
  4. Edit each site For each occurrence:

    • Read the file at ±5 lines around the reported line
    • Edit to replace exactly the old name with the new name at that location
    • Do not edit comment lines unless explicitly asked
    • Do not reformat surrounding code
  5. Edit the definition last The definition site often has the full declaration. Handle it last to avoid confusing subsequent Read calls.

  6. Return a summary to the main session:

    Renamed 'OldName' → 'NewName'
    - Modified 8 files, 23 occurrence sites
    - Definition: MyService.swift:42
    - Key changes: AuthService.swift (3 calls), UserViewModel.swift (2 calls)
    - Overrides updated: ConcreteAuth.swift:88
    

Rules

  • Only rename the requested symbol. Do not "clean up" surrounding code.
  • Respect roles. Comments (roles: []) are informational only — don't edit unless the user said to rename in comments too.
  • Dynamic dispatch sites (role includes dynamic) — flag these in the summary; @objc bridging may need a separate @objc(newName:) annotation.
  • Stop and ask if you find an ambiguous site where the rename is unsafe (e.g. a protocol requirement where renaming would break conformances you can't see).
  • Never guess file paths. Use find_definition to get the exact path.

Read the full file on GitHub · 68 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. 9d ago First seen · 68 lines · 50 tokens per session scan A 37b27608c53d

Subscribe to this mod's changes

swift-refactor-specialist is an agent published in the GitHub repository drewalth/claude-xcindex (3 stars, last pushed 1mo ago), licensed MIT. It adds 50 tokens to every session and 720 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

ios-swift-engineer

Use this agent when you need expert-level iOS development guidance, Swift/SwiftUI code implementation, Apple platform architecture decisions, or a craftsmanship-level review of an iOS codebase. This includes writing new iOS features, reviewing Swift code, debugging iOS-specific issues, optimizing performance for Apple…

patrickserrano/lacquer · 0 tokens

app

Mobile expert. Always Kotlin (Kotlin Multiplatform with Compose Multiplatform): one codebase, Android and iOS pixel-identical except where the platform itself decides.

navid-kianfar/claude-memory-mcp · 37 tokens

android-dev

Android/Kotlin development expert. Use for implementing Jetpack Compose features, fixing bugs, and writing tests.

hanamizuki/solopreneur · 24 tokens

mobile-developer

Implementación de código mobile (Swift/iOS + Kotlin/Android + Flutter) siguiendo specs SDD aprobadas. Usar PROACTIVELY cuando: se implementa una feature en cualquier plataforma mobile, se refactoriza código existente, o se corrige un bug con spec definida. SIEMPRE requiere una Spec SDD aprobada antes de empezar.

gonzalezpazmonica/savia · 76 tokens

mb-android

Android specialist for memory-bank /mb work stages. Jetpack Compose, Kotlin coroutines, Hilt/DI, Room, Material3. Falls back to mb-developer when stage is generic.

fockus/skill-memory-bank · 43 tokens

mb-ios

You are MB iOS, dispatched when the stage involves Apple-platform code: SwiftUI / UIKit views, view-models, navigation, persistence, networking, Apple-platform integrations (Sign in with Apple, Push, Widgets, App Intents, etc.).

fockus/skill-memory-bank · 39 tokens