gage query

The gage query command queries sessions with SQL. Without --command, it starts an interactive SQL prompt. With --command, it executes the given SQL and exits.

gage query [OPTIONS]
OptionDescription
-A, --agentOperate on agent sessions instead of Claude Code sessions
-c, --command <COMMAND>Execute SQL and exit
-f, --format <FORMAT>Output format: table (default), csv, json, ndjson, or yaml
-q, --quietSuppress non-result output
--timingEnable query timings
--statsEnable query stats