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, and every meaning hit is re-proved against the current transcript text, so changed 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.8

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.8
File Size Uploaded Provenance Actions
agrep-0.4.8.tar.gz 1.7 MB With provenance Details for agrep-0.4.8.tar.gz

Built distributions (wheels)

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

Total release size: 30.3 MB

Release files / agrep-0.4.8.tar.gz

Download URL agrep-0.4.8.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
a695af3c59686f87438ec54d6136c3ecf2825176e477811447c588d2beaaee2a
BLAKE2b-256 checksum
How to use checksums
d6c80d9fa998fecdab985033fa50702c1371e6aee5ba48211441e51ace7a9b7f
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 28, 2026.

Transparency log

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

Download URL agrep-0.4.8-py3-none-win_arm64.whl
Size 4.6 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
159ffc3488a150aa9f53e10b974abdde28bef3b87214793f328818ac8d8d2f08
BLAKE2b-256 checksum
How to use checksums
c2786e6685e586e1ea6aa5c5f0bc141a51c761e9f14ab8885f767e120110cab5
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 28, 2026.

Transparency log

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

Download URL agrep-0.4.8-py3-none-win_amd64.whl
Size 5.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
8719b5550f1f5ad78b60933085be4c3259dc73002c18ef522712767e778eccf1
BLAKE2b-256 checksum
How to use checksums
f9456fffdc2f1c06857275b7972cf65bc6729207bd4cbc4edd30ef3c4e1b0f1b
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 28, 2026.

Transparency log

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

Download URL agrep-0.4.8-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
3f353520d285de43b8d9103c098b56b45c5b3843dd34cd128dcf61fdab45289a
BLAKE2b-256 checksum
How to use checksums
5be3be531999d032ef5111a9f08753a707aab07f366695c22f338198b54e2ae3
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 28, 2026.

Transparency log

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

Download URL agrep-0.4.8-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
b5ff252fd3d3c7ee9d2e6f2463c4f43cac0a9584050ab83f378626163af092e3
BLAKE2b-256 checksum
How to use checksums
85852c57d58fa600ef97a8bfa413beb95abbc43a7227326fe80ccd0c889cf016
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 28, 2026.

Transparency log

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

Download URL agrep-0.4.8-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
a367ddaa17bb4fd793a7c0f2021c744ec0d2b6ab4146cda4f0f290c10b819d20
BLAKE2b-256 checksum
How to use checksums
f61641e9c2084bfdad3172358fdd4cdbe10e9fc83b4917b441fedafc17e31cf5
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 28, 2026.

Transparency log

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

Download URL agrep-0.4.8-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
e983545485177e90eae7cd164a9f0bd7de2eddf28040048ba66eedeefec4ff81
BLAKE2b-256 checksum
How to use checksums
9a8db0851bf356d96f7f6c087983167454e6eb41c9675e85c0911c0e1978231c
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 28, 2026.

Transparency log

Security for agrep 0.4.8

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.8.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 28, 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