Skip navigation
ast-grep outline is released!
0:00 / 2:48

ast-grep outline is released!

Herrington Darkholme

@hd_nvim9.6K followers

Visit on X
711 likesDownloadOriginal post

78,123 views

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.

40 Comments

Comments from the original post on X (Twitter)

  • Herrington Darkholme's profile picture

    @hd_nvim

    See the release blog

    22 likes

  • Herrington Darkholme's profile picture

    @hd_nvim

    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.

    13 likes

  • Herrington Darkholme's profile picture

    @hd_nvim

    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.

    12 likes

  • Herrington Darkholme's profile picture

    @hd_nvim

    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.

    11 likes

  • Herrington Darkholme's profile picture

    @hd_nvim

    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

    3 likes

  • Herrington Darkholme's profile picture

    @hd_nvim

    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

    9 likes

  • Herrington Darkholme's profile picture

    @hd_nvim

    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!

    4 likes

  • Dmitriy Kovalenko's profile picture

    @neogoose_btw

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

    4 likes

  • Herrington Darkholme's profile picture

    @hd_nvim

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

    1 like

  • Dmitriy Kovalenko's profile picture

    @neogoose_btw

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

  • Herrington Darkholme's profile picture

    @hd_nvim

    it definitely does classify

    1 like

  • Cat Chen, @catchen@mastodon.world's profile picture

    @CatChen

    A companion skill is necessary.

    2 likes

  • Herrington Darkholme's profile picture

    @hd_nvim

    In the upcoming release!

    4 likes

  • Mohsen Azimi's profile picture

    @mohsen____

    This is amazing! I'll integrate this into yek

    2 likes

  • James's profile picture

    @JamesNguyen868

    Really like the ast grow you build thanks

    1 like

  • Cyrus's profile picture

    @cyrusnewday

    @ewind_dev Let’s fucking go

    1 like

  • Santosh Yadav's profile picture

    @SantoshYadavDev

    Congratulations buddy 👏

    1 like

  • ChadSigmaRizzlord's profile picture

    @ChadSigmaRizz

    Does it work similarly to tree sitter ?

    1 like

  • Herrington Darkholme's profile picture

    @hd_nvim

    generated by @suyanhanx

    4 likes

  • ChadSigmaRizzlord's profile picture

    @ChadSigmaRizz

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

    3 likes