zat is a code outline viewer. It shows exported symbols and line numbers at a glance.
Works great as a tool for LLM coding agents — they can see the outline first, then Read only the parts they need.
The name comes from Japanese ざっと (zatto), meaning "roughly" or "at a glance".
brew install bglgwyng/tap/zatnix profile install github:bglgwyng/zatOr run directly:
nix run github:bglgwyng/zat -- <FILE>Also available via llm-agents.nix.
cargo install --git https://github.com/bglgwyng/zatDownload from GitHub Releases. Available for macOS (aarch64, x86_64) and Linux (x86_64).
zat src/lib.rsstruct OutlineEntry { // L8-L12
signature: String
start_line: usize
end_line: usize
}
struct ImportEntry { // L14-L18
source_text: String
start_line: usize
end_line: usize
}
fn extract_outline(source: & str, path: & str) -> OutlineResult // L33-L196
Only public/exported symbols are shown. Visibility modifiers (pub, export) are stripped for brevity. Struct fields, enum variants, and interface members are included.
| Language | Extensions |
|---|---|
| JavaScript | .js, .jsx, .cjs, .mjs |
| TypeScript | .ts, .tsx, .mts, .cts |
| Rust | .rs |
| Python | .py |
| Go | .go |
| Java | .java |
| C | .c, .h |
| C++ | .cpp, .cc, .cxx, .hpp, .hxx |
| C# | .cs |
| Swift | .swift |
| Kotlin | .kt, .kts |
| Haskell | .hs |
| Ruby | .rb |
All languages are parsed with tree-sitter.
Add this to your CLAUDE.md or AGENTS.md:
## Tools
### zat
A code outline viewer that shows exported symbol signatures with line numbers.
Prefer `zat` over `cat`/`Read` when you need signatures, not full implementation. Use the line numbers in the output to `Read(offset, limit)` into specific sections.
Supported languages: C, C++, C#, Go, Haskell, Java, JavaScript, Kotlin, Markdown, Python, Ruby, Rust, Swift, TypeScript/TSX
`zat` exits with code 1 for unsupported languages.