# ast-index — Fast Code Search for Agents > ast-index builds an AST index for fast code search and integrates with Claude/Codex/Cursor; verified 347★ and installs via Homebrew. ## Install Copy the content below into your project: ## Quick Use ```bash brew tap defendend/ast-index brew install ast-index cd /path/to/repo && ast-index rebuild ``` ## Intro ast-index builds an AST index for fast code search and integrates with Claude/Codex/Cursor; verified 347★ and installs via Homebrew. **Best for:** Large repos where grep is too slow/noisy and you want agents to query symbols/usages precisely **Works with:** macOS Homebrew (fast install) and any agent that can call CLI or MCP wrappers **Setup time:** 8-18 minutes ### Key facts (verified) - GitHub: 347 stars · 29 forks · pushed 2026-05-13. - License: MIT · owner avatar + repo URL verified via GitHub API. - README-backed entrypoint: `ast-index rebuild`. ## Main - Index once, query forever: run `rebuild` initially, then prefer incremental `update` for day-to-day changes. - Teach agents a rule: call `outline` or `symbol/usages` before reading a 500+ line file to reduce token burn. - For monorepos, enable walk-up indexing so subprojects reuse the root index instead of reindexing per folder. ### Source-backed notes - README provides Homebrew install (`brew tap defendend/ast-index` then `brew install ast-index`) and lists 46+ commands. - README documents integrations: Claude plugin, Codex MCP install (`ast-index install-codex-mcp`), and Cursor plugin wiring. - README mentions a binary size hint (~44MB) for the release CLI output. ### FAQ - **Do I need to reindex after every change?**: No — use incremental `update` and rebuild only when the index gets out of sync. - **Is this language-specific?**: It supports multiple symbol queries; check README for supported languages in your repo. - **Can agents access it via MCP?**: Yes — README describes an MCP server wrapper that exposes ast-index tools to MCP clients. ## Source & Thanks > Source: https://github.com/defendend/Claude-ast-index-search > License: MIT > GitHub stars: 347 · forks: 29 --- ## Quick Use ```bash brew tap defendend/ast-index brew install ast-index cd /path/to/repo && ast-index rebuild ``` ## Intro ast-index 通过 AST 索引实现高速代码搜索,可接入 Claude/Codex/Cursor 与 MCP;已验证 347★,README 标注 46+ 命令,支持 Homebrew 快速安装(产物约 44MB)。 **Best for:** 大型仓库:grep 太慢/太吵,需要 agent 精准查符号、调用方与引用位置 **Works with:** macOS Homebrew(快速安装)+ 可调用 CLI/MCP 的各类 agent **Setup time:** 8-18 minutes ### Key facts (verified) - GitHub:347 stars · 29 forks;最近更新 2026-05-13。 - 许可证:MIT;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中可对照的入口命令:`ast-index rebuild`。 ## Main - 先建索引再持续使用:第一次用 `rebuild`,日常改动优先用增量 `update`。 - 给 agent 写硬规则:读 500+ 行文件前先跑 `outline` 或 `symbol/usages`,减少 token 消耗。 - 单仓多项目建议开启 walk-up,让子目录复用根索引,避免每个子项目重复建库。 ### Source-backed notes - README 提供 Homebrew 安装(`brew tap defendend/ast-index` → `brew install ast-index`),并列出 46+ 命令。 - README 描述与 Claude/Codex/Cursor 的集成方式(含 `ast-index install-codex-mcp`)。 - README 提到构建产物体积提示(CLI 二进制约 ~44MB)。 ### FAQ - **每次改代码都要重建索引吗?**:不需要。日常用增量 `update`,只有索引不同步时再 `rebuild`。 - **这是某一种语言专用吗?**:它支持多种符号查询;具体语言支持以 README 为准。 - **agent 能通过 MCP 用它吗?**:可以。README 描述了 MCP server wrapper,可向 MCP 客户端暴露工具。 ## Source & Thanks > Source: https://github.com/defendend/Claude-ast-index-search > License: MIT > GitHub stars: 347 · forks: 29 --- Source: https://tokrepo.com/en/workflows/ast-index-fast-code-search-for-agents Author: Script Depot