Skip to content

Session Analytics

The Session Analytics dashboard turns your chat history into signal. It surfaces performance, cost, and quality metrics — per session and across your whole workspace — so you can see what’s working, what’s expensive, and where your agents are spending time.

Analytics dashboard

  • Sidebar → Analytics
  • Command Palette: Ptah: Open Analytics
  • From any session header → View analytics for this session

The top row shows rolling KPIs for the selected time range:

KPIWhat it measures
SessionsCount of sessions in the range
MessagesTotal user + assistant turns
TokensInput + output tokens across all models
CostAggregated USD cost
Avg. qualityMean quality score (0–100)
Avg. durationMean wall-clock minutes per session

Change the time range via the picker (Today / 7d / 30d / 90d / Custom).

The performance tab breaks down:

  • Latency — time-to-first-token and time-to-last-token per message, aggregated by agent and model
  • Throughput — tokens/second distribution
  • Tool usage — which tools ran, how often, and how long each took
  • CLI helper overhead — average spawn → done time for each CLI

Use this to spot regressions: a sudden spike in time-to-first-token usually points at a model change or a slow upstream provider.

Ptah computes a quality score per session using a three-phase review protocol:

PhaseWeightWhat it checks
Style40%Lint, naming, idioms, readability
Logic35%Correctness, edge cases, dummy data, tech debt
Security25%OWASP-style vulnerabilities, secret handling

The weighted sum yields a 0–100 score. Scores update when new review-capable agents run against the session, so a session’s score can improve over time as you add tests and polish.

The trends tab plots time series for any KPI:

  • Sessions / day
  • Cost / day
  • Tokens / day split by model
  • Quality score moving average (7-day)

Hover for exact values. Click a point to drill into the sessions that made up that day.

Trend charts

Click any session to open its detailed view, which includes:

  • Timeline of every message, tool call, and agent handoff
  • Token and cost breakdown by turn
  • Quality score with per-phase sub-scores
  • Full review reports from style/logic/security agents

The Export button on each tab produces:

  • CSV (KPI tables, trends)
  • JSON (full underlying dataset)

Both exports are local — Ptah does not send analytics data anywhere.

All analytics are computed on-the-fly from your local session files. There’s no separate analytics database to manage. Delete a session from Session history and its contribution to the dashboard disappears on the next refresh.