Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
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-code
Open on GitHub

What 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-code
npx skills add ast-grep/agent-skill --skill outline -a claude-code

2Manually: put the files in place

~/.claude/skills/outline/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/outline/

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.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set2

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor