What problem does it solve? Text-based search tools like grep cannot reliably match code by its syntactic structure, making tasks like finding every call with a specific signature or applying a deterministic codemod across hundreds of files error-prone and manual. ## Core Features & Use Cases - AST-aware search and rewrite: Match code by syntax-tree shape using meta-variables ($VAR, $$$) instead of regex, across 25 languages including TypeScript, Python, Go, and Rust. - Safe codemods with dry-run: The helper script validates patterns offline, previews rewrites as JSON, and applies changes via a two-pass write trick that avoids the silent --update-all/--json conflict. - YAML rule scanning: Run project lint rules and auto-fixes through sg scan with sgconfig.yml support. - Use Case: Migrate every console.log($MSG) call to logger.info($MSG) across a TypeScript monorepo, previewing the exact files affected before mutating anything. ## Quick Start Ask the agent to find every console.log call in the src directory and rewrite it to logger.info using the ast-grep helper script with a dry-run first.