Discover Commands

Scan native session stores to see what sessions are available before converting

Sections

Terminology & Glossary
📖 Documentation
Navigation
20 sectionsv0.1
📄 Discover Commands — glaze help discover-commands
discover-commands

Discover Commands

Scan native session stores to see what sessions are available before converting

Topicminitracediscoverdiscoverdiscover claude-codediscover codexdiscover pi

The discover group scans native AI agent session stores and reports what sessions are available. Discovery does not write any files or perform conversion — it is a read-only inspection tool.

Use discovery to answer questions like:

  • How many sessions do I have?
  • What format are my sessions in?
  • Where on disk are they stored?
  • Is my source directory configured correctly before I run a conversion?

Output format

Each discover command emits one row per detected session with these fields:

FieldDescription
idSession identifier from the source format
format_hintDetected format type (e.g., jsonl-v2, jsonl-v3)
source_pathAbsolute path to the session file on disk

The output goes through Glazed, so you can choose your format:

go-minitrace discover claude-code --output json
go-minitrace discover claude-code --output yaml
go-minitrace discover claude-code --output csv

discover claude-code

Scans the Claude Code project directory for session files.

go-minitrace discover claude-code
go-minitrace discover claude-code --source-dir ~/.claude/projects
go-minitrace discover claude-code --output json
FlagDefaultDescription
--source-dir~/.claude/projectsDirectory to scan

This finds JSONL v2 transcripts and dir-v1 tool-results sessions. Subagent files within subagents/ subdirectories are discovered as well.

discover codex

Scans the Codex directory for session and exec JSONL files.

go-minitrace discover codex --source-dir ~/.codex
go-minitrace discover codex --source-dir ~/.codex --output json
FlagDefaultDescription
--source-dir~/.codexDirectory to scan

discover pi

Scans the Pi agent sessions directory for JSONL session files.

go-minitrace discover pi
go-minitrace discover pi --source-dir ~/.pi/agent/sessions
go-minitrace discover pi --output json
FlagDefaultDescription
--source-dir~/.pi/agent/sessionsDirectory to scan

Pi session directories use workspace-encoded path names like --home-manuel-code-foo--/ containing timestamped JSONL files.

Why some formats lack discover

The claude-ai, chatgpt, chatgpt-json, and turnsdb converters do not have discover subcommands. These formats take explicit file paths (--source for ZIPs and SQLite files, --source-dir for JSON directories) rather than scanning a directory tree, so there is no discovery phase — you already know the file you want to convert.

Common patterns

Count sessions across all sources:

echo "Claude Code: $(go-minitrace discover claude-code --output json | jq length)"
echo "Codex:       $(go-minitrace discover codex --source-dir ~/.codex --output json | jq length)"
echo "Pi:          $(go-minitrace discover pi --output json | jq length)"

List unique format hints:

go-minitrace discover claude-code --output json | jq '[.[].format_hint] | unique'

Find sessions in a specific project directory:

go-minitrace discover claude-code --output json \
  | jq '[.[] | select(.source_path | contains("my-project"))]'

Troubleshooting

ProblemCauseSolution
Discover finds 0 sessionsSource directory does not exist or is emptyCheck that the path exists: ls ~/.claude/projects/
Discover reports unexpected format hintsSource files are from a newer or older versionUpdate go-minitrace or check if the format is supported
Discover is slowVery large session directory with thousands of filesThis is expected; discovery walks the full tree

See also

  • go-minitrace help convert-commands — convert discovered sessions into minitrace archives
  • go-minitrace help what-is-minitrace — overview of the discover → convert → query pipeline