PitchHut logo
Access codebases with structural, byte-precise efficiency for coding agents.
Pitch

Grove offers coding agents structural, byte-precise and token-cheap access to codebases using tree-sitter. It allows one to outline, source, and map symbols without needing entire file reads. With runtime grammars loaded from a WASM registry, it supports 27 languages out-of-the-box, making it a powerful tool for efficient code navigation.

Description

Grove provides coding agents with a structural, byte-precise, and token-cheap method for accessing codebases using tree-sitter, eliminating the need to read entire files. This project features a versatile framework that supports both a human-friendly command line interface (grove <verb>) and an MCP server (grove serve). With grammars dynamically loaded at runtime from a WASM registry, integrating additional languages into the tool is seamless and does not require recompilation or dependency on external toolchains.

Key Features

  • Token Efficiency: Quickly outline large files and retrieve specific symbol bodies without the overhead of reading full files. A single map command can return directory definitions and references in one consolidated response.
  • Byte Precision: Results are consistently tied to a symbol-id format (<lang>:<relpath>#<name>@<line>), allowing stable references to be passed between interactions.
  • Unified Engine: One Rust binary powers both the CLI and MCP server, ensuring consistent experiences for users and agents alike.
  • Dynamic Language Support: Out of the box, Grove supports 27 languages, with each grammar loaded on demand from the hosted WASM registry. Adding a new language is as simple as making a registry entry.

How Grove Works

Unlike traditional tools that utilize semantic analysis, Grove operates as a syntactic, tree-sitter-based shell for coding agents, communicating through MCP instead of LSP. It focuses on parsing and locating code without providing advanced features such as type inference, completion, or refactoring which are the distinguishing elements of language servers.

Supported Languages

Grove provides coverage for a wide range of programming languages, including:

  • Bash
  • C
  • C++
  • C#
  • Go
  • Java
  • JavaScript
  • Python
  • Ruby
  • TypeScript
  • And many more, totaling 27 languages.

Performance Insights

Evaluated against real codebases, Grove has demonstrated substantial reductions in context token usage, with a median token reduction of about 93% across various popular repositories. Additionally, it achieves lower wall-clock times, resulting in faster response rates during code searches.

An in-depth evaluation can be explored through the Entelligentsia/grove-testbench, which measures the efficiency and performance of Grove against traditional methods.

Available Commands

Grove includes a suite of tools optimized for code interaction:

  • outline: Returns a skeleton definition of a provided file.
  • symbols: Searches for symbols within a directory accurately.
  • source: Retrieves the complete source of a specific symbol without loading entire files.
  • check: Conducts a syntax check on files, quickly identifying errors and missing nodes.
  • callers: Lists the call sites of a given symbol, facilitating better understanding of code interactions.
  • map: Generates a directory's dependency graph with definitions and references.
  • definition: Retrieves definitions and usage locations based on names or positional context.

Users can additionally utilize the --json flag for agent-compatible outputs.

Getting Started

For a simplified installation process and setup instructions, refer to the Installation Guide. Grove is designed to enhance the agent's code comprehension capabilities while streamlining the development process, making it an invaluable tool for modern coding environments.

0 comments

No comments yet.

Sign in to be the first to comment.