Loading...
Loading...
Runs tilth CLI for structural code navigation — reads files with smart outlining, searches symbols/text/regex, finds files by glob, and maps codebases. Use instead of read/grep/find for all source code exploration.
npx skill4agent add nanomicon/skills tilth⚠️ MANDATORY: Useinstead oftilth,read,grep,findcatEvery time you reach for, ask: can tilth do this? It almost always can, and does it better — structural outlines, tree-sitter symbol search, and token-aware output in one call.readis only acceptable when: tilth is not installed, file is binary/image/PDF, or you need raw bytes.read
| Task | Command |
|---|---|
| Read a file | |
| Read lines 100–200 | |
| Read markdown section | |
| Force full content | |
| Find symbol definition | |
| Search literal text | |
| Regex search | |
| Case-insensitive regex | |
| Find files by glob | |
| Codebase map | |
| Limit output tokens | |
<query>| Priority | Pattern | Classification |
|---|---|---|
| 1 | | Glob — file search |
| 2 | Contains | File path — read file |
| 3 | Starts with | File path (dotfile) |
| 4 | Pure digits ( | Content search |
| 5 | Looks like a filename (has extension) | File path if exists on disk |
| 6 | | Regex search |
| 7 | Identifier (starts with letter/ | Symbol search |
| 8 | Everything else | Content search |
tilth <path> # smart view: full if small, outline if large
tilth <path> --section 45-89 # exact line range
tilth <path> --section "## Foo" # markdown heading section
tilth <path> --full # force full content even if large--section> Related: ...$ tilth src/server.rs
# src/server.rs (1,247 lines, ~18.2k tokens) [outline]
[1-15] imports: hyper(3), tokio, serde_json, crate::config
[17-34] struct ServerConfig
[36-89] impl ServerConfig
[38-52] fn from_env() -> Result<Self>
[54-89] fn validate(&self) -> Result<()>
[91-340] struct HttpServer
[105-180] async fn start(&self) -> Result<()>
[182-260] async fn handle_request(&self, req: Request) -> Response
> Related: src/config.rs, src/router.rstilth src/server.rs --section 105-180tilth <symbol> --scope <dir> # definitions first, then usages── calls ──── siblings ──$ tilth handleAuth --scope src/
# Search: "handleAuth" in src/ — 6 matches (2 definitions, 4 usages)
## src/auth.ts:44-89 [definition]
[24-42] fn validateToken(token: string)
→ [44-89] export fn handleAuth(req, res, next)
[91-120] fn refreshSession(req, res)
44 │ export function handleAuth(req, res, next) {
45 │ const token = req.headers.authorization?.split(' ')[1];
...
89 │ }
── calls ──
validateToken src/auth.ts:24-42 fn validateToken(token: string): Claims | null
refreshSession src/auth.ts:91-120 fn refreshSession(req, res)
## src/routes/api.ts:34 [usage]
→ [34] router.use('/api/protected/*', handleAuth);── calls ──tilth src/auth.ts --section 24-42tilth "TODO: fix" --scope <dir> # literal text search
tilth "/<regex>/" --scope <dir> # regex search (wrap in slashes)
tilth "/<regex>/i" --scope <dir> # case-insensitive regex/slashes/tilth "*.test.ts" --scope src/ # find test files
tilth "**/*.{json,toml}" --scope . # brace expansiontilth --map --scope src/ # structural overview| Flag | Effect |
|---|---|
| Directory to search within (default: |
| Line range ( |
| Max tokens in response — reduces detail to fit |
| Force full output, override smart view |
| Machine-readable JSON output |
| Generate structural codebase map |
| Enable edit mode: hashline output + tilth_edit tool |
tilth handleAuth --scope src/[start-end]--section── calls ──| Shell command | tilth equivalent |
|---|---|
| |
| |
| |
| |
| |
| |
.envAPI_KEYSECRETPASSWORDTOKEN<REDACTED>tilth 404tilth "import { X }"tilth READMEtilth "my file.*"tilth .env.env--full--sectiongreptilth--budget--mapWhat do you need?
├── Understanding a symbol (function, class, variable)?
│ └── tilth <symbol> --scope <dir>
│ └── Follow ── calls ── footers for callees
├── Reading a file?
│ ├── Small/medium → tilth <path> (auto full)
│ ├── Large file → tilth <path> (auto outline)
│ │ └── Need specific lines → tilth <path> --section 45-89
│ └── Markdown section → tilth <path> --section "## Heading"
├── Searching for text/patterns?
│ ├── Literal → tilth "text" --scope <dir>
│ ├── Regex → tilth "/pattern/" --scope <dir>
│ └── Case-insensitive → tilth "/pattern/i" --scope <dir>
├── Finding files?
│ ├── By extension → tilth "*.test.ts" --scope src/
│ └── By path → tilth "src/**/*.rs" --scope .
└── First time in codebase?
└── tilth --map --scope src/ (once, then search)