session

A command that groups Claude usage by session ID, combining resumed transcript files into one session and showing usage details.

In plain words
What is it for?
Use it to review Claude sessions, filter by dates, sort by recent activity, show model cost breakdowns, or export JSON.
Why use it?
It prevents resumed work from appearing as separate sessions and makes session-level activity easier to inspect.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/omrikais/cctally/session
Clone the repo
git clone --depth 1 https://github.com/omrikais/cctally
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,244 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01244
Opus 5 $0.00000 $0.00622
Sonnet 5 $0.00000 $0.00249
Haiku 4.5 $0.00000 $0.00124

Measured 2d ago against content hash ace4374fa77d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

session scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/session.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

session

Claude usage grouped by sessionId. Resumed sessions (same sessionId across multiple JSONL files via claude --resume) collapse into a single row. 11-column layout that parallels codex-session.

Cost coverage: Claude dollar and token totals are transcript-derived lower bounds, not exact /usage billing totals.

Canonical form: cctally claude session (this flat form remains as an alias).

Synopsis

cctally session
    [-s YYYYMMDD] [-u YYYYMMDD]
    [-b] [-o {asc,desc}]
    [-m {auto,calculate,display}]
    [--json]

Options

Flag Description
-s, --since YYYYMMDD Filter from date (inclusive).
-u, --until YYYYMMDD Filter until date (inclusive).
-b, --breakdown Show per-model cost breakdown sub-rows.
-o, --order {asc,desc} Sort direction by last activity (default asc — earliest first).
-m, --mode {auto,calculate,display} Cost source (drop-in for ccusage session --mode). auto (default) uses the recorded costUSD from JSONL when present, else computes from embedded pricing. calculate always computes from embedded pricing, ignoring any recorded costUSD. display shows the recorded costUSD only, rendering $0.00 when a session has none (ccusage-faithful). Most modern Claude Code JSONL omits costUSD, so under display near-everything reports $0.
--tz TZ Display timezone for this call (local, utc, or IANA, e.g. America/New_York). Overrides config display.tz. See Display timezone for the full contract (parsing scope, JSON UTC invariant).
--json Output JSON.

Behavior note (auto, sessions with legacy costUSD). Before the --mode work, session was the one report that always recomputed cost from embedded pricing and ignored any recorded costUSD — even though daily, monthly, weekly, and the dashboard already preferred the recorded value. The default auto mode now aligns session (and the TUI session views, which have no --mode flag) with those reports: for sessions whose JSONL carries costUSD, default totals reflect the recorded cost rather than a recomputed one. Only the ~3.9% of historical files that still carry costUSD are affected; everything else is unchanged. Pass --mode calculate to force the old always-recompute behavior.

Read the full file on GitHub · 105 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 105 lines · 0 tokens per session scan A ace4374fa77d

Subscribe to this mod's changes

session is a command published in the GitHub repository omrikais/cctally (5 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,244 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.