Tree-sitter
Hacker ApprovedThe most recommended of 7 parser libraries
Recommended as a fast, incremental parser with real syntax trees and broad language support. Critics say it is limited next to an IDE and less complete than hand-written parsers.
Recommended as a fast, incremental parser with real syntax trees and broad language support. Critics say it is limited next to an IDE and less complete than hand-written parsers.
94 people gave an opinion
- recommend it
- 79
- criticize it
- 15
- approval share
- 84%
Recommended in 12 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: recommended
- June 2026: recommended
- July 2026: recommended
- August 2026: recommended
- September 2026: recommended
- October 2026: recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 79 people recommend itNeeds 10 or more, met.
- 5.3 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 12 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Gives AI agents code structure
“Treesitter supports query by symbol (find definition, usages, etc), and so is much better suited to what an AI agent may want to do.”
Comment from 12 Feb 2026 in “Show HN: CodeRLM – Tree-sitter-backed code indexing for LLM agents” “tree-sitter lets you grab full functions or classes. It seems to give much better context quality and keeps token costs down”
Comment from 23 Jan 2026 in “Tree-sitter vs. Language Servers” “more advanced code agent methods like Tree Sitter, PageRank, LSP, that build semantic maps to provide more relevant context”
Comment from 10 Jun 2026 in “Is Grep All You Need? How Agent Harnesses Reshape Agentic Search” - Comment from 12 Feb 2026 in “Show HN: CodeRLM – Tree-sitter-backed code indexing for LLM agents”
- Comment from 12 Feb 2026 in “Show HN: CodeRLM – Tree-sitter-backed code indexing for LLM agents”
- Comment from 7 Mar 2026 in “Show HN: Brf.it – Extracting code interfaces for LLM context”
- Comment from 18 Mar 2026 in “Ask HN: Burning $100K/week on LLM tokens – what are you doing to cut costs?”
Fast incremental parsing for editors
“Tree-sitter parses on the main thread (or a close worker) typically in sub-ms timeframes, ensuring that syntax coloring is synchronous with keystrokes.”
Comment from 22 Jan 2026 in “Tree-sitter vs. Language Servers” “in the recent versions of vscode, they started supporting tree-sitter, which is quite nice in terms of performance”
Comment from 19 Jan 2026 in “Show HN: 1Code – open-source Cursor-like UI for Claude Code” “Tree-sitter is more performant for sure, and its potential for easier text objects is nice.”
Comment from 27 Sep 2026 in “On caring for user data: NeoVim caused Vim undo files to be deleted” - Comment from 26 Jul 2026 in “How AST-grep Rewrote Tree-sitter in Rust and Made It 30% Faster”
- Comment from 27 Sep 2026 in “On caring for user data: NeoVim caused Vim undo files to be deleted”
Wide language support via grammars
“As its ecosystem is an absolute beast when it comes to the amount of languages it supports this would definetly be my preferred method”
Comment from 11 Feb 2026 in “Show HN: A Satellite View for Python Code” “The value of tree-sitter came from the fact that grammars compile to a .so and can be easily distributed through package managers.”
Comment from 26 Jul 2026 in “How AST-grep Rewrote Tree-sitter in Rust and Made It 30% Faster” “Kinda nice that the same tree-sitter grammar can be used across the extension and LSP”
Comment from 22 Jan 2026 in “Tree-sitter vs. Language Servers” Real parse trees instead of regex
“it gives you the actual parse tree so you don't have to keep patching regex patterns for every new language construct”
Comment from 6 Jun 2026 in “Sem: New primitive for code understanding – not LSPs, but entities on top of Git” “it's far more reliable to use proper parsers instead of a bunch of regular expressions”
Comment from 7 Mar 2026 in “Helix: A post-modern text editor” “They at least give a more structured approach to dealing with code than simple text.”
Comment from 13 Jul 2026 in “Ask HN: What Are You Working On? (July 2026)”
What people warn about
Each mark is one comment
Favors speed over completeness
“Tree-sitter's trade-off (speed + incrementality over completeness) makes sense for editors but you're right that for merge/diff a more thorough parser could be worth the cost”
Comment from 4 Mar 2026 in “Weave – A language aware merge algorithm based on entities” “TreeSitter is an amazing tool but is (purposefully) quite limited compared to an IDE”
Comment from 29 Apr 2026 in “Zed is 1.0” Hard grammar authoring and poor docs
“I remember having to dig through the release histories of each of the poorly documented ABI version for each language”
Comment from 25 Aug 2026 in “What's new in Emacs 31.1” “I’ve had the Tree-sitter compiler “shit itself” many times at grammars that PEG accepted with no problem”
Comment from 3 Jun 2026 in “Why Janet?” “just is too convoluted and requires the added C/C++ overhead to understand how to use it”
Comment from 5 Oct 2026 in “Plain text is still one of the best technologies we have” Error recovery breaks on complex code
“C/C++ with macros and preprocessor directives is where tree-sitter's error recovery gets stretched.”
Comment from 4 Mar 2026 in “Weave – A language aware merge algorithm based on entities” “error recovery is so aggressive it will accept broken ASTs without marking any node as an error”
Comment from 15 Dec 2025 in “Arborium: Tree-sitter code highlighting with Native and WASM targets” Speed gains often overstated
“treesitter in itself doesn't really make much of an improvement if you already have working syntax highlighting”
Comment from 18 Jun 2026 in “Emacs 31 Is Around the Corner: The Changes I'm Daily Driving” “The speed claims turned out to be largely overstated in practice, for the general variety of usage”
Comment from 17 Apr 2026 in “A Better R Programming Experience Thanks to Tree-sitter”
Other parser libraries people recommend
The four most recommended other parser libraries, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| Tree-sitterThis page | 79 | 15 | 84% | 12 | — | Approved |
| Hardwood Parquet parser | 7 | 0 | 100% | 2 | — | — |
| Lark parser library for Python | 6 | 1 | 86% | 5 | — | — |
| Kaitai Struct | 6 | 2 | 75% | 5 | — | — |
| Ohm parsing library | 6 | 3 | 67% | 2 | — | — |
What people said
40 of the 104 comments that mention it, newest first. Each links to the original comment.
“just is too convoluted and requires the added C/C++ overhead to understand how to use it”
“Tree-sitter is more performant for sure, and its potential for easier text objects is nice.”
“treesitter runs circles around what classic vim is using to highlight syntax”
“I remember having to dig through the release histories of each of the poorly documented ABI version for each language”
“The value of tree-sitter came from the fact that grammars compile to a .so and can be easily distributed through package managers.”
“Implementing incremental parsing improved performance from 5ms to 400us for small edits”
“They at least give a more structured approach to dealing with code than simple text.”
“treesitter in itself doesn't really make much of an improvement if you already have working syntax highlighting”
“more advanced code agent methods like Tree Sitter, PageRank, LSP, that build semantic maps to provide more relevant context”
“it gives you the actual parse tree so you don't have to keep patching regex patterns for every new language construct”
“I’ve had the Tree-sitter compiler “shit itself” many times at grammars that PEG accepted with no problem”
“Migrated from regex-based bash static analysis to tree-sitter, reducing false positive permission prompts by 45%”
“TreeSitter is an amazing tool but is (purposefully) quite limited compared to an IDE”
“The speed claims turned out to be largely overstated in practice, for the general variety of usage”
“Tree-sitter is a partial solution to the n×m problem, and now R has been invited to participate in that solution.”
“tree-sitter integrates into any web-based technology, allowing you to _share_ code.”
“Tools like tree-sitter help identify which files are actually referenced.”
“My worry is that stability of committed ASTs would depend on tree-sitter being stable”
“uses tree-sitter to dump exported functions, public types, and a lightweight dependency graph”
“it's far more reliable to use proper parsers instead of a bunch of regular expressions”
“Tree-sitter's trade-off (speed + incrementality over completeness) makes sense for editors but you're right that for merge/diff a more thorough parser could be worth the cost”
“C/C++ with macros and preprocessor directives is where tree-sitter's error recovery gets stretched.”
“When I saw "tree-sitter in go" title, I was very glad at first. Then I saw the full picture.”
“TreeSitter will also give you locations of symbol usages, which is obviously very useful to an AI agent.”
“Treesitter supports query by symbol (find definition, usages, etc), and so is much better suited to what an AI agent may want to do.”
“Tree-sitter handles structural queries giving the LLM the ability to evaluate function signatures, hierarchies and such.”
“As its ecosystem is an absolute beast when it comes to the amount of languages it supports this would definetly be my preferred method”
“tree-sitter lets you grab full functions or classes. It seems to give much better context quality and keeps token costs down”
“Kinda nice that the same tree-sitter grammar can be used across the extension and LSP”
“Tree-sitter is also a parser generator but has better error tolerance properties (not quite as good as hand-written but generally better than prior implementations)”
“its flexible query language makes it a winner for people to quickly iterate on a working parser”
“Tree-sitter parses on the main thread (or a close worker) typically in sub-ms timeframes, ensuring that syntax coloring is synchronous with keystrokes.”
“the TS approach is so simple and so good that I'll probably never use anything else”
“I love tree-sitter+eglot but a few of the languages/schemes I work in, simply don't have parsers”
“in the recent versions of vscode, they started supporting tree-sitter, which is quite nice in terms of performance”
“TreeSitter (but TreeSitter) that knows where identifiers (variables, functions) are defined and used.”
“error recovery is so aggressive it will accept broken ASTs without marking any node as an error”
“The custom grammar was sadly necessary, due to the inability of Tree-Sitter to have the alternate roots”
“I use tree-sitter, LSPs, copilot.el, copilot-chat.el, and others all day, every day”
“all see the potential of semantic changes and of Tree-sitter as a platform for making them”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.