agentgrep find

The agentgrep find command enumerates the on-disk prompt and history stores agentgrep can read — Codex session files, Claude Code JSONL transcripts, Cursor SQLite databases, Gemini history. Use it to inspect what agentgrep sees before running a search, or to feed a catalog into another tool.

Examples

List every store agentgrep can read for one agent:

$ agentgrep find codex

Filter by a path substring within an agent:

$ agentgrep find sessions --agent codex

Emit the catalog as JSON for downstream tools:

$ agentgrep find cursor --json

Command

Usage

usage: agentgrep find [-h] [--agent {codex,claude,cursor,gemini,all}]
                      [--limit N] [--json | --ndjson]
                      [pattern]

Positional Arguments

pattern

Optional substring to match against discovered paths

Default
None

Options

--agent

Limit results to a specific agent; repeatable

Default
[]
Choices
codex, claude, cursor, gemini, all
--limit N

Limit the number of results

Default
None
Type
int
--json

Emit one JSON document

Default
False
--ndjson

Emit one JSON object per line

Default
False

JSON output

Pass --json to emit a single JSON document containing every discovered store:

$ agentgrep find --json

The envelope carries a list of FindRecord entries. Each record carries an agent tag, the absolute path, the store kind, and discovery metadata.

--json is the right mode when the caller wants to parse the entire catalog at once — for example a wrapping agent that decides which stores to read before issuing a search call.

NDJSON output

Pass --ndjson to stream one JSON object per line:

$ agentgrep find --ndjson | jq -r '.path'

Each line is a single FindRecord. Use this mode when piping into jq, into another CLI, or into a non-MCP agent that consumes the catalog incrementally.

Filtering by agent

--agent is repeatable and limits discovery to specific backends:

$ agentgrep find --agent claude --agent codex

Pass --agent all (or omit the flag) to enumerate every available backend.