ast-grep

SKILL.md

ast-grep

Overview

Read-only CLI search with sg or ast-grep. AST-aware grep for code exploration and SWE tasks.

Quick start

  • Prefer sg. Fallback ast-grep run. Last resort: nix run nixpkgs#ast-grep -- run
  • Example: sg -p 'console.log($MSG)' -l ts src
  • Files only: sg -p 'console.log($$$)' -l ts --files-with-matches src

Guardrails

  • Read-only: never use --rewrite, -r, --update-all, or --interactive
  • Stdin requires --lang

Resources

  • reference.md: flags, strictness, selectors, output formats
  • cookbook/: troubleshooting and recipes
Weekly Installs
11
Repository
anntnzrb/agents
First Seen
Feb 28, 2026
Installed on
opencode11
gemini-cli11
claude-code11
github-copilot11
codex11
kimi-cli11