--- # claudbg-pfa5 title: JSON output is array-of-arrays instead of array-of-objects status: completed type: bug priority: normal created_at: 2026-03-30T04:37:05Z updated_at: 2026-03-30T05:05:12Z parent: claudbg-tci9 --- ## Problem `sessions list --output json` and `sessions dump --output json` serialize rows as `Vec>`, producing an array of arrays with no field names: ```json [["21fae0a8", "2024-01-01", "/path", "claude-3", "42"], ...] ``` ## Expected behavior Output should be an array of objects with named keys: ```json [{"id": "21fae0a8", "date": "2024-01-01", "project": "/path", "model": "claude-3", "messages": 42, "subagents": 0}, ...] ``` ## Affected commands - `sessions list --output json`: keys should be `id`, `date`, `project`, `model`, `messages`, `subagents` - `sessions dump --output json`: keys should be `seq`, `timestamp`, `type`, `role`, `content` ## Root cause `src/commands/sessions.rs` passes `&rows: &Vec>` directly to `render_json`. The fix is to build a typed struct or `serde_json::Value` map per row before serializing. ## Relevant files - `src/commands/sessions.rs` — `list()` and `dump()` JSON output branches - `src/output/json.rs` — generic `render_json` ## Summary of Changes Fixed JSON output in both sessions.rs and agents.rs to produce array-of-objects instead of array-of-arrays. Each row is now mapped to a serde_json object with named keys before serializing. Keys: sessions list (id, date, project, model, messages, subagents), sessions dump (seq, timestamp, type, role, content), agents list (id, type, file, modified), agents dump (seq, timestamp, type, role, content).