
Ast Grep Find
- 501 installs
- 3.9k repo stars
- Updated January 26, 2026
- parcadei/continuous-claude-v3
ast-grep-find is a Claude Code skill that runs structural AST pattern searches and refactors across codebases using ast-grep instead of brittle text regex for developers who need syntax-aware code discovery.
About
ast-grep-find is a structural code search skill from parcadei/continuous-claude-v3 that routes queries through ast-grep MCP and a Python harness script. Developers invoke it with uv run python -m runtime.harness scripts/ast_grep_find.py, passing --pattern and --language flags to locate imports, function calls, class definitions, and rename targets while ignoring strings and comments. The skill limits allowed tools to Bash and Read, making it suited for agent-driven refactors and large-repo audits where grep or ripgrep produce false positives. Reach for ast-grep-find when you need AST-precision renames or pattern scans across Python and other ast-grep-supported languages during code review or migration work.
- Leverages ast-grep for semantic, tree-based code searching
- Enables complex structural queries that understand syntax and semantics
- Integrates directly into Claude-powered agent workflows
- Supports custom rule files for repeatable codebase analysis
- Returns precise matches with context for fast iteration
Ast Grep Find by the numbers
- 501 all-time installs (skills.sh)
- +4 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #1,768 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill ast-grep-findAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 501 |
|---|---|
| repo stars | ★ 3.9k |
| Last updated | January 26, 2026 |
| Repository | parcadei/continuous-claude-v3 ↗ |
How do you search code by AST syntax patterns?
Run precise, structural searches across codebases using AST patterns instead of brittle regex.
Who is it for?
Developers or coding agents refactoring multi-file codebases who need syntax-aware pattern matching beyond grep.
Skip if: Developers who only need simple literal string search across log files or plain-text configs without parsing code structure.
When should I use this skill?
A developer asks to find function calls, imports, class definitions, or rename symbols using AST patterns instead of regex.
What you get
Matched AST nodes, structural search results, and refactor-ready pattern locations across target directories.
- AST pattern match results
- Directory-scoped structural search output
By the numbers
- Allows exactly 2 agent tools: Bash and Read
- Accepts --pattern and --language CLI flags for scoped AST queries
Files
AST-Grep Find
Structural code search that understands syntax. Find patterns like function calls, imports, class definitions - not just text.
When to Use
- Find code patterns (ignores strings/comments)
- Search for function calls, class definitions, imports
- Refactor code with AST precision
- Rename variables/functions across codebase
Usage
Search for a pattern
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "import asyncio" --language pythonSearch in specific directory
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "async def \$FUNC(\$\$\$)" --language python --path "./src"Refactor/replace pattern
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "console.log(\$MSG)" --replace "logger.info(\$MSG)" \
--language javascriptDry run (preview changes)
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "print(\$X)" --replace "logger.info(\$X)" \
--language python --dry-runParameters
| Parameter | Description |
|---|---|
--pattern | AST pattern to search (required) |
--language | Language: python, javascript, typescript, go, etc. |
--path | Directory to search (default: .) |
--glob | File glob pattern (e.g., **/*.py) |
--replace | Replacement pattern for refactoring |
--dry-run | Preview changes without applying |
--context | Lines of context (default: 2) |
Pattern Syntax
| Syntax | Meaning |
|---|---|
$NAME | Match single node (variable, expression) |
$$$ | Match multiple nodes (arguments, statements) |
$_ | Match any single node (wildcard) |
Examples
# Find all function definitions
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "def \$FUNC(\$\$\$):" --language python
# Find console.log calls
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "console.log(\$\$\$)" --language javascript
# Replace print with logging
uv run python -m runtime.harness scripts/ast_grep_find.py \
--pattern "print(\$X)" --replace "logging.info(\$X)" \
--language python --dry-runvs morph/warpgrep
| Tool | Best For |
|---|---|
| ast-grep | Structural patterns (understands code syntax) |
| warpgrep | Fast text/regex search (20x faster grep) |
Use ast-grep when you need syntax-aware matching. Use warpgrep for raw speed.
MCP Server Required
Requires ast-grep server in mcp_config.json.
Related skills
How it compares
Choose ast-grep-find over ripgrep when matches must respect syntax boundaries like imports or call expressions.
FAQ
What does ast-grep-find search differently than grep?
ast-grep-find uses ast-grep MCP to match syntax-tree patterns such as imports and function calls, ignoring strings and comments. grep matches raw text and often returns false positives inside literals or comments.
How do you run ast-grep-find from the command line?
ast-grep-find runs via uv run python -m runtime.harness scripts/ast_grep_find.py with --pattern and --language arguments. Add a directory path to scope the structural search to a subtree.