Overview
hermes sessions views and manages the SQLite session store. You can list, browse, export, delete, prune, archive, repair, and optimize the conversations that Hermes keeps.
hermes sessions <list|browse|export|delete|prune|archive|optimize|clean-markers|optimize-storage|repair|recover|stats|rename|retitle-skills>
Subcommands
list — List recent sessions
hermes sessions list
hermes sessions list --limit 20
hermes sessions list --source telegram
hermes sessions list --workspace /path/to/project
browse — Interactive session picker
hermes sessions browse
hermes sessions browse --limit 100
export — Export sessions to file
hermes sessions export --format md ./exports
hermes sessions export --session-id abc123 --format jsonl -
hermes sessions export --older-than 30d --format md --yes
Formats: jsonl, md, qmd, html, trace. Many filters are available (title, source, model, cost, tokens, tool calls, etc.).
delete — Delete a specific session
hermes sessions delete abc123
hermes sessions delete abc123 --yes
prune — Delete old sessions by filters
hermes sessions prune
hermes sessions prune --older-than 90d
hermes sessions prune --source cli --keep 50 --dry-run
Default age threshold is 90 days if no filters are given.
archive — Soft-hide sessions without deleting them
hermes sessions archive --older-than 30d --dry-run
hermes sessions archive --title "legacy" --yes
optimize — Reclaim disk space (no data change)
hermes sessions optimize
Merges FTS5 segments and VACUUMs the database. No conversation data is changed.
clean-markers — Fix stale tool-call markers
hermes sessions clean-markers --dry-run
hermes sessions clean-markers --yes
optimize-storage — Rebuild the search index to the compact v23 layout
hermes sessions optimize-storage --yes
hermes sessions optimize-storage --no-vacuum
repair — Repair a malformed state.db schema
hermes sessions repair --check-only
hermes sessions repair --no-backup
recover — Offline recovery for a damaged database
hermes sessions recover --source state.db --output recovered.db
hermes sessions recover --source state.db --inspect-only
Flags: --source, --output, --inspect-only, --work-dir, --chunk-size, --allow-partial, --report.
stats — Show session store statistics
hermes sessions stats
rename — Set or change a session title
hermes sessions rename abc123 "API Design Session"
retitle-skills — Regenerate titles for /skill sessions
hermes sessions retitle-skills --dry-run
hermes sessions retitle-skills --apply --limit 200
Common Scenarios
Find and export a session
hermes sessions list --limit 50
hermes sessions export --session-id abc123 --format md ./exports
Regular cleanup
hermes sessions prune --older-than 90d --yes
hermes sessions optimize
Repair a database that shows no sessions
hermes sessions repair --check-only
hermes sessions repair
Recover from a damaged backup
hermes sessions recover --source ~/.hermes/backups/state.db --output ~/.hermes/recovered.db --allow-partial
Tips
exportdefaults tojsonl; usemdfor human-readable archives andtracefor Claude Code trace viewer.prunewithout filters deletes sessions older than 90 days by default; use--dry-runto preview.archivehides sessions but does not free as much space asdeleteorprune.repairandrecoverboth make backups by default; use--no-backuponly when you accept the risk.retitle-skillsis useful when many sessions were auto-titled from the body of a/skillrather than the user’s actual request.