Problem
The status command only shows "active sessions" (events in the last 5 minutes). Once a session ends, there is no CLI command to see it or its stats. Users cannot review what happened in yesterday's sessions — the data is in the database but only accessible via SQLite directly.
What to do
- Add an API endpoint
/api/sessions in routes.py:
SELECT DISTINCT session_id, MIN(timestamp_ms) as started,
MAX(timestamp_ms) as ended, COUNT(*) as event_count
FROM events GROUP BY session_id ORDER BY ended DESC LIMIT ?
- Add a
sessions CLI command with optional --days N filter
- Render a Rich table with: Session ID (truncated), Start Time, End Time, Duration, Event Count, Status (active/ended)
Files to look at
src/context_analyzer_tool/collector/routes.py — follow pattern of /api/status
src/context_analyzer_tool/cli.py — follow pattern of anomalies command
Problem
The
statuscommand only shows "active sessions" (events in the last 5 minutes). Once a session ends, there is no CLI command to see it or its stats. Users cannot review what happened in yesterday's sessions — the data is in the database but only accessible via SQLite directly.What to do
/api/sessionsinroutes.py:sessionsCLI command with optional--days NfilterFiles to look at
src/context_analyzer_tool/collector/routes.py— follow pattern of/api/statussrc/context_analyzer_tool/cli.py— follow pattern ofanomaliescommand