ast-grep-find

ast-grep-find is a skill for Claude Code from vibeeval/vibecosystem. It costs 17 tokens per session (714 once invoked), scanned A, a copy of ast-grep-find, MIT.

A tool for searching and changing source code by its structure rather than by matching plain text. It can identify calls, imports, functions, and classes while ignoring comments and strings.

In plain words
What is it for?
Use it to find code patterns or preview and apply precise refactors across Python, JavaScript, and TypeScript files.
Why use it?
It makes broad code changes safer when the same text may appear in unrelated places or when formatting differs.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to find code patterns or preview and apply precise refactors across Python, JavaScript, and TypeScript files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vibeeval/vibecosystem/ast-grep-find
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.

Any agent
npx skills add vibeeval/vibecosystem --skill ast-grep-find
Clone the repo
git clone --depth 1 https://github.com/vibeeval/vibecosystem

Made for: Claude Code.

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 ast-grep-find

README.md
[![agentmods](https://agentmods.dev/badge/skills/vibeeval/vibecosystem/ast-grep-find/github.svg)](https://agentmods.dev/skills/vibeeval/vibecosystem/ast-grep-find)
Your own site
<a href="https://agentmods.dev/skills/vibeeval/vibecosystem/ast-grep-find"><img src="https://agentmods.dev/badge/skills/vibeeval/vibecosystem/ast-grep-find/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ast-grep-find

Your own site · 80×15
<a href="https://agentmods.dev/skills/vibeeval/vibecosystem/ast-grep-find"><img src="https://agentmods.dev/badge/skills/vibeeval/vibecosystem/ast-grep-find.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 714 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 100% 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.00017 $0.00714
Opus 5 $0.00009 $0.00357
Sonnet 5 $0.00003 $0.00143
Haiku 4.5 $0.00002 $0.00071

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

Security

Grade A, and why

ast-grep-find 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 5d 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

100% identical to ast-grep-find — 188 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.

skills/ast-grep-find/SKILL.md · 95 lines

How it starts

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

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 python

Search 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 javascript

Dry run (preview changes)

uv run python -m runtime.harness scripts/ast_grep_find.py \
    --pattern "print(\$X)" --replace "logger.info(\$X)" \
    --language python --dry-run

Parameters

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-run

Read the full file on GitHub · 95 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. 5d ago First seen · 95 lines · 17 tokens per session scan A 077c3f1cebc5

Subscribe to this mod's changes

ast-grep-find is a skill published in the GitHub repository vibeeval/vibecosystem (529 stars, last pushed 1mo ago), licensed MIT. It adds 17 tokens to every session and 714 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to ast-grep-find, differing in 188 lines, and is treated as a copy.

Related

Other skills, from other repositories

verify-implementation

A workflow that runs a project’s verification skills to produce a report on coding patterns, architecture rules, and project conventions. It is intended for work after implementation, before a pull request, or during code review.

sangrokjung/claude-forge · 37 tokens

review-loop

Run the adversarial verification loop — implement, then hand the change to a fresh checker that did not write it, fix what it finds, and re-dispatch until APPROVE. Use before claiming any behavioural change is done, and on requests like "review loop", "adversarial review", "independent review", "get this verified"…

sangrokjung/claude-forge · 100 tokens

no-mistakes

Validate committed feature-branch changes through the no-mistakes pipeline: intent, rebase, review, test, docs, lint, push, PR, and CI. Use when the user asks to run no-mistakes, ship safely, validate before pushing, or gate a change before it reaches upstream.

stevesolun/ctx · 67 tokens

code-auditor

Performs comprehensive codebase analysis covering architecture, code quality, security, performance, testing, and maintainability. Use when user wants to audit code quality, identify technical debt, find security issues, assess test coverage, or get a codebase health check.

mhattingpete/claude-skills-marketplace · 56 tokens

react-patterns

React 19 performance patterns and composition architecture for Vite + Cloudflare projects. 50+ rules ranked by impact — eliminating waterfalls, bundle optimisation, re-render prevention, composition over boolean props, server/client boundaries, and React 19 APIs. Use when writing, reviewing, or refactoring React…

jezweb/claude-skills · 110 tokens

generic-fullstack-code-reviewer

Review full-stack code for bugs, security vulnerabilities, performance issues, accessibility gaps, and CLAUDE.md compliance. Enforces TypeScript strict mode, input validation, GPU-accelerated animations, and design system consistency. Use when completing features, before commits, or reviewing pull requests.

travisjneuman/.claude · 64 tokens