Skip to content

Codex Session Report (Beta)

The session command groups Codex CLI usage by individual sessions so you can spot long-running conversations, confirm last activity times, and audit model switches inside a single log.

Sessions are listed oldest-to-newest by their last activity timestamp so the output lines up with the daily and monthly views. Each row shows the activity date, the Codex session directory, and a short session identifier (last 8 characters of the log filename) alongside token and cost columns. When your terminal narrows (or --compact is passed) the table automatically collapses to just Date, Directory, Session, Input, Output, and Cost to stay readable.

bash
# Recommended (fastest)
bunx @ccusage/codex@latest session

# Using npx
npx @ccusage/codex@latest session

Options

FlagDescription
--since / --untilFilter sessions by their activity date (YYYYMMDD or YYYY-MM-DD)
--timezoneOverride the timezone used for date grouping and last-activity display
--localeAdjust locale for table and timestamp formatting
--jsonEmit structured JSON ({ sessions: [], totals: {} }) instead of a table
--offline / --no-offlineForce cached LiteLLM pricing or enable live fetching
--compactForce compact table layout (same columns as a narrow terminal)

JSON output includes a sessions array with per-model breakdowns, cached token counts, lastActivity, and isFallback flags for any events that required the legacy gpt-5 pricing fallback.

Need time-based rollups instead? Check out the daily and monthly reports for broader aggregates that reuse the same data source.

Released under the MIT License.