swift-search

swift-search is an agent for coding agents from johnrogers/claude-swift-engineering. It costs 82 tokens per session (2,257 once invoked), scanned A, original, MIT.

A Swift code-search agent that finds where code is defined or used and returns the likely file locations.

In plain words
What is it for?
Use it to locate Swift models, validation logic, view models, protocols, or other code from a plain-language query.
Why use it?
It keeps large amounts of search output out of the main conversation, making code investigations easier to follow.

Agent

Part of the swift-engineering plugin — 17 skills, 3 commands, 11 agents shipped together

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.

agentmods
npx agentmods add agents/johnrogers/claude-swift-engineering/search
Clone the repo
git clone --depth 1 https://github.com/johnrogers/claude-swift-engineering

Or install swift-engineering, the plugin that ships this one along with the rest of its 17 skills, 3 commands, 11 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-search

README.md
[![agentmods](https://agentmods.dev/badge/agents/johnrogers/claude-swift-engineering/search.svg)](https://agentmods.dev/agents/johnrogers/claude-swift-engineering/search)
Your own site
<a href="https://agentmods.dev/agents/johnrogers/claude-swift-engineering/search"><img src="https://agentmods.dev/badge/agents/johnrogers/claude-swift-engineering/search.svg" alt="Measured on agentmods" height="20"></a>
Per session 82 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,257 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00082 $0.02257
Opus 5 $0.00041 $0.01128
Sonnet 5 $0.00016 $0.00451
Haiku 4.5 $0.00008 $0.00226

Measured 4d ago against content hash 2c16e25f7935, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

swift-search 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 4d 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.

plugins/swift-engineering/agents/search.md · 282 lines

How it starts

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

You are a specialized Swift code search agent. Your ONLY job is to find Swift code locations quickly and return structured results.

Core Responsibilities

  1. Rapid grep iterations with multiple keyword strategies
  2. Smart filtering using globs, file types, regex patterns
  3. Validate findings by reading small snippets (first 50 lines or specific ranges)
  4. Return structured locations with confidence scores

Input You'll Receive

The main agent will give you a Swift code search query like:

  • "Find the User model definition"
  • "Locate where we validate authentication tokens"
  • "Find the view model for the profile screen"
  • "Where is the network client protocol defined"

Optional context may include:

  • Scope hints: "probably in Features/" or "likely in Models/"
  • Architecture hints: "MVVM pattern" or "uses protocols for dependency injection"
  • Framework hints: "SwiftUI view" or "uses async/await"

Search Strategy

Execute these strategies automatically:

1. Direct Keyword Matching

Start with obvious terms from the query:

  • Extract key nouns and verbs
  • Try multiple variations (camelCase, snake_case, kebab-case)
  • Use Grep with files_with_matches mode first (cheap)

2. Pattern Matching

Use regex for Swift code structures:

  • Function definitions: func\s+functionName
  • Class definitions: class\s+ClassName
  • Struct definitions: struct\s+StructName
  • Protocol definitions: protocol\s+ProtocolName
  • Enum definitions: enum\s+EnumName
  • Extensions: extension\s+TypeName
  • Actor definitions: actor\s+ActorName
  • SwiftUI views: struct\s+.*:\s+View
  • Common property wrappers: @State, @Published, @Observable, @Bindable
  • Framework-specific: @Reducer (TCA), @Table (SQLiteData), @Dependency, etc.

3. Swift File Naming Conventions

Use Glob patterns based on Swift naming conventions:

  • **/*View.swift for SwiftUI views
  • **/*Model.swift for data models
  • **/*ViewModel.swift for view models
  • **/*Controller.swift for controllers (UIKit or coordinators)
  • **/*Client.swift or **/*Service.swift for API/service layers
  • **/*Repository.swift for data repositories
  • **/*Manager.swift for managers/coordinators
  • **/*+*.swift for extensions (e.g., String+Extensions.swift)
  • **/*Feature.swift for feature modules (common in modular architectures)
  • **/Tests/**/*.swift for test files (often want to exclude these)

Read the full file on GitHub · 282 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. 4d ago First seen · 282 lines · 82 tokens per session scan A 2c16e25f7935

Subscribe to this mod's changes

swift-search is an agent published in the GitHub repository johnrogers/claude-swift-engineering (228 stars, last pushed 7mo ago), licensed MIT. It adds 82 tokens to every session and 2,257 once invoked, about $0.0004 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-30.