---
title: "Tree-sitter alternatives 2026: code search tools compared"
canonical: "https://xerj.org/compare/tree-sitter-alternatives-2026"
updated: "2026-12-03"
---

# Best Tree-sitter alternatives in 2026

SHORT ANSWER · UPDATED 2026-12-03
The best Tree-sitter alternatives in 2026 are Codegraph for giving a coding agent a symbol graph of the repo, ripgrep for instant regex search in one working tree, Context7 for current library docs inside an AI editor and codebase-memory-mcp for persistent code graph memory for coding agents. In one line, Tree-sitter is this: incremental parser generator that builds concrete syntax trees for source files. The right swap depends on how you want to run it and which licence you need.
**Key number:** Tree-sitter had 27,693 GitHub stars on 3 Dec 2026, latest release v0.27.2, 7 Nov 2026.
Stars, licences, languages and releases for 10 tools were fetched live from the GitHub API, GitHub release pages and the Hugging Face API on 3 Dec 2026. Hosted services link to their official sites and carry no invented numbers.

**TL;DR** The best Tree-sitter alternatives in 2026 are Codegraph for giving a coding agent a symbol graph of the repo, ripgrep for instant regex search in one working tree, Context7 for current library docs inside an AI editor and codebase-memory-mcp for persistent code graph memory for coding agents.

## Agent prompt

```text
Read https://xerj.org/llms.txt. I am comparing Tree-sitter alternatives. Install XERJ, start a local node, run xerj autoindex on my project folder, connect xerj mcp, and show me three searches with file and line citations.
```

## Pick one in ten seconds

- Pick [Codegraph](https://github.com/colbymchenry/codegraph) if you want giving a coding agent a symbol graph of the repo.
- Pick [ripgrep](https://github.com/BurntSushi/ripgrep) if you want instant regex search in one working tree.
- Pick [Context7](https://github.com/upstash/context7) if you want current library docs inside an AI editor.
- Pick [codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) if you want persistent code graph memory for coding agents.
- Pick [GitHub MCP Server](https://github.com/github/github-mcp-server) if you want agents working with GitHub repos and issues.
- Pick [Serena](https://github.com/oraios/serena) if you want symbol-level navigation and edits for agents.
- Pick [The Silver Searcher](https://github.com/ggreer/the_silver_searcher) if you want fast ack-style search on older setups.
- Pick [Semgrep](https://github.com/semgrep/semgrep) if you want pattern rules for security and code review.
- Pick [XERJ](https://github.com/xerj-org/xerj) if an AI agent should search your local code, docs and logs over MCP.

## What Tree-sitter does well

Incremental parser generator that builds concrete syntax trees for source files. It suits building syntax-aware tools on top of a parser. It runs as a library in your process, is written mainly in Rust, and its licence is MIT. Plan for this: a parsing library, you build the search on top.

## How the Tree-sitter alternatives differ

The alternatives split by how they run:

- **Command-line tool:** Codegraph, ripgrep, The Silver Searcher, Semgrep.
- **Self-hosted server:** Context7, codebase-memory-mcp, GitHub MCP Server, Serena.

## Licences at a glance

- **Permissive licences:** Tree-sitter (MIT), Codegraph (MIT), ripgrep (Unlicense), Context7 (MIT), codebase-memory-mcp (MIT), GitHub MCP Server (MIT), The Silver Searcher (Apache-2.0).
- **Copyleft licences:** Serena (GPL-3.0-or-later, SolidLSP part under MIT), Semgrep (LGPL-2.1).

## Most recent releases

Context7 shipped upstash/context7-mcp 4.9.3 on 3 Dec 2026. Semgrep shipped v1.188.0 on 2 Dec 2026. Codegraph shipped v1.6.7 on 30 Nov 2026. A recent release is a sign of active upkeep, so check the changelog for the features you rely on.

## Where XERJ fits next to Tree-sitter

XERJ is a new way for AI to search for data: one local Rust binary that indexes code, docs, logs and data with `xerj autoindex` and returns passages with file and line citations. `xerj mcp` is a stdio MCP server, and `xerj mcp --http` serves Streamable HTTP at `http://127.0.0.1:9330/mcp`, read-only unless you pass `--allow-writes`. A non-loopback bind needs `XERJ_MCP_TOKEN`. It complements Tree-sitter when an agent needs answers from files on your machine.

## How we checked

Stars, licences, languages and releases for 10 tools were fetched live from the GitHub API, GitHub release pages and the Hugging Face API on 3 Dec 2026. Hosted services link to their official sites and carry no invented numbers. Descriptions summarise each project's own README or documentation. Star counts move daily, so treat them as a snapshot.

## Read next

- [Codegraph vs codebase-memory-mcp (2026): which code search fits?](https://xerj.org/compare/codegraph-vs-codebase-memory-mcp-2026)
- [Serena vs Codegraph (2026): which code search fits?](https://xerj.org/compare/serena-vs-codegraph-2026)
- [Codegraph alternatives 2026: code knowledge graphs for agents](https://xerj.org/compare/codegraph-alternatives-2026)
- [ugrep vs ripgrep (2026): which code search fits?](https://xerj.org/compare/ugrep-vs-ripgrep-2026)
- [ast-grep vs ripgrep vs ugrep (2026): code search for AI agents](https://xerj.org/compare/ast-grep-vs-ripgrep-vs-ugrep)
- [ripgrep alternatives 2026: faster and better grep tools compared](https://xerj.org/compare/ripgrep-alternatives-2026)
- [What is syntax-aware search?](https://xerj.org/science/syntax-aware-search)
- [Reference coding for AI coding agents](https://xerj.org/science/reference-coding)
- [What is agentic search? AI agents that search in a loop (2026)](https://xerj.org/science/agentic-search)

## FAQ

### What is the best Tree-sitter alternative in 2026?

It depends on the job: Codegraph fits giving a coding agent a symbol graph of the repo, ripgrep fits instant regex search in one working tree, Context7 fits current library docs inside an AI editor, codebase-memory-mcp fits persistent code graph memory for coding agents, and XERJ fits AI agents searching local files over MCP.

### Is Tree-sitter open source?

Tree-sitter is published under MIT and had 27,693 GitHub stars on 3 Dec 2026.

### Which Tree-sitter alternatives can I self-host?

These run on your own machines: Codegraph, ripgrep, Context7, codebase-memory-mcp, GitHub MCP Server, Serena, The Silver Searcher, Semgrep.

### Which languages are the Tree-sitter alternatives written in?

C: codebase-memory-mcp, The Silver Searcher, Semgrep; Go: GitHub MCP Server; Python: Serena; Rust: ripgrep; TypeScript: Codegraph, Context7. The primary language is the one GitHub reports for each repository.

## Evidence

- [tree-sitter/tree-sitter](https://github.com/tree-sitter/tree-sitter): 27,693 stars, MIT, Rust, latest release v0.27.2, 7 Nov 2026 (GitHub API and release page, checked 3 Dec 2026).
- [colbymchenry/codegraph](https://github.com/colbymchenry/codegraph): 79,509 stars, MIT, TypeScript, latest release v1.6.7, 30 Nov 2026 (GitHub API and release page, checked 3 Dec 2026).
- [BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep): 70,729 stars, Unlicense, Rust, latest release 16.0.0, 22 Nov 2026 (GitHub API and release page, checked 3 Dec 2026).
- [upstash/context7](https://github.com/upstash/context7): 65,847 stars, MIT, TypeScript, latest release upstash/context7-mcp 4.9.3, 3 Dec 2026 (GitHub API and release page, checked 3 Dec 2026).
- [DeusData/codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp): 49,567 stars, MIT, C, latest release v0.12.1, 16 Oct 2026 (GitHub API and release page, checked 3 Dec 2026).
- [github/github-mcp-server](https://github.com/github/github-mcp-server): 34,945 stars, MIT, Go, latest release v2.3.0, 24 Nov 2026 (GitHub API and release page, checked 3 Dec 2026).
- [oraios/serena](https://github.com/oraios/serena): 31,943 stars, GPL-3.0-or-later, SolidLSP part under MIT, Python, latest release v2.1.0, 19 Oct 2026 (licence read from [its licence file](https://github.com/oraios/serena/blob/HEAD/LICENSE)) (GitHub API and release page, checked 3 Dec 2026).
- [ggreer/the_silver_searcher](https://github.com/ggreer/the_silver_searcher): 27,124 stars, Apache-2.0, C, latest release No GitHub release (GitHub API and release page, checked 3 Dec 2026).
- [semgrep/semgrep](https://github.com/semgrep/semgrep): 18,177 stars, LGPL-2.1, C, latest release v1.188.0, 2 Dec 2026 (GitHub API and release page, checked 3 Dec 2026).
- [xerj-org/xerj](https://github.com/xerj-org/xerj): 23,588 stars, Apache-2.0, Rust, latest release v1.0.0-rc.105, 23 Nov 2026 (GitHub API and release page, checked 3 Dec 2026).

## Comparison table

| Tool | What it is | Runs as | Language | Latest release | Licence | Stars |
|---|---|---|---|---|---|---|
| [Tree-sitter](https://github.com/tree-sitter/tree-sitter) | Incremental parser generator that builds concrete syntax trees for source files | Library in your process | Rust | v0.27.2, 7 Nov 2026 | MIT | 27,693 |
| [Codegraph](https://github.com/colbymchenry/codegraph) | Code knowledge graph for AI coding agents with an MCP server | Command-line tool | TypeScript | v1.6.7, 30 Nov 2026 | MIT | 79,509 |
| [ripgrep](https://github.com/BurntSushi/ripgrep) | Line-oriented recursive search tool that respects .gitignore and searches with Rust regex | Command-line tool | Rust | 16.0.0, 22 Nov 2026 | Unlicense | 70,729 |
| [Context7](https://github.com/upstash/context7) | MCP server that serves up-to-date library documentation and code examples to coding agents | Self-hosted server | TypeScript | upstash/context7-mcp 4.9.3, 3 Dec 2026 | MIT | 65,847 |
| [codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) | MCP server that indexes a codebase into a persistent knowledge graph for agents | Self-hosted server | C | v0.12.1, 16 Oct 2026 | MIT | 49,567 |
| [GitHub MCP Server](https://github.com/github/github-mcp-server) | GitHub's official MCP server for repositories, issues, pull requests and code search | Self-hosted server | Go | v2.3.0, 24 Nov 2026 | MIT | 34,945 |
| [Serena](https://github.com/oraios/serena) | Coding agent toolkit that exposes semantic code retrieval and editing over language servers and MCP | Self-hosted server | Python | v2.1.0, 19 Oct 2026 | GPL-3.0-or-later, SolidLSP part under MIT | 31,943 |
| [The Silver Searcher](https://github.com/ggreer/the_silver_searcher) | Code-searching tool similar to ack, focused on speed (ag) | Command-line tool | C | No GitHub release | Apache-2.0 | 27,124 |
| [Semgrep](https://github.com/semgrep/semgrep) | Lightweight static analysis that matches code patterns that look like the source | Command-line tool | C | v1.188.0, 2 Dec 2026 | LGPL-2.1 | 18,177 |
| [XERJ](https://github.com/xerj-org/xerj) | One local Rust binary that indexes code, docs, logs and data, and serves cited search to agents over MCP | Command-line tool | Rust | v1.0.0-rc.105, 23 Nov 2026 | Apache-2.0 | 23,588 |
