Skip to main content

/trajectory-dashboard Command

Launch the agentic trajectory dashboard — a React-based visual analytics interface for exploring tool usage, agent activity, token consumption, and error patterns across sessions.

Architecture: ADR-163 | Data Source: sessions.db tool_analytics table

Usage

/trajectory-dashboard                   # Launch dashboard with last 7 days
/trajectory-dashboard --timeframe month # Launch with last 30 days
/trajectory-dashboard --port 5174 # Launch on specific port
/trajectory-dashboard --no-open # Start server without opening browser

Options

OptionDescriptionDefault
--timeframe <period>Time range: today, week, sprint, month, allweek
--port <number>Dev server port5174
--no-openDon't auto-open browserOpens browser
--sampleUse sample data (no database required)Uses real data

How It Works

  1. Data extraction — Queries sessions.db:tool_analytics for the selected time frame
  2. Aggregation — Computes time-series, agent activity, token usage, error distribution
  3. Pattern detection — Identifies bottlenecks, error clusters, token spend anomalies
  4. Dashboard launch — Starts Vite dev server and opens the React dashboard in browser

Dashboard Views

PanelDescription
Summary CardsTotal sessions, events, tokens, duration, success rate
Timeline ChartSessions, tokens, and errors over time (area chart)
Agent ActivityAgent dispatch counts sorted by frequency (bar chart)
Token UsagePrompt vs completion tokens by model (stacked bar)
Error HeatmapError types with severity, count, and recovery rate
Tool WaterfallTool performance: avg duration, p95, success rate

Implementation

# 1. Extract data from sessions.db
python3 scripts/trajectory/dashboard_data_adapter.py \
--timeframe week \
--output tools/trajectory-dashboard/src/generated/data.json

# 2. Start Vite dev server
cd tools/trajectory-dashboard
npm run dev -- --port 5174

# 3. Open browser
open http://localhost:5174