Skip to main content

Observability Commands

Genie provides seven command groups for observability: events for the audit log, sessions for Claude Code session history, metrics for machine state, schedule for cron triggers, qa for self-testing, log for a unified real-time feed, and brief for session startup context.

Events

The genie events command group queries the PostgreSQL audit event log. Events are structured as OTel-compatible records covering API costs, tool usage, task transitions, and errors. Thirteen subcommands group into three layers: reading (list, errors, costs, tools, timeline, timeline-v2, summary, scan), streaming (stream, stream-follow, subscribe), and operations (migrate, admin). Reading commands hit the table directly; streaming commands tail events in real time (with stream-follow and subscribe targeting the v2 enriched surface); operations commands are one-shot migrations and sentinel-audited incident response.

genie events list

List recent audit events. Pass --v2 to switch to the enriched genie_runtime_events surface with TraceId/SpanId/Severity/Duration columns.
genie events list defaults to the last hour. Widen with --since 1d or narrow with --since 5m when chasing a specific incident.
For a walkthrough of rot.* and detector.* events and triage, see Detectors.

genie events stream

Stream audit + runtime events in real-time (tail -f style). Reach for this when you want a live firehose across both the legacy audit_events and the enriched genie_runtime_events surfaces — for example, while watching a wish execute or debugging a noisy agent.

genie events stream-follow

Follow-stream enriched genie_runtime_events via PostgreSQL LISTEN/NOTIFY with an id-cursor for resumable consumption (v2). Unlike stream, this command is built for long-running sidecars that need to survive reconnects — pass --consumer-id and it picks up where it left off. The --kind flag accepts * globs for subject-tree subscriptions. For example, --kind 'detector.*' follows every event emitted by the detector subsystem. See Detectors for the catalog of kinds (sibling PR — page lands alongside this one).

genie events subscribe

Mint a signed subscription token for genie events stream --follow. Tokens carry an RBAC role and optional restrictions on event types, LISTEN channels, TTL, and tenant — letting subscriber agents connect without sharing long-lived credentials.
subscribe requires a running scheduler/issuer with HMAC keys configured. The --types and --channels flags narrow (never widen) the role’s default permissions.

genie events errors

Show aggregated error patterns.
Treat genie events errors as an incident-response tool. A sudden spike in an error pattern usually means a provider outage, a credential rotation, or a broken agent — investigate before spawning more work on top.

genie events costs

Cost breakdown from OTel API request events.
Every genie events subcommand supports --json. Pipe into jq for ad-hoc analysis — e.g., genie events costs --since 7d --by-model --json | jq '.[] | select(.usd > 1)' surfaces only models that cost more than $1 in the last week.

genie events tools

Tool usage analytics from OTel tool events.

genie events timeline

Full event timeline for a task, agent, wish, or trace ID. Shows all events associated with a specific entity in chronological order.

genie events timeline-v2

Render a causal tree for a trace_id from the enriched genie_runtime_events surface. Unlike timeline, which walks any entity type, timeline-v2 expects a trace id and reconstructs spans with OTel-style parent/child relationships — use it when chasing causality across agent/tool boundaries.

genie events summary

High-level stats: agents spawned, tasks moved, costs, errors.

genie events scan

Full server cost scan via ccusage. Scans all Claude Code sessions on the machine, not just genie-spawned ones.

genie events migrate

Backfill legacy audit_events rows into genie_runtime_events as a one-shot migration. Useful when adopting the v2 enriched surface on an existing installation or recovering from a gap in the ingestion pipeline.
Run with --dry-run first to inspect row deltas; re-run without --dry-run to commit.

genie events admin

Incident-response admin commands (sentinel H6 audited). Every subcommand emits its own audit event so operator actions remain traceable in the chain.
Run genie events admin <subcommand> --help for per-subcommand flags.

Enriched (v2) surface

“Enriched” refers to the genie_runtime_events table — a v2 superset of the legacy audit_events stream that adds OTel-style columns (trace_id, span_id, severity, duration_ms) plus a hierarchical kind taxonomy. It has no dedicated subcommand; instead, the enriched surface is reached via: Use the v2 surface whenever you need trace/span correlation or subject-tree subscriptions; fall back to the legacy commands for simple audit queries.

Log

The genie log command provides a unified observability feed that aggregates transcripts, DMs, team chat, tool calls, and system events into a single stream.

genie log

Unified observability feed for an agent or team.

Brief

genie brief shows an aggregated startup brief with context since the last session — useful for agents resuming work or operators reviewing what happened overnight.

genie brief


Sessions

The genie sessions command group provides history and search across Claude Code sessions. Session metadata and content are stored in PostgreSQL.

genie sessions list

List Claude Code sessions.

genie sessions replay

Replay a session — interleaves content and events in chronological order.
Full-text search across session content.

genie sessions sync

Sync session data from JSONL files into PostgreSQL.

Metrics

The genie metrics command group provides machine-level state snapshots and agent heartbeat data.

genie metrics now

Current machine state — CPU, memory, active agents, teams.

genie metrics history

Machine snapshot history over time.
Default time window is 1h. Supports durations like 6h, 1d.

genie metrics agents

Per-agent heartbeat summary — shows each agent’s last heartbeat, state, and uptime.

Schedule

The genie schedule command group manages cron-based scheduled triggers.

genie schedule create

Create a new schedule.

genie schedule list

List schedules with next due trigger.

genie schedule cancel

Cancel a schedule and skip pending triggers.

genie schedule retry

Reset a failed trigger to pending.

genie schedule history

Show past executions for a schedule.

QA

The genie qa command group runs self-testing specs against the Genie CLI itself.

genie qa run

Run QA specs — all, a domain, or a single spec.

genie qa status

Show QA dashboard with last results per spec.

genie qa history

Show recent QA runs.

genie qa check

Evaluate a QA spec against current team logs and publish a qa-report.

genie qa-report

Publish a QA result to the PostgreSQL event log. Called internally by the QA team-lead.

See also

Spawn & Lifecycle

Spawn the agents whose events land in the audit log.

Messaging

Send instructions to agents instead of scraping terminal output.

Scheduling

Configure cron triggers whose runs surface through schedule history.

Database

Inspect the PostgreSQL store that backs every event, session, and metric.