openclaw sessions
List stored conversation sessions. The command reads the per-agent sessions.json store file
and (when session metadata includes a transcript path) may read transcript content. With a database
session backend (session.storage.backend: "sqlite" | "postgres"), transcript content is served from
the configured database; with backend: "fs-jsonl", transcripts are read from local JSONL files.
See Session Management / External session storage.
- default: configured default agent store
--agent <id>: one configured agent store--all-agents: aggregate all configured agent stores--store <path>: explicit store path (cannot be combined with--agentor--all-agents)
openclaw sessions --all-agents --json:
Cleanup maintenance
Run maintenance now (instead of waiting for the next write cycle):openclaw sessions cleanup uses session.maintenance settings from config:
-
Scope note:
openclaw sessions cleanupmaintains session stores/transcripts only. It does not prune cron run logs (cron/runs/<jobId>.jsonl), which are managed bycron.runLog.maxBytesandcron.runLog.keepLinesin Cron configuration and explained in Cron maintenance. -
--dry-run: preview how many entries would be pruned/capped without writing.- In text mode, dry-run prints a per-session action table (
Action,Key,Age,Model,Flags) so you can see what would be kept vs removed.
- In text mode, dry-run prints a per-session action table (
-
--enforce: apply maintenance even whensession.maintenance.modeiswarn. -
--active-key <key>: protect a specific active key from disk-budget eviction. -
--agent <id>: run cleanup for one configured agent store. -
--all-agents: run cleanup for all configured agent stores. -
--store <path>: run against a specificsessions.jsonfile. -
--json: print a JSON summary. With--all-agents, output includes one summary per store.
openclaw sessions cleanup --all-agents --dry-run --json:
Claims status
View session consumer claim ledger status — what work is owed, stalled, or dead-lettered:sessions.claims.status. Text output shows:
- Consumers table: consumer ID, lane, effect kind, enabled flag, and counts
by status (
pending,claimed,processing,dlq,processed). - Stalled leases table: expired claims still in
claimed/processingstate. - Last sweep timestamp (when the reconciler last ran).
- Recent events table: last diagnostic events from the in-memory ring buffer (event type, consumer ID, reason, count, timestamp).
--json outputs the raw RPC response:
- Operator guide: Session Consumer Claims
- Session config: Configuration reference