setup

setup is a command for Claude Code from drewalth/claude-xcindex. It costs 39 tokens per session (1,013 once invoked), scanned A, original, MIT.

A setup command for xcindex that checks its Swift program, finds an Xcode project, optionally builds it, and tests the connection to its agent tools.

In plain words
What is it for?
For preparing xcindex in an Xcode project and verifying that its symbol index and MCP tools work. MCP is a standard way for an agent to call external tools.
Why use it?
It helps diagnose missing binaries, project locations, or index setup before you use xcindex.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

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

Good fit For preparing xcindex in an Xcode project and verifying that its symbol…

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add drewalth/claude-xcindex
Claude Code
/plugin install 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 setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/drewalth/claude-xcindex/xcindex-setup.svg)](https://agentmods.dev/commands/drewalth/claude-xcindex/xcindex-setup)
Your own site
<a href="https://agentmods.dev/commands/drewalth/claude-xcindex/xcindex-setup"><img src="https://agentmods.dev/badge/commands/drewalth/claude-xcindex/xcindex-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 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,013 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.00039 $0.01013
Opus 5 $0.00019 $0.00507
Sonnet 5 $0.00008 $0.00203
Haiku 4.5 $0.00004 $0.00101

Measured 6d ago against content hash 971b112d688b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

setup 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 6d 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.

commands/xcindex-setup.md · 102 lines

How it starts

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

Run the xcindex setup sequence for the current working directory. Walk through each step in order, reporting progress between steps. Stop and ask the user before any xcodebuild invocation.

1. Verify the Swift binary

Check that ${CLAUDE_PLUGIN_ROOT}/bin/xcindex exists and is executable. If it doesn't, run ${CLAUDE_PLUGIN_ROOT}/bin/run </dev/null once to let the launcher download or symlink the binary (it exits cleanly after spawning its subprocess with an immediate EOF on stdin). If download fails and the repo contains service/Package.swift, offer to fall back to cd service && swift build -c release and report the built path.

If no binary can be obtained, stop here and tell the user what's missing (network, Swift toolchain, or a valid release for their plugin version).

2. Diagnostic scan

Find the Xcode project in the current working directory. Prefer .xcworkspace over .xcodeproj; look in the cwd and one level up; skip */Pods/* and */.git/* paths. This mirrors the detection logic in hooks/session-start.sh.

Resolve the DerivedData directory:

  • Default: ~/Library/Developer/Xcode/DerivedData/<ProjectName>-*, most recently modified.
  • Check for a custom location: defaults read com.apple.dt.Xcode IDECustomDerivedDataLocation.

Report:

  • Project path found (or "none detected").
  • Index store path (or "index store not present").
  • Last-build timestamp, if the index exists.
  • Any source files with mtime newer than the index.

3. Decide whether to build

If no .xcodeproj / .xcworkspace was found, stop — there's nothing to build. Confirm the binary works and exit.

If the index exists and is not stale, tell the user xcindex is ready and offer to skip the build. Only proceed if they want to force a rebuild.

If the index is missing or stale, use AskUserQuestion to confirm before invoking xcodebuild — building can take minutes and uses significant CPU. Offer two options:

  • "Build all schemes now" (recommended if the user just cloned or hasn't built recently).
  • "Skip — I'll build in Xcode myself."

Read the full file on GitHub · 102 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. 6d ago First seen · 102 lines · 39 tokens per session scan A 971b112d688b

Subscribe to this mod's changes

setup is a command published in the GitHub repository drewalth/claude-xcindex (3 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 1,013 once invoked, about $0.0002 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.