collie
Incrementally indexed code search.
Specialized for your projects.
Faster than grep / ripgrep.
cargo install collie-search

github.com/suleymanozkeskin/collie

Search doesn't scale

ripgrep on a 29K-file repo (Kubernetes). Every query re-scans every file.

$ rg -l "kubelet"
690 ms
Full scan, every time
$ rg -l "context"
612 ms
Same cost, different query
$ collie search "kubelet"
12 ms
Index lookup

grep/rg also have no understanding of code structure. Just raw text.

What is Collie?

A lexical and structural search CLI that indexes your codebase once, keeps it current
while the daemon runs, and auto-stops when you're done.

Not a replacement for traditional search, specialized for agentic development, indexed per project / worktree.

~10ms
Search latency on 29K files
10
Languages with symbol extraction
3
Search modes

How it works

# Start the daemon (indexes + watches for changes)
$ collie watch .

# Search instantly
$ collie search "handler"

# Stop when done (or auto-stops after 30min idle)
$ collie stop .

Index once → query faster → incremental updates via FSEvents

Three search modes

Token
Keyword search with % wildcards
$ collie search "kube%"           # prefix
$ collie search "%config"         # suffix
$ collie search "handle request"  # multi-term AND
Symbol
Structural queries via Tree-sitter. Filter by kind: lang: path: qname:
$ collie search "kind:fn handler"
$ collie search "kind:struct lang:go"
$ collie search "kind:method qname:Server::run"
Regex
Full regex, index-accelerated. Literal fragments narrow files first.
$ collie search -e "func\s+\w+Handler"
$ collie search -e "TODO|FIXME|HACK"  # multi-pattern
$ collie search -e "impl.*Error" -i  # case-insensitive

Structural query vocabulary

Filters
kind:fn|method|class|struct|enum|interface|trait
     variable|field|property|constant|module|type|import
lang:go|rust|python|typescript|c|cpp|java|csharp|ruby|zig
path:src/api/              # scope to directory
qname:Server::run          # qualified name
Examples
$ collie search "kind:fn lang:go path:pkg/api/ init"
$ collie search "kind:struct Config"
$ collie search "kind:method qname:HollowKubelet::Run"
$ collie search "kind:trait path:src/ %Error%"

14 symbol kinds. 10 languages. Powered by Tree-sitter AST parsing.

Lexical search: Collie vs ripgrep

Query Collie ripgrep Speedup
kubelet 12 ms 690 ms 57x
context 12 ms 612 ms 51x
controller 9 ms 466 ms 52x
kube% (prefix) 14 ms 871 ms 63x
%config (suffix) 12 ms 480 ms 40x
%request% (substring) 133 ms 518 ms 4x

Visualized: kubelet search

Collie
12 ms
ripgrep
690 ms
57x faster

Symbol search (no rg equivalent)

Query Collie
kind:fn handler 14 ms
kind:struct SharedInformerFactory 11 ms
kind:fn path:pkg/ init 23 ms
kind:method qname:HollowKubelet::Run 9 ms
kind:fn validate webhook 9 ms

Find functions, structs, methods — not just text matches.
Powered by Tree-sitter across 11 languages.

Regex search (index-accelerated)

Pattern Collie ripgrep Speedup
func\s+\w+Handler 280 ms 460 ms 1.6x
interface\s*\{ 175 ms 466 ms 2.7x
context\.Context 303 ms 438 ms 1.4x

Collie extracts literal fragments from your regex,
narrows candidate files via the index, then applies the full regex.

Agents know what they're looking for

ripgrep: guess the source syntax
$ rg "func \(.*Authorization.*\) Validate"          477 ms
collie: say what you mean
$ collie search "kind:method path:pkg/kubeapiserver/options/ %validate%"  84 ms

Agents already know the kind, language, and approximate location.
Structural queries turn that knowledge into precise results.

Task breakdown (time to first hit)

Task Symbol Lexical ripgrep
Find HollowKubelet::Run 24 ms 23 ms 697 ms
Webhook token authenticator 152 ms 87 ms 480 ms
Authorization options validator 78 ms 24 ms 441 ms
SharedInformerFactory constructor 87 ms 57 ms 399 ms
PodDisruptionBudget validator 77 ms 32 ms 370 ms

Built for AI agents

JSON output
--format json — structured, parseable, no regex-on-grep hacks
Exit codes
0 results   1 nothing   2 error — shell-scriptable
Skill card
collie skill prints a reference card for agent context
Latency
Agents run hundreds of searches per session. 12ms vs 690ms compounds.
$ collie search "kind:fn handler" \
    --format json -n 5
{
  "type": "symbol",
  "count": 5,
  "results": [{
    "path": "pkg/api/handler.go",
    "line": 42,
    "kind": "function"
  }, ...]
}
$ echo $?
0

Under the hood

source files
Tree-sitter AST parsing → symbols, kinds, scopes
Tantivy Full-text index → tokens, postings, reverse index
notify FSEvents watcher → incremental updates
rayon Parallel indexing → 29K files in 9.7s
collie search

All Rust. Single binary. No runtime dependencies.

11 languages

GoRustPythonTypeScript • JavaScript
C • C++ • Java • C# • Ruby • Zig


Symbol extraction: functions, methods, structs, classes, enums,
interfaces, traits, variables, fields, constants, modules, type aliases, imports

Indexing performance


Files Rebuild Index size Peak RAM
Collie repo 71 0.2s 588 KB 25 MB
Kubernetes 28,903 9.7s 207 MB 527 MB

One-time cost. After that, notify keeps the index current incrementally.

Get started

Install
$ cargo install collie-search
Index
$ collie watch .              # start daemon, index repo
$ collie status .             # verify it's running
Search
$ collie search "handleRequest"
$ collie search "kind:fn path:src/ init"
$ collie search -e "func\s+\w+Handler"
$ collie search "config" --format json  # for agents
Teach your agent
$ collie skill               # prints reference card for LLM context
collie
57x
faster than ripgrep
11
languages
10ms
search latency
cargo install collie-search

github.com/suleymanozkeskin/collie