Skip to content

Session Metrics

Navi tracks token usage, time, and tool activity for each session. Metrics are displayed as inline badges in the session list and in a detailed metrics view.

Each session row can show metric badges:

⏱ 1h 23m 🔧 45 📊 57k tokens
  • Time: Total session duration
  • Tools: Number of tool invocations
  • Tokens: Total token usage (input + output)

Press i on a selected session to open the metrics detail view with full breakdowns.

Token usage is extracted from Claude Code session transcript files at ~/.claude/projects/. Navi maps a session’s working directory to its transcript by converting the path (e.g., /home/sean/workspace/navi becomes -home-sean-workspace-navi) and reading the most recently modified .jsonl file.

Token breakdown:

  • Input tokens: Tokens sent to the model
  • Output tokens: Tokens generated by the model
  • Cache tokens: Cache read + cache creation tokens

Thresholds:

  • Warning (yellow): 100k tokens
  • Critical (red): 500k tokens

Format examples: 0, 500, 1.2k, 45k, 1.5M

  • Total duration: Time since session started
  • Working time: Time actively processing
  • Waiting time: Time waiting for user input

Format examples: 45s, 5m, 1h 23m, 2h

Tracked by the tool-tracker.sh hook script:

  • Recent tools: Last 10 tools used (e.g., Read, Write, Bash)
  • Tool counts: How many times each tool was invoked
  1. The notify.sh hook writes time metrics (start time, status transitions) to session JSON
  2. The tool-tracker.sh hook increments tool counts on each PostToolUse event
  3. Token metrics are read from Claude Code’s JSONL transcript files
  4. All metrics are aggregated and displayed in the TUI