ast-grep-outline — Claude Code skill: what it does, how to install
Generates a compact syntax map of code files, imports, and exports with line numbers before reading raw source files.
npx skills add ast-grep/agent-skill --skill ast-grep-outline -a claude-code
npx skills add ast-grep/agent-skill --skill outline -a claude-codeWhat ast-grep-outline does
The skill runs ast-grep outline to output a structural map of source code with exact line numbers. When pointed at a file, it surfaces declarations like functions, structs, and inner members. For entire directories, it summarizes exported symbols. This saves model context.
Flags shape the output detail. The --view argument ranges from minimal symbol names to expanded members with lines, while --items isolates imports, exports, or local declarations. Top-level entries can also be filtered using --match with case-sensitive Rust regular expressions.
It reads local syntax trees only. The command cannot resolve cross-file references, infer types, or construct call graphs, so deep semantic checks still require compiler tooling.
What it helps with
- map public exports across an unfamiliar directory
- list class members with exact line numbers before editing
- trace module imports across a folder
- inspect structural changes in modified git files
Example prompts for the agent
- Outline the exported symbols in directory src with ast-grep outline
- Show members and line numbers for UserService in user.ts
- Trace imports across the api directory using ast-grep outline
How to install ast-grep-outline
1Skills CLI (Vercel)
npx skills add ast-grep/agent-skill --skill ast-grep-outline -a claude-codenpx skills add ast-grep/agent-skill --skill outline -a claude-code2Manually: put the files in place
~/.claude/skills/outline/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/outline/
1Skills CLI (Vercel)
npx skills add ast-grep/agent-skill --skill outline -a codex2Manually: put the files in place
.agents/skills/outline/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ast-grep/agent-skill --skill outline -a cursor2Manually: put the files in place
.cursor/skills/outline/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ast-grep/agent-skill outline2Manually: put the files in place
.github/skills/outline/SKILL.md1Skills CLI (Vercel)
npx skills add ast-grep/agent-skill --skill outline -a gemini-cli2Platform CLI
gemini skills install https://github.com/ast-grep/agent-skill --path ast-grep/skills/outlineManually: put the files in place
.devin/skills/outline/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ast-grep/agent-skill --skill outline -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about ast-grep-outline
How to install ast-grep-outline in Claude Code?
Run npx skills add ast-grep/agent-skill --skill ast-grep-outline -a claude-code.
What does ast-grep-outline do?
It produces a compact syntax outline of files and directories, displaying top-level symbols, members, and imports alongside line numbers.
Does ast-grep-outline resolve types or build call graphs?
No, it parses local syntax only. The command does not resolve external references, follow re-export chains, or trace function calls across files.