Skip to content

feat: index tool (tree-sitter skeleton before reads) #40

Closed

Description

@wowi42

Summary

Add an index tool that returns a tree-sitter skeleton of a source file: imports, types, class/function signatures with exact line ranges. The model indexes first, then reads only the ranges it needs.

Why

Tool results are re-sent to the model on every turn, and reads dominate token usage. A skeleton is typically 70-90% smaller than the file; maki reports ~165 tok/turn saved with the same tool.

Scope

  • New index tool: path argument, skeleton output (language-appropriate items, line ranges), capped output like other tools
  • read description nudges the model to index first on large files
  • Tree-sitter via tree-sitter + tree-sitter-language-pack (exact pins), fail-open on unsupported languages (return a clear "unsupported" result, never crash)
  • Tests with fixture files per supported language family

Out of scope

  • Semantic search, cross-file indexing, caching layers

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions