initialize-ios

initialize-ios is a command for Claude Code from defendend/Claude-ast-index-search. It costs 18 tokens per session (945 once invoked), scanned A, a copy of initialize-android, MIT.

A setup command for connecting ast-index with an iOS project written in Swift or Objective-C. ast-index helps search the project’s code structure.

In plain words
What is it for?
Use it to check installation, merge ast-index marketplace settings, enable its plugin, and create the project rules file.
Why use it?
It prepares the project configuration and permissions needed for the integration while preserving existing settings.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths.

Part of the ast-index plugin — 1 skill, 7 commands, 3 hooks shipped together

Good fit Use it to check installation, merge ast-index marketplace settings, enable its plugin, and create the project rules file.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/defendend/claude-ast-index-search/initialize-ios
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/defendend/Claude-ast-index-search

Made for: Claude Code.

Or install ast-index, the plugin that ships this one along with the rest of its 1 skill, 7 commands, 3 hooks.

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 initialize-ios

README.md
[![agentmods](https://agentmods.dev/badge/commands/defendend/claude-ast-index-search/initialize-ios.svg)](https://agentmods.dev/commands/defendend/claude-ast-index-search/initialize-ios)
Your own site
<a href="https://agentmods.dev/commands/defendend/claude-ast-index-search/initialize-ios"><img src="https://agentmods.dev/badge/commands/defendend/claude-ast-index-search/initialize-ios.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 945 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 91% copy Near-identical to another mod 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.00018 $0.00945
Opus 5 $0.00009 $0.00473
Sonnet 5 $0.00004 $0.00189
Haiku 4.5 $0.00002 $0.00094

Measured 8d ago against content hash 3c507a13e66e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

initialize-ios 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 8d 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.

Origin

This is a copy

91% identical to initialize-android — 32 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugin/commands/initialize-ios.md · 146 lines

How it starts

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

Initialize ast-index for iOS Project

This command sets up ast-index integration for an iOS/Swift/Objective-C project.

Steps to Execute

1. Check Prerequisites

Verify ast-index is installed:

ast-index version

If not installed, inform user to run:

brew tap defendend/ast-index
brew install ast-index

2. Create/Update .claude/settings.json

First, ensure the directory exists:

mkdir -p .claude

Then create or merge into .claude/settings.json. If file doesn't exist, create it with this content:

{
  "extraKnownMarketplaces": {
    "ast-index": {
      "source": {
        "source": "github",
        "repo": "defendend/Claude-ast-index-search"
      }
    }
  },
  "enabledPlugins": {
    "ast-index@ast-index": true
  },
  "permissions": {
    "allow": [
      "Bash(ya tool ast-index *)",
      "Bash(ast-index *)"
    ]
  }
}

Important: If .claude/settings.json already exists, MERGE the keys (don't replace the whole file).

3. Create .claude/rules/ast-index.md (CRITICAL)

Create the rules directory and ast-index rules file:

mkdir -p .claude/rules

Create file .claude/rules/ast-index.md with this content:

# ast-index Rules

## Mandatory Search Rules

1. **ALWAYS use ast-index FIRST** for any code search task
2. **NEVER duplicate results** — if ast-index found usages/implementations, that IS the complete answer
3. **DO NOT run grep "for completeness"** after ast-index returns results
4. **Use grep/Search ONLY when:**
   - ast-index returns empty results
   - Searching for regex patterns (ast-index uses literal match)
   - Searching for string literals inside code (`"some text"`)
   - Searching in comments content

## Why ast-index

ast-index is 17-69x faster than grep (1-10ms vs 200ms-3s) and returns structured, accurate results.

## Command Reference

| Task | Command | Time |
|------|---------|------|
| Universal search | `ast-index search "query"` | ~10ms |
| Find class/protocol | `ast-index class "ClassName"` | ~1ms |
| Find usages | `ast-index usages "SymbolName"` | ~8ms |
| Find conformances | `ast-index implementations "Protocol"` | ~5ms |
| Call hierarchy | `ast-index call-tree "function" --depth 3` | ~1s |
| Class hierarchy | `ast-index hierarchy "ClassName"` | ~5ms |
| Find callers | `ast-index callers "functionName"` | ~1s |
| Module deps | `ast-index deps "ModuleName"` | ~10ms |
| File outline | `ast-index outline "File.swift"` | ~1ms |

## iOS-Specific Commands

| Task | Command |
|------|---------|
| SwiftUI views | `ast-index swiftui` |
| Async functions | `ast-index async-funcs` |
| @MainActor | `ast-index main-actor` |
| Combine publishers | `ast-index publishers` |
| Storyboard usages | `ast-index storyboard-usages "Class"` |
| Asset usages | `ast-index asset-usages "name"` |

## Index Management

- `ast-index rebuild` — Full reindex (run once after clone)
- `ast-index update` — After git pull/merge
- `ast-index stats` — Show index statistics

Read the full file on GitHub · 146 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. 8d ago First seen · 146 lines · 18 tokens per session scan A 3c507a13e66e

Subscribe to this mod's changes

initialize-ios is a command published in the GitHub repository defendend/Claude-ast-index-search (559 stars, last pushed 3d ago), licensed MIT. It adds 18 tokens to every session and 945 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to initialize-android, differing in 32 lines, and is treated as a copy.