tilth  by jahala

Intelligent code navigation for AI agents and developers

Created 4 months ago
256 stars

Top 98.6% on SourcePulse

GitHubView on GitHub
Project Summary

Smart code reading for humans and AI agents, tilth aims to significantly reduce the cost and improve the accuracy of code comprehension tasks. By integrating powerful tools like ripgrep and tree-sitter, it provides structural awareness of codebases, enabling faster navigation and analysis, which translates to an average cost reduction of ~40% per correct answer for AI models.

How It Works

Tilth combines ripgrep, tree-sitter, and cat to provide intelligent code reading capabilities for humans and AI agents. It leverages tree-sitter for Abstract Syntax Tree (AST) parsing across 14 languages, enabling precise identification of definitions, usages, callees, and callers, moving beyond simple text matching. For large files, it generates structural outlines with line ranges, while smaller files are presented whole. This structural awareness significantly reduces the token costs and inference time for AI agents by providing context and enabling direct navigation to relevant code sections.

Quick Start & Requirements

  • Primary install: cargo install tilth or npx tilth.
  • Prebuilt binaries are available on the releases page.
  • MCP server integration requires additional setup commands (e.g., tilth install claude-code).
  • No non-default prerequisites are explicitly stated for the CLI tool beyond standard Rust or Node.js toolchains for installation.

Highlighted Details

  • Performance: Demonstrates an average 40% reduction in cost per correct answer for LLMs (Sonnet, Opus, Haiku) across 160 benchmark runs, improving accuracy and reducing turns.
  • Structural Navigation: Utilizes tree-sitter AST parsing for accurate symbol resolution, definition finding, and callee/caller tracing, offering context-rich results.
  • Efficient Code Access: Features include file outlining for large files, section drilling via line ranges or headings, and inline expansion of definitions with callee information.
  • Codebase Intelligence: Offers dependency analysis (--deps), structural diffing (diff), and comprehensive symbol inspection (grok).
  • AI Agent Integration: Seamlessly integrates with various AI coding platforms via an MCP server, optimizing tool usage and reducing redundant operations.
  • Edit Mode: Supports precise, hash-anchored file editing, rejecting changes if the file content has diverged since the last read.

Maintenance & Community

No specific details regarding notable contributors, sponsorships, or community channels (e.g., Discord/Slack) are provided in the README.

Licensing & Compatibility

  • License: MIT.
  • Compatibility: The permissive MIT license generally allows for commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

Smaller LLMs may default to built-in tools; forced adoption via --disallowedTools is recommended for consistent tilth usage. Edit mode's hash-anchored updates require exact matches to the last read state, preventing edits on modified files. The --map codebase skeleton feature is CLI-only due to AI agent overuse concerns.

Health Check
Last Commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
46
Issues (30d)
4
Star History
35 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.