Skip to main content

agrep

Search everything your AI agents have done.

agrep is a local search engine for the conversations, tool calls, decisions, and source context your agents leave on disk. It gives you one grep-like index across Claude Code, Codex, opencode, Gemini, Cursor, pi, and more—then lets you open the exact context or resume the original chat.

$ agrep "retry backoff"
claude  payments  ... capping the backoff at 30s and adding jitter ...

$ agrep around @3f2a91c4:88.d1e0
$ agrep resume @3f2a91c4:88.d1e0
$ agrep board

Install

uv tool install agrep
agrep setup
agrep "race condition"

Other options:

uvx agrep "race condition"       # try it without installing
pipx install agrep
npm install -g @mundy/agrep      # npm shim; requires uv or pipx

setup shows a consent screen before it writes agent instruction blocks, compaction hooks, the cleanup sentinel, or optional model/archive data. The only --no-teach --no-hook together leave the box without those integrations; agrep remove undoes them without deleting your histories or search index.

Nothing deletes the index for you: it is the searchable copy of your agent conversations. agrep doctor prints its data path; delete that directory yourself when you want the copy gone.

The commands you actually need

agrep <pattern>                  # keyword search; first run builds the index
agrep "cache bug" --agent codex  # filter by agent
agrep -E "TODO|FIXME"            # regular expression search
agrep -l auth                    # matching chats, not every line
agrep "exit 137" --who tool     # include tool output explicitly
agrep "flaky test" --semantic    # optional meaning search
agrep "rust simd" --sort time    # newest matches first
agrep akd --count-by-tier        # exhaustive diagnostics

agrep around <id> <turn>         # context around a hit
agrep around @handle             # context from a printed handle
agrep resume <id>                # reopen a session in its own agent
agrep chats [topic]              # search indexed sessions and identities
agrep board                      # bounded live activity across agents
agrep status --json              # machine-readable health summary
agrep doctor                     # bounded health check
agrep audit                      # ingest coverage and accounting checks

Agent-facing output is compact, bounded, and includes digest-checked @session:turn.digest handles. Human terminals get the classic renderer. agrep around @handle opens the cited evidence; agrep --more m.XXXXXXXX gets the next page.

What it indexes

Sources are opened read-only. Missing stores are skipped, and the index records what it could actually observe rather than pretending every agent has the same format.

Agent Store
Claude Code ~/.claude/projects/<slug>/*.jsonl
Codex ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl
opencode ~/.local/share/opencode/*.db (SQLite)
Antigravity ~/.gemini/antigravity-cli/brain/<uuid>/
Kimi CLI ~/.kimi/sessions/<workdir-hash>/<uuid>/
Cline editor globalStorage/saoudrizwan.claude-dev/tasks/, plus ~/.cline/data/
Gemini CLI ~/.gemini/tmp/<hash>/chats/session-*.jsonl plus legacy session files
crush ~/.local/share/crush/crush.db plus registered per-project stores
Cursor editor globalStorage/state.vscdb (SQLite)
pi / oh-my-pi ~/.pi/agent/sessions/<cwd-slug>/*.jsonl and ~/.omp/agent/sessions/<cwd-slug>/*.jsonl

All ten adapters are searchable through keyword search and recall. Live tailing and native resume support the agents that expose those capabilities. Copilot CLI and qwen-code are detected by doctor but are not parsed yet.

Local by design

  • Transcript content is never uploaded.
  • Source stores are read-only to the indexer.
  • Derived data lives in the platform data directory (agrep doctor prints it): ~/Library/Application Support/agrep on macOS, ~/.local/share/agrep on Linux, or %LOCALAPPDATA%\agrep on Windows.
  • A current, exhaustive keyword miss exits 1; an unverified absence exits 2.

Semantic search is optional. Core keyword search, around, recall, resume, archive/restore, live views, and event trees do not require the semantic model. Use agrep doctor --deep to see exactly which optional capabilities are available on the current machine.

Speed

The release gate measures full process runs, not an internal scanner timer. The committed keyword budgets are:

Path Budget
Selective keyword query 120 ms
100,000-hit sweep 900 ms
Two-character query 350 ms
Cold ingest: 4,600-file store 3.5 s
Cold streamed completion 3.75 s
First streamed hit 150 ms

Run the proofs locally:

python bench/perf.py --check
python bench/semantic_cli_scale.py --check

The benchmark suite also covers semantic scale, embedding throughput, memory, portable builds, and release identity. See bench/ for the contracts rather than trusting one machine's best-case number.

How it works

A Rust ingest reads each supported store and writes one normalized row shape. The Python layer owns command orchestration and terminal output. A derived SQLite FTS5 index makes warm keyword searches fast; an optional local ONNX worker powers meaning search. No hosted service is required.

The index is refreshed on demand. Later searches can reuse a lightweight freshness daemon while the previous complete publication remains readable. The semantic lane has its own generation and coverage disclosures, so stale or mismatched vectors are not served as current evidence.

Development

git clone https://github.com/dannyisbad/agrep.git
cd agrep
python cli.py setup
python cli.py "search term"

Source builds need Python 3.10+ and Rust. The core implementation is in crates/agrep-core, crates/agrep-cli, and py/; contributor conventions are in CONTRIBUTING.md.

License

MIT. See LICENSE.

Metadata

Release files for agrep 0.4.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agrep 0.4.6
File Size Uploaded Provenance Actions
agrep-0.4.6.tar.gz 1.7 MB With provenance Details for agrep-0.4.6.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for agrep 0.4.6
File Actions
agrep-0.4.6-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details for agrep-0.4.6-py3-none-win_arm64.whl
agrep-0.4.6-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for agrep-0.4.6-py3-none-win_amd64.whl
agrep-0.4.6-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for agrep-0.4.6-py3-none-manylinux_2_28_x86_64.whl
agrep-0.4.6-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for agrep-0.4.6-py3-none-manylinux_2_28_aarch64.whl
agrep-0.4.6-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for agrep-0.4.6-py3-none-macosx_11_0_x86_64.whl
agrep-0.4.6-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for agrep-0.4.6-py3-none-macosx_11_0_arm64.whl

Total release size: 30.3 MB

Release files / agrep-0.4.6.tar.gz

Download URL agrep-0.4.6.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
ed2cfd9e17801009657dc48dd0c2572a30e5ae0228712c8351b930dec47210b3
BLAKE2b-256 checksum
How to use checksums
a951ae75d264f08e09ab05968345684ab7dedf5dce8d9187cfff8f6ed72ea73b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / agrep-0.4.6-py3-none-win_arm64.whl

Download URL agrep-0.4.6-py3-none-win_arm64.whl
Size 4.6 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
1b7218c80f497a1816d8604b4f946b89f1264035ddd3e8673bc8a68758e8a1b8
BLAKE2b-256 checksum
How to use checksums
f9160708f88da25176a8c399d6c7f33873622a9b701144b52c910594e6167659
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / agrep-0.4.6-py3-none-win_amd64.whl

Download URL agrep-0.4.6-py3-none-win_amd64.whl
Size 5.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
e243351b7420d173f2c18ab29e756e3c408a066b94635a037a69db459d600b23
BLAKE2b-256 checksum
How to use checksums
ac469a18677967e4105ab6beed21f78a142cc972459f376122c3e79cbfa67ff8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / agrep-0.4.6-py3-none-manylinux_2_28_x86_64.whl

Download URL agrep-0.4.6-py3-none-manylinux_2_28_x86_64.whl
Size 5.0 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
17517a92251377a71b0b2ae2543be4f4a7cc61c576cb558b2979013745013efd
BLAKE2b-256 checksum
How to use checksums
47c1a00ce56c54fe039776021c66d519c4c0f2aef37ffabccfe8e5e287fe6424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / agrep-0.4.6-py3-none-manylinux_2_28_aarch64.whl

Download URL agrep-0.4.6-py3-none-manylinux_2_28_aarch64.whl
Size 4.7 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
760bd8476437b13694e645949fb916623a11379175ee30559d640c114a541e43
BLAKE2b-256 checksum
How to use checksums
e606ed3486842c1dc3a2cbd1329d536ecdd2e381853a20a9a0f66f04ed7d1c3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / agrep-0.4.6-py3-none-macosx_11_0_x86_64.whl

Download URL agrep-0.4.6-py3-none-macosx_11_0_x86_64.whl
Size 4.8 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
d5485334a353878f1db3d6ed7e6c98bfddd3ada3d9fe4536d5de67a484d88fa0
BLAKE2b-256 checksum
How to use checksums
d8187fb765238c8c4b5e623734a418001ddcc05cf3f93d7e2a9be4a3d45f1031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / agrep-0.4.6-py3-none-macosx_11_0_arm64.whl

Download URL agrep-0.4.6-py3-none-macosx_11_0_arm64.whl
Size 4.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
73e479fa3d0f0a4cbcbce09edc106bd7976b33e07d3d8da34636e8f065bbc521
BLAKE2b-256 checksum
How to use checksums
04154e6d8f768148c9f863de1f0f636b8b7f06181adc5859b3d8091ffd88ac52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for agrep 0.4.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for agrep-0.4.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page