Query, search, and analyze your Claude Code, OpenAI Codex, GitHub Copilot, Pi, OMP, Gemini CLI, OpenCode, Cline, Roo Code, and OpenClaw sessions from the command line.
claudex reads the local transcripts of eleven coding agents — Claude Code (~/.claude/projects/), OpenAI Codex (~/.codex/), GitHub Copilot CLI (~/.copilot/session-state/), VS Code Copilot Chat (VS Code workspaceStorage), Pi (~/.pi/agent/), OMP (~/.omp/agent/sessions/), Gemini CLI (~/.gemini/tmp/), OpenCode (~/.local/share/opencode/), Cline (SDK and VS Code tasks), Roo Code (VS Code tasks), and OpenClaw (${OPENCLAW_STATE_DIR:-~/.openclaw}) — indexes them into a single SQLite database at ~/.claudex/index.db, and exposes reports as subcommands. Every report spans all eleven providers by default; narrow with --provider and the shared --since/--until/--model filters. The index is additive: sessions you archive or delete from disk stay in your history. Every read command supports --json (with a provider key per row); Claude reports also support --no-index.
📚 Docs: https://utensils.io/claudex/ — guide, per-command reference, index schema, pricing.
claudex summary # dashboard: sessions, cost, top projects, model mix
claudex cost --provider codex --since 30d # Codex spend over the last 30 days
claudex sessions --limit 10 # recent sessions across every provider
claudex session 3f2a1b # drill into one session (ID prefix or project name)
claudex search "migration" # full-text search across all transcripts
claudex search "migration" --tool Bash --context 1
claudex cost --per-session # token & cost breakdown
claudex export 3f2a1b --format markdown > session.md
claudex providers # provider roots, sync state, retention
claudex timeline --since 30d # daily usage trend
claudex budget --monthly 250 # budget burn and projection
claudex activity --since 24h # recent sessions, PRs, files, slow turns
claudex skills install # install the agent skill for Claude Code/Codex/Pi/OpenClawSee the flag support matrix for per-command --json / --no-index coverage.
Keep standard discovery and add any number of transcript directories per provider:
claudex --session-dir omp=/path/to/extra/sessions index
claudex --config /path/to/config.json sessions --provider opencode --jsonPersistent configuration lives in ~/.claudex/config.json (or $CLAUDEX_DIR/config.json); select another file with --config or CLAUDEX_CONFIG. See provider configuration for the JSON format and provider layouts.
Pick one. All four paths are covered in depth in the installation guide — pinning, module inputs, verification.
curl -fsSL https://raw.githubusercontent.com/utensils/claudex/main/install.sh | shFetches a prebuilt, stripped, SHA256-verified binary into ~/.local/bin/claudex. Override with CLAUDEX_VERSION=v0.15.1 or CLAUDEX_INSTALL_DIR=/usr/local/bin.
cargo install claudex-cli[dependencies]
claudex = "0.15.1" # x-release-plz-versionuse claudex::api::{Claudex, Filter};
fn main() -> anyhow::Result<()> {
let mut claudex = Claudex::new()?;
let summary = claudex.summary(Filter::default())?;
println!("{} sessions", summary.total_sessions);
Ok(())
}The library returns typed report structs; terminal tables, color, completions,
and self-update live in the claudex-cli package.
paru -S claudex-bin # prebuilt binary (fastest)
paru -S claudex # build from source
paru -S claudex-git # track main HEADMaintained in-tree at packaging/aur/ and auto-published on every release.
nix run github:utensils/claudex -- summary # run without installing
nix profile install github:utensils/claudex # install into user profile
nix build github:utensils/claudex # build locally → ./result/bin/claudexAs a flake input:
inputs.claudex.url = "github:utensils/claudex";Source builds require Rust 1.95+. Prebuilt binaries have no runtime dependencies.
| Command | What it does |
|---|---|
summary |
Dashboard — sessions, cost, top projects/tools, model mix |
sessions |
List sessions grouped by project (all providers) |
session <selector> |
Drill into one session: cost, tools, files, PRs, turns, stop reasons |
cost |
Token usage and approximate cost per project or per session |
search <query> |
Full-text search across session messages (FTS5), with JSON hits |
tools |
Tool usage frequency |
models |
Per-model call counts, token usage, and cost |
turns |
Per-turn timing (avg / p50 / p95 / max) |
prs |
Sessions linked to pull requests |
files |
Most frequently modified files across sessions |
providers |
Provider roots, sync status, retention, and optional parse diagnostics |
timeline |
Daily or weekly usage trend |
budget |
Monthly budget burn and projection |
activity |
Recent sessions, PRs, hot files, and slow projects |
export <selector> |
Export a session transcript as Markdown or JSON |
watch |
Tail Claude Code's debug log in real time |
index |
Manage the session index (normally updated automatically) |
update |
Self-update claudex, or print the right upgrade recipe for Nix/cargo/brew |
completions <shell> |
Generate shell completions (bash, zsh, fish, elvish, powershell) |
skills |
Generate or install the agent skill for Claude Code, Codex, Pi, or OpenClaw |
Global flag: --color auto|always|never (respects NO_COLOR). Every report accepts the shared --provider / --model / --since / --until / --on-disk-only filters; --project is a separate per-command filter.
- Quickstart — first five minutes.
- Providers & filtering — the six providers, retention, and the shared filter flags.
- How it works — data flow, modules, key invariants.
- The index — sync semantics, staleness window.
- JSON output — stable shapes for pipelines.
- Recipes — copy-paste one-liners.
- Library API — embedding claudex from Rust.
- Reference — file layout, index schema, pricing.
git clone https://github.com/utensils/claudex
cd claudex
nix develop # auto via direnv + use_flake
ci-local # fmt-check → check → clippy → test → buildAdditional commands: coverage runs cargo llvm-cov (pass --html for a browsable report). See CLAUDE.md for the full development guide.
MIT — see LICENSE.
