Skip to main content

Indexed grep + glob for AI agents

Project description

glep

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 lacks: replacements, 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)

Numbers

Linux kernel 6.12 checkout: 86,605 files, ~1.5 GB. Apple Silicon macOS, hyperfine medians, warm filesystem cache, rg and fd at their default parallelism.

Scenario glep glep --ttl 5 ripgrep fd
Rare pattern 173 ms 21 ms 1.42 s
Common pattern (~10k matches) 90 ms 1.54 s
List all .c files (--files) 242 ms 44 ms 92 ms
Index build (one-time) 24 s

Default glep pays the self-healing freshness sweep (a stat of every file) on each query; --ttl amortizes it across read bursts. Index size: 154 MB, about 10% of the corpus. The parity harness pins byte-equality with rg's output; speed differs, bytes do not.

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

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

glep-0.2.1-py3-none-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

glep-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

glep-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

glep-0.2.1-py3-none-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

glep-0.2.1-py3-none-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file glep-0.2.1-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for glep-0.2.1-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c419364ccb6afc391e2de5467084b0a8d7f4326bfcf86bf8bb368c3bfd1101fb
MD5 795e7208ebe4da98bac78e501c3e0665
BLAKE2b-256 75758db98414e082e7dd4eb72ff790767487755f980609680f5b90059d4d738f

See more details on using hashes here.

File details

Details for the file glep-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for glep-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4084167ff9ccf5dfafc6e420fdf43ee2629d68bbf0aab49d0458f70f617b39b9
MD5 58337008c6c8e11214d76cfba679d708
BLAKE2b-256 65304e05247a144738e14f710200175e8ab47e02e4a890dfdaeb63e0f5580aab

See more details on using hashes here.

File details

Details for the file glep-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for glep-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 51364f38cc6dff45952d07b6ee51d3662b878933925223b09244609aa07a37ee
MD5 cbc3c3644b2908018b61590a59950b5b
BLAKE2b-256 7132577ab56cca5df385a08a131ad95449d0520c8792142d053075bd17528c36

See more details on using hashes here.

File details

Details for the file glep-0.2.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for glep-0.2.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8a91bed63ee006f73565c6e76a5ab37f5c13dcf45aa4a09950b2029f5790307d
MD5 1a0f77752ccd5f6bd724f0d2c3cd9afd
BLAKE2b-256 c67347d9792f6710bc4f46a494ba1b24e3b2ae87290bc3103562443e18696bed

See more details on using hashes here.

File details

Details for the file glep-0.2.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for glep-0.2.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ddf90cdcd3cff35aa9028c2882a2233bcc4273f0fb4bd1ba4c611a16800a869e
MD5 5e99c3e231c81f69d7c730e0a5a6f1cc
BLAKE2b-256 331458aee60fa54b498fea99dc0c9922228c28a9202908e32861ad591527fc52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page