Video yükleniyor...
Video Yüklenemedi
ast-grep outline is released! It gives you a fast local map of code structure, between grep and a full language server. Syntax aware, no index to maintain, and extensible through declarative extraction rules.
78,064 görüntüleme • 3 ay önce •via X (Twitter)
40 Yorum

See the release blog

2/ The problem: agents often open whole files just to answer “what’s inside?” That is expensive and noisy when the next step is only choosing the right source range. outline gives the agent enough structure to navigate before doing a full read.

3/ Examples: ast-grep outline src/parser.ts ast-grep outline src ast-grep outline --match Parser --view expanded Same primitive, different navigation question: file shape, folder surface, or focused detail.

4/ In benchmarks, `ast-grep outline` reduced file reads by roughly: - Django: 55% - OkHttp: 40% - VS Code: 35% The point is not to replace reading code. It is to make the next read smaller, more targeted, and easier to justify.

5/ Design choices are intentionally constrained: No index, so less project state to maintain and better worktree support Local facts only, so it doesn't pretend to know defs, types, or call graphs Declarative extraction, so language coverage stays configurable and extensible

6/ The sweet spot is between grep and a full language server: grep: fast, textual, local outline: fast, syntax aware, local LSP: richer, typed, global Use the heavy tool when you need semantics. Use outline when you need a map

7/7 The tool is incomplete and still has TODO: stable JSON output, broader built-in extraction, custom extractors, etc. Try ast-grep outline and let me know where it helps or where the extraction rules should be improved!

Can ast grep analyze the source line of code if it contains definition or not?

hmmm, I'm not sure about the question. but probably finding definition needs a LSP or at least better graph algo

I mean simply classify that line literally contains a definition e.g function getUser() vs simply getUser()

it definitely does classify

A companion skill is necessary.

In the upcoming release!

This is amazing! I'll integrate this into yek

Really like the ast grow you build thanks

@ewind_dev Let’s fucking go

Congratulations buddy 👏

Does it work similarly to tree sitter ?

generated by @suyanhanx

@suyanhanx I see, it looks interesting. I would love to compare it to a tree sitter tool or MCP.....

Looks a lot like ast-bro (sb), which doesn’t seem super well known but I really like! I wonder how this compares

Congratulations, Herrington!

😌

YO do y'all really pronounces is ass grep internally?

This is very cool. Would never see the claude code and codex folks shipping this because it would reduce token counts. What would be helpful here maybe is that you return the exact lines for a sed command so That the model can see how it can immediately pull out all the code for a full set of functions

in your experience, is it better to use as a MCP or CLI+skill?

ast-grep有没有官方得agent skill呀?

Does it not support csharp because it says nothing found

Not yet!

How will your implementation be better than

i won't do any callgraph/dep analysis since it requires all language specific coding and semantic analysis. i don't think that's the correct direction. Feeding AI possibly wrong data is one thing, teaching AI to learn these tools is another.

Actually I was asking about the outline tool only.

Does it use ripgrep under the hood?

It does use ripgrep's infra like ignore/regex!

Nice work.

skills are valuable. Especially grill-with-docs and decision mapping, which I is in progress, I really like how ADR's gives you a map of initial decisions and also gives you a clear view of what contradicts your initial decisions as you change based on future decisions

This is the kind of primitive agents need before they read code. I’d use outline as the cheap map, then force the agent to name the exact range it wants to open. Full-file reads should feel like spending budget, not the default.

Extremely helpful, thanks!

I'll give it try with thanks!

和lsp有啥区别

