Commands overview
Every subcommand is listed here with a one-line summary. Click through for flags, examples, and the JSON shape.
Global flag: --color auto|always|never (respects NO_COLOR).
Read-only reports
| Command | What it does |
|---|---|
summary | Dashboard — sessions, cost, top projects/tools, model mix. |
sessions | List sessions grouped by project. |
session | Drill into one session: spend, files, tools, PRs, turns. |
cost | Token usage and approximate cost per project (or per session). |
search | Full-text search across session messages (FTS5), with JSON hits. |
tools | Tool-usage frequency, optionally per session. |
models | Call counts, token usage, and cost per model. |
turns | Per-turn timing (avg / p50 / p95 / max). |
prs | Sessions linked to pull requests. |
files | Most frequently modified files across sessions. |
Flag support matrix
Not every report accepts every flag. Consult the per-command page for exact usage; the matrix below is the quick overview.
| Command | --project | --limit | --json | --no-index |
|---|---|---|---|---|
summary | — | — | ✓ | ✓ |
sessions | ✓ | ✓ | ✓ | ✓ |
session | ✓ | — | ✓ | ✓ |
cost | ✓ | ✓ | ✓ | ✓ |
search | ✓ | ✓ | ✓ | ✓ |
tools | ✓ | ✓ | ✓ | ✓ |
models | ✓ | — | ✓ | — |
turns | ✓ | ✓ | ✓ | — |
prs | ✓ | ✓ | ✓ | — |
files | ✓ | ✓ | ✓ | — |
Notes:
searchsupports--jsonnow; case-sensitive queries still fall back to a file scan automatically.turns,prs,files, andmodelsderive their data from the index only — there's no file-scan fallback path, so--no-indexisn't accepted.summaryis a whole-tree dashboard; filtering by project or row limit doesn't apply.
Actions
| Command | What it does |
|---|---|
export | Dump a session transcript as Markdown or JSON. |
watch | Tail Claude Code's --debug-file log in real time. |
index | Manage the SQLite index — force sync or full rebuild. |
update | Self-update claudex, or print the right upgrade recipe for Nix / cargo / brew installs. |
completions | Generate shell completion scripts. |
Conventions
- Project filter.
--project foomatches any session whose decoded project path containsfoo. Worktree sessions roll up to their parent project. - Session selector. Commands that take a session (currently
sessionandexport) match on session-ID prefix or project name. - Limit default. Most commands default to
--limit 20. Pass a higher number for more rows. - Thousands separators. Token counts and message counts render as
326,297. Costs render as$12,345.67, falling back to$0.0042for sub-cent values.