cargo install collie-search
github.com/suleymanozkeskin/collie
ripgrep on a 29K-file repo (Kubernetes). Every query re-scans every file.
$ rg -l
"kubelet"
$ rg -l
"context"
$ collie
search "kubelet"
rg varies 2–3x across runs. Collie stays under 15
ms.
grep/rg also have no understanding of code structure.
Just raw text.
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.
# 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
% wildcards
$ collie search "kube%" # prefix $ collie search "%config" # suffix $ collie search "handle request" # multi-term AND
kind: lang:
path: qname:
$ collie search "kind:fn handler" $ collie search "kind:struct lang:go" $ collie search "kind:method qname:Server::run"
$ collie search -e "func\s+\w+Handler" $ collie search -e "TODO|FIXME|HACK" # multi-pattern $ collie search -e "impl.*Error" -i # case-insensitive
--symbol-regex
$ collie search "kind:fn %Handler" --symbol-regex '\*.*Server'
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
$ 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.
include_pdfs = true
$ collie search "authentication flow" src/auth/handler.go:14 func authFlow() { docs/design-spec.pdf:3 Section 4.2: Authentication Flow rfcs/auth-v2.pdf:1 RFC: Revised authentication flow
Design specs, RFCs, API docs, research papers — indexed
alongside code.
grep and ripgrep can't do this.
Benchmark — Kubernetes repo, 28,903 files
| Query | Collie p50 | ripgrep range | Speedup |
|---|---|---|---|
kubelet |
13 ms | 357–877 ms | 27–67x |
context |
13 ms | 372–561 ms | 29–43x |
controller |
9 ms | 333–622 ms | 37–69x |
kube%
(prefix)
|
11 ms | 424–737 ms | 39–67x |
%config
(suffix)
|
10 ms | 347–909 ms | 35–91x |
%request%
(substring)
|
119 ms | 352–708 ms | 3–6x |
ripgrep ranges measured across 23 benchmark sessions. Collie stays consistent; rg varies 2–3x with cache state.
Benchmark — Kubernetes repo
kubelet searchBenchmark — Kubernetes repo
| Query | Collie p50 | Range |
|---|---|---|
kind:fn handler |
11 ms | 7–15 ms |
kind:struct SharedInformerFactory
|
9 ms | 8–18 ms |
kind:fn path:pkg/ init |
15 ms | 13–20 ms |
kind:method
qname:HollowKubelet::Run
|
8 ms | 8–17 ms |
kind:fn validate webhook |
10 ms | 8–24 ms |
Find functions, structs,
methods — not just text matches.
Powered by Tree-sitter across 11
languages.
Benchmark — Kubernetes repo
| Pattern | Collie p50 (-n 50) | ripgrep p50 | Speedup |
|---|---|---|---|
func\s+\w+Handler |
15 ms | 366 ms | 24x |
interface\s*\{ |
11 ms | 398 ms | 36x |
context\.Context |
12 ms | 384 ms | 31x |
Collie extracts literal fragments from your regex,
narrows candidate files via the index, then applies the
full regex.
Honest framing: Collie regex is optimized for
interactive bounded queries.
For exhaustive -n 0 scans, ripgrep still
wins today.
Why this matters for agents
$ rg "func \(.*Authorization.*\) Validate" 333–622 ms
$ collie search "kind:method path:pkg/kubeapiserver/options/ %validate%" 78 ms
Agents already know the kind, language, and approximate
location.
Structural queries turn that knowledge
into precise results.
New capability
Narrow with structure first, refine with regex. No rg equivalent.
| Intent | Collie | rg regex | Speedup |
|---|---|---|---|
Methods on *Server ending in
Handler
|
50 ms | 620 ms | 12x |
Methods on Server containing
Handler
|
<10 ms | 340 ms | 34x+ |
| Validate functions related to webhooks | 130 ms | 350 ms | 2.7x |
$ collie search "kind:fn %Handler" --symbol-regex '\*.*Server' $ collie search "kind:method qname:Server::" --symbol-regex 'Handler' $ collie search "kind:fn %validate%" --symbol-regex 'webhook|Webhook'
The more structural info in the symbol query, the faster the regex refinement.
Agentic benchmark — per-task
| 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 |
--format json —
structured, parseable, no regex-on-grep
hacks
0 results
1 nothing
2 error —
shell-scriptable
collie skill prints a reference
card for agent context
$ 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
collie search
All Rust. Single binary. No runtime dependencies.
Go •
Rust •
Python •
TypeScript •
JavaScript
C • C++ •
Java • C# • Ruby
• Zig
Symbol extraction: functions, methods, structs, classes,
enums,
interfaces, traits, variables, fields, constants,
modules, type aliases, imports
| Files | Rebuild | Index size | Peak RAM | |
|---|---|---|---|---|
| Collie repo | 75 | 0.3s | 675 KB | 26 MB |
| Kubernetes | 28,903 | 7.5s | 214 MB | 534 MB |
One-time cost. After that,
notify
keeps the index current incrementally.
$ cargo install collie-search
$ collie watch . # start daemon, index repo $ collie status . # verify it's running
$ collie search "handleRequest" $ collie search "kind:fn path:src/ init" $ collie search -e "func\s+\w+Handler" $ collie search "kind:fn %Handler" --symbol-regex '\*.*Server' $ collie search "config" --format json # for agents
$ collie skill # prints reference card for LLM context
cargo install collie-search
github.com/suleymanozkeskin/collie