Skip to content

utensils/claudex

Repository files navigation

claudex

CI Deploy Docs codecov

Query, search, and analyze your Claude Code, OpenAI Codex, and Pi sessions from the command line.

claudex reads the local transcripts of three coding agents — Claude Code (~/.claude/projects/), OpenAI Codex (~/.codex/), and Pi (~/.pi/agent/) — indexes them into a single SQLite database at ~/.claudex/index.db, and exposes reports as subcommands. Every report spans all three 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.


Quickstart

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 cost --per-session                   # token & cost breakdown
claudex export 3f2a1b --format markdown > session.md
claudex skills install                       # install the agent skill for Claude Code/Codex/Pi

See the flag support matrix for per-command --json / --no-index coverage.

Install

Pick one. All four paths are covered in depth in the installation guide — pinning, module inputs, verification.

Install script — macOS + Linux

curl -fsSL https://raw.githubusercontent.com/utensils/claudex/main/install.sh | sh

Fetches a prebuilt, stripped, SHA256-verified binary into ~/.local/bin/claudex. Override with CLAUDEX_VERSION=v0.7.0 or CLAUDEX_INSTALL_DIR=/usr/local/bin.

Cargo

cargo install --git https://github.com/utensils/claudex --tag v0.7.0 claudex

AUR — Arch Linux

paru -S claudex-bin      # prebuilt binary (fastest)
paru -S claudex          # build from source
paru -S claudex-git      # track main HEAD

Maintained in-tree at packaging/aur/ and auto-published on every release.

Nix flake

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/claudex

As a flake input:

inputs.claudex.url = "github:utensils/claudex";

Source builds require Rust 1.95+. Prebuilt binaries have no runtime dependencies.

Subcommands

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
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, or Pi

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.

Documentation

Development

git clone https://github.com/utensils/claudex
cd claudex
nix develop        # auto via direnv + use_flake
ci-local           # fmt-check → check → clippy → test → build

Additional commands: coverage runs cargo llvm-cov (pass --html for a browsable report). See CLAUDE.md for the full development guide.

License

MIT — see LICENSE.