# Tree-sitter

79 Hacker News commenters recommended Tree-sitter and 15 criticized it, November 2025 to November 2026. It was recommended in 12 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** 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.

## Why people recommend it

- Gives AI agents code structure (7 comments): "Treesitter supports query by symbol (find definition, usages, etc), and so is much better suited to what an AI agent may want to do." ([source](https://news.ycombinator.com/item?id=46988777)) "tree-sitter lets you grab full functions or classes. It seems to give much better context quality and keeps token costs down" ([source](https://news.ycombinator.com/item?id=46733475)) "more advanced code agent methods like Tree Sitter, PageRank, LSP, that build semantic maps to provide more relevant context" ([source](https://news.ycombinator.com/item?id=48470631))
- Fast incremental parsing for editors (5 comments): "Tree-sitter parses on the main thread (or a close worker) typically in sub-ms timeframes, ensuring that syntax coloring is synchronous with keystrokes." ([source](https://news.ycombinator.com/item?id=46721487)) "in the recent versions of vscode, they started supporting tree-sitter, which is quite nice in terms of performance" ([source](https://news.ycombinator.com/item?id=46677192)) "Tree-sitter is more performant for sure, and its potential for easier text objects is nice." ([source](https://news.ycombinator.com/item?id=49869125))
- Wide language support via grammars (3 comments): "As its ecosystem is an absolute beast when it comes to the amount of languages it supports this would definetly be my preferred method" ([source](https://news.ycombinator.com/item?id=46977599)) "The value of tree-sitter came from the fact that grammars compile to a .so and can be easily distributed through package managers." ([source](https://news.ycombinator.com/item?id=49063597)) "Kinda nice that the same tree-sitter grammar can be used across the extension and LSP" ([source](https://news.ycombinator.com/item?id=46724844))
- Real parse trees instead of regex (3 comments): "it gives you the actual parse tree so you don't have to keep patching regex patterns for every new language construct" ([source](https://news.ycombinator.com/item?id=48430031)) "it's far more reliable to use proper parsers instead of a bunch of regular expressions" ([source](https://news.ycombinator.com/item?id=47285583)) "They at least give a more structured approach to dealing with code than simple text." ([source](https://news.ycombinator.com/item?id=48886990))

## What people warn about

- Favors speed over completeness (2 comments): "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" ([source](https://news.ycombinator.com/item?id=47249433)) "TreeSitter is an amazing tool but is (purposefully) quite limited compared to an IDE" ([source](https://news.ycombinator.com/item?id=47950526))
- Hard grammar authoring and poor docs (3 comments): "I remember having to dig through the release histories of each of the poorly documented ABI version for each language" ([source](https://news.ycombinator.com/item?id=49429190)) "I’ve had the Tree-sitter compiler “shit itself” many times at grammars that PEG accepted with no problem" ([source](https://news.ycombinator.com/item?id=48380407)) "just is too convoluted and requires the added C/C++ overhead to understand how to use it" ([source](https://news.ycombinator.com/item?id=49970582))
- Error recovery breaks on complex code (2 comments): "C/C++ with macros and preprocessor directives is where tree-sitter's error recovery gets stretched." ([source](https://news.ycombinator.com/item?id=47243574)) "error recovery is so aggressive it will accept broken ASTs without marking any node as an error" ([source](https://news.ycombinator.com/item?id=46276485))
- Speed gains often overstated (2 comments): "treesitter in itself doesn't really make much of an improvement if you already have working syntax highlighting" ([source](https://news.ycombinator.com/item?id=48591393)) "The speed claims turned out to be largely overstated in practice, for the general variety of usage" ([source](https://news.ycombinator.com/item?id=47804642))

## Alternatives hackers recommend

- [Hardwood Parquet parser](https://hackerapproved.com/p/hardwood.md): 7 recommend
- [Lark parser library for Python](https://hackerapproved.com/p/lark.md): 6 recommend
- [Kaitai Struct](https://hackerapproved.com/p/kaitai-struct.md): 6 recommend
- [Ohm parsing library](https://hackerapproved.com/p/ohm.md): 6 recommend
- [nom Rust parser library](https://hackerapproved.com/p/nom.md): 5 recommend

## Cite as

Hacker Approved, "Tree-sitter", https://hackerapproved.com/p/tree-sitter/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
