LaunchKit · 2026
Back to Skills

swiftfindrefs

Use swiftfindrefs (IndexStoreDB) to list every Swift source.

1
1.6k downloads
by @michaelversus

Setup & Installation

openclaw skills install @michaelversus/swiftfindrefs

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install swiftfindrefs

Version History

v1.0.5Jan 31, 2026 - Version note by skill developer:

- Added installation instructions using Homebrew for swiftfindrefs. - Updated optional argument: replaced --derivedDataPath with --dataStorePath for specifying IndexStoreDB location.

What This Skill Does

swiftfindrefs queries Xcode's IndexStore (DerivedData) to return every Swift source file that references a given symbol. It covers classes, structs, enums, protocols, functions, and variables across modules. Output is one absolute file path per line, deduplicated and safe to pipe.

grep and IDE search operate on text and miss references that the compiler resolved through type inference or module re-exports, while IndexStoreDB reflects what was actually compiled.

When to use it

  • Finding all callers of a function before renaming it
  • Auditing files affected by moving a type to a new module
  • Adding missing imports only to files that reference a relocated symbol
  • Confirming a symbol is unused before deleting it
  • Scoping a cross-module refactor to exactly the files that matter

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: find all Swift files referencing UserSession before renaming it

AGENT
  1. 1Run swiftfindrefs --projectName MyApp --symbolName UserSession --symbolType class
  2. 2Collect the list of absolute file paths from stdout
  3. 3Open only those files to review call sites
  4. 4Rename UserSession in each returned file
  5. 5Verify no other files were changed
OUTPUT

A deduplicated list of absolute paths to every .swift file referencing UserSession, ready for targeted edits

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

Xcode installed on macOS (project must be built at least once to populate DerivedData)swiftfindrefs CLI installed via Homebrew: brew tap michaelversus/SwiftFindRefs https://github.com/michaelversus/SwiftFindRefs.git && brew install swiftfindrefs