pi-tilth

AST-aware code reading via tilth — replaces read/grep/find/ls tools

Package details

extension

Install pi-tilth from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-tilth
Package
pi-tilth
Version
1.1.1
Published
Mar 31, 2026
Downloads
108/mo · 22/wk
Author
sting8k
License
unknown
Types
extension
Size
15.3 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-tilth

Pi extension that registers tilth as a native tool for the LLM.

Tilth is an AST-aware code reading CLI powered by tree-sitter. It replaces read, grep, find, and ls with a single smart tool that understands code structure — showing definitions first, resolving callee chains, and supporting glob-based file listing plus slash-wrapped regex content search.

Requirements

  • tilth CLI installed and available in PATH

Install

pi install npm:pi-tilth

Or from GitHub:

pi install https://github.com/sting8k/pi-tilth

Or try without installing:

pi -e https://github.com/sting8k/pi-tilth

Features

  • Tool registrationtilth available as a native Pi tool with structured params (query, scope, section, budget, map)
  • Query modesquery can be a file path, symbol, glob, plain text, or slash-wrapped regex content search like /handle(Auth|Login)/
  • Regex caveat — upstream tilth supports /<pattern>/ regex content search, but some regex patterns that contain glob-like characters may still be classified as globs first
  • Mode toggle/tilth [on|off] enables/disables tilth mode, removing built-in tools when active
  • Persistent config — state saved to ~/.pi/agent/settings.json under "pi-tilth" key
  • Auto-enable — restores tilth mode on session start based on saved config
  • Styled rendering — custom renderCall/renderResult with badge, bold params, and line count summary
  • Nudge hints — when tilth mode is on, appends a [tilth] hint to bash tool output if the command uses rg, grep, find, fd, cat, etc., reminding the agent to prefer tilth
  • Remote command detection — automatically skips nudge hints for remote commands (ssh, sshpass, scp, rsync, docker exec, kubectl exec) since tilth only works locally

Commands

Command Description
/tilth Enable tilth mode (default)
/tilth on Enable tilth mode
/tilth off Disable tilth mode, restore built-in tools