Indexed grep + glob for AI agents
Project description
Indexed grep + glob for AI agents.
Ripgrep pays the full scan cost on every query. glep pays it once: a persistent, self-healing trigram index answers warm content queries in ~1-20ms and glob listings with zero filesystem traversal, with output byte-compatible with ripgrep's and no daemon.
Why
Coding agents call Grep and Glob dozens of times per session. On monorepo-scale projects each call costs seconds. glep replaces both with index-backed equivalents built on ripgrep's own crates (ignore, grep-searcher, regex-syntax), so correctness is inherited, not reimplemented.
When to use it
| Use glep | Stick with rg / fd |
|---|---|
| Agent sessions firing dozens of searches over one repo (the bundled hook reroutes Grep/Glob) | One-off searches in a tree you will never search again |
| Monorepos where rg takes 100ms+ per query; warm glep answers in ~1-20ms | Small repos where rg already answers in under ~50ms |
Repeated glob listings: glep --files reads the manifest, no traversal |
Ephemeral CI runners where the index never persists between runs |
Read-heavy bursts with --ttl 5 to amortize the freshness sweep |
rg features glep v1 lacks: count mode, replacements, multiline, PCRE2, compressed files |
| Correctness-critical work: self-healing index, sound full-scan fallback | Corpora dominated by binaries or files over the 1MB cap (live-scanned anyway) |
How it works
- A file-level trigram inverted index (the Russ Cox / csearch model) lives in
.glep/, memory-mapped, a few percent of corpus size. - Every query self-heals: a fast parallel mtime sweep incrementally reindexes only what changed, then answers. No watcher, no background process.
- The regex becomes a trigram plan, postings intersection yields a handful of candidate files, and ripgrep's searcher runs over just those.
- Patterns trigrams can't narrow fall back to a full parallel scan: never a wrong answer, worst case is rg-speed.
Interface
glep 'fn parse_intent' src/ # content search (Grep replacement)
glep --files '**/*.py' # glob listing (Glob replacement)
glep --json 'pattern' # machine-readable output for agents
glep index # explicit (re)build; lazy on first query
glep status # index stats
Ships with a Claude Code skill and a PreToolUse hook that routes built-in Grep/Glob calls through glep automatically.
Install
pip install glep # binary wheel, no Rust toolchain needed
# or
cargo install glep
Claude Code integration (skill + hook): claude/install.sh.
Status
v0.1.0. Spec: docs/superpowers/specs/2026-07-14-glep-design.md.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file glep-0.1.0-py3-none-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: glep-0.1.0-py3-none-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58936f0966a5c0231b14ccadd3594b4088d5432d32fc8be87c1ade7e39cee005
|
|
| MD5 |
43a883b088ffbe02fd76c24e635f58f9
|
|
| BLAKE2b-256 |
48d7547fcf18eef606958cd6454379a86269aa5458ff7ef54d43d1af84d7d451
|
File details
Details for the file glep-0.1.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: glep-0.1.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5361347b0993503f9355b789eb44832417388b427bab8a6aee88b9a487e075b
|
|
| MD5 |
f66438d138624edcfffad61782700447
|
|
| BLAKE2b-256 |
ec597322eea2427bc57af76613b8b6f9127008a88e244bb151eb56ddcfeb45fb
|