/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.dbtool_analyticstable
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
| Option | Description | Default |
|---|---|---|
--timeframe <period> | Time range: today, week, sprint, month, all | week |
--port <number> | Dev server port | 5174 |
--no-open | Don't auto-open browser | Opens browser |
--sample | Use sample data (no database required) | Uses real data |
How It Works
- Data extraction — Queries
sessions.db:tool_analyticsfor the selected time frame - Aggregation — Computes time-series, agent activity, token usage, error distribution
- Pattern detection — Identifies bottlenecks, error clusters, token spend anomalies
- Dashboard launch — Starts Vite dev server and opens the React dashboard in browser
Dashboard Views
| Panel | Description |
|---|---|
| Summary Cards | Total sessions, events, tokens, duration, success rate |
| Timeline Chart | Sessions, tokens, and errors over time (area chart) |
| Agent Activity | Agent dispatch counts sorted by frequency (bar chart) |
| Token Usage | Prompt vs completion tokens by model (stacked bar) |
| Error Heatmap | Error types with severity, count, and recovery rate |
| Tool Waterfall | Tool 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
Related
- Visualizer: /trajectory — CLI trajectory viewer
- ADR: ADR-163
- Agent: trajectory-dashboard
- Skill: agentic-trajectory-dashboard
- Data: DATABASE-SCHEMA.md