Back to Commands
Memory & Sessionshermes sessions

hermes sessions Command — Complete Reference & Examples

Complete reference for hermes sessions: browse, export, prune, rename, and delete chat sessions to keep your workspace organized.

July 27, 2026

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

  • export defaults to jsonl; use md for human-readable archives and trace for Claude Code trace viewer.
  • prune without filters deletes sessions older than 90 days by default; use --dry-run to preview.
  • archive hides sessions but does not free as much space as delete or prune.
  • repair and recover both make backups by default; use --no-backup only when you accept the risk.
  • retitle-skills is useful when many sessions were auto-titled from the body of a /skill rather than the user’s actual request.

Explore All Commands

Browse the full command reference with search and category filters.

Back to Commands