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.
npx agentmods add commands/defendend/claude-ast-index-search/initialize-androidgit clone --depth 1 https://github.com/defendend/Claude-ast-index-searchWrote 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.
[](https://agentmods.dev/commands/defendend/claude-ast-index-search/initialize-android)<a href="https://agentmods.dev/commands/defendend/claude-ast-index-search/initialize-android"><img src="https://agentmods.dev/badge/commands/defendend/claude-ast-index-search/initialize-android.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00017 | $0.00932 |
| Opus 5 | $0.00009 | $0.00466 |
| Sonnet 5 | $0.00003 | $0.00186 |
| Haiku 4.5 | $0.00002 | $0.00093 |
Grade A, and why
initialize-android 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.
Copies of this mod
5 near-identical copies found in the catalogue:
- initialize-csharp — 92% identical, 62 lines differ
- initialize-ios — 91% identical, 32 lines differ
- initialize-web — 86% identical, 59 lines differ
- initialize-ruby — 86% identical, 52 lines differ
- initialize-rust — 86% identical, 48 lines differ
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 Android Project
This command sets up ast-index integration for an Android/Kotlin/Java 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 | `ast-index class "ClassName"` | ~1ms |
| Find usages | `ast-index usages "SymbolName"` | ~8ms |
| Find implementations | `ast-index implementations "Interface"` | ~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 "module-name"` | ~10ms |
| File outline | `ast-index outline "File.kt"` | ~1ms |
## Android-Specific Commands
| Task | Command |
|------|---------|
| Dagger provides | `ast-index provides "Type"` |
| Dagger inject | `ast-index inject "Type"` |
| Composables | `ast-index composables` |
| Suspend functions | `ast-index suspend` |
| Flows | `ast-index flows` |
| XML usages | `ast-index xml-usages "ViewClass"` |
## Index Management
- `ast-index rebuild` — Full reindex (run once after clone)
- `ast-index update` — After git pull/merge
- `ast-index stats` — Show index statistics
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.
- 6d ago First seen · 146 lines · 17 tokens per session scan A 7240b0fb9133
initialize-android is a command published in the GitHub repository defendend/Claude-ast-index-search (557 stars, last pushed today), licensed MIT. It adds 17 tokens to every session and 932 once invoked, about $0.0001 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.
Other commands, from other repositories
extract
Extract a composable from amethyst to shared code.
ask
Ask a question about iOS/Swift development - routes to the right Axiom skill or agent.
modernize
Migrate legacy iOS patterns to modern equivalents (launches modernization-helper agent).
kmp-implement-feature
KMP Agent Skills — build a new KMP feature end-to-end, layer by layer, with the full Koin 4 / Ktor 3 / SQLDelight 2 / CMP 1.11 stack wired correctly from the start.
create-activity
Generate a Jetpack Compose screen with proper architecture.
swift-new
Create new Swift project or component.