Skip to content

Tree-sitter-based Repo Map #3382

@dcieslak19973

Description

@dcieslak19973

Please explain the motivation behind the feature request.
Goose currently relies on ripgrep for code navigation and search, which is fast but limited to text/regex matching. Adding Tree-sitter-based symbol extraction would enable Goose to build a structured, language-aware repo map, unlocking advanced features like class hierarchy analysis, symbol-based navigation, and more precise LLM context.

Describe the solution you'd like
Integrate Tree-sitter (with Rust bindings and language grammars) into Goose to:

  • Parse source files and extract classes, functions, methods, and their relationships
  • Build a repo map (e.g., JSONL) with symbol metadata (type, name, signature, parent, overrides, etc.)
  • Add a CLI command (e.g., goose repo index) to generate/update the repo map
  • Allow the LLM to use this map for context, navigation, and code understanding

Describe alternatives you've considered

  • Continue using ripgrep (text-based, less precise)
  • Integrate Zoekt (external dependency, less structural awareness)
  • Use ctags (limited symbol info, not AST-based)

Additional context

  • Tree-sitter is Rust-friendly and easy to package

  • Enables features like class hierarchy mapping, override detection, and more

  • Can be combined with ripgrep for hybrid workflows

  • I have verified this does not duplicate an existing feature request

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions