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.2-py3-none-win_amd64.whl (1.6 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ x86-64

glep-0.2.2-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.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

glep-0.2.2-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.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: glep-0.2.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for glep-0.2.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 dc84fed332b27b8e6846faf9d8a886e9f1627893df07e6365a55922d6d34c88d
MD5 58ab6c01c0aa4bccb82833e6eeecdc2c
BLAKE2b-256 ff7c371b1524b1f7fbb67d38c90c0add83cc40401d77d86c45985ef0e41c491b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for glep-0.2.2-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c576ea8f8a9a4bf630c7bc4b86536c751574e0e4b8c12a16cec96343c97e56ea
MD5 3391483961c87cb6023fb458a22d3121
BLAKE2b-256 733cbe9eec257d289192da9972a58567c0447ce726f3c0bfc727a40b98322283

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for glep-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57ca79a3657daeaa8cbded2fa99b68fffee3b73bbcaadd4559a9d3e9a1660550
MD5 46634c0258020060f1f60c9a06f4a94a
BLAKE2b-256 ed187c97384afea385cf8e0a2760a23590f142b21ee435d18f235c8edb339dd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for glep-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b4e63427392491e63a137c7e60b34fc4f64b8ad23c249bc47d6224dd10db1dac
MD5 46ff92ba91e59091140a85cebe6c7fab
BLAKE2b-256 f8630af98714d2064a776004e365e63a5f8587728b4b4d1534a9cb943dc86c1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for glep-0.2.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8db372cfc1fa2742ee989e75d4bed827eb07a077ca012271c0a698efe94c713d
MD5 f615df0d0f02389d69d037345459935d
BLAKE2b-256 64df6d4f240e9bee7bbcd69f10faf0b5b0378d10de21c85ae56ec5ae050e8e24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for glep-0.2.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4b5aec5c54485e696ad861b36cfb387894b59e3ff04b4090de635fadcf0e3062
MD5 3a9e005b75836107f15f47ef76d47460
BLAKE2b-256 4d8997d64cde2cb2f8513802453e62a306e515c97f8fe37b2b534ee8741c5b70

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