How to delete Hermes session history, and what you lose
every turn, tool call and compacted archive lives in state.db
Hermes keeps its conversation history in SQLite rather than one file per chat. Even turns that were compacted or rewound during a long run stay in the database as inactive rows (active = 0) unless the session itself is removed.
Where the sessions are
${HERMES_HOME:-~/.hermes}/state.db
${HERMES_HOME:-~/.hermes}/profiles/<profile>/state.db
Since Hermes 0.17, the default store sits at ~/.hermes/state.db (or under $HERMES_HOME when set). Named profiles and older releases keep one state.db per profile under ~/.hermes/profiles/<profile>/state.db, and a machine upgraded from an older build can hold both. Inside each file, the sessions table records the session id, cwd, git_repo_root and title, and the messages table holds every prompt, assistant reply, terminal command, file patch and compaction summary grouped by session_id.
If your config.yaml sets sessiondb.provider: postgresql, Hermes writes the same messages columns to Postgres instead of state.db; the steps below cover the default SQLite stores.
How to delete one session
Use Hermes's own CLI to list and delete a session by ID:
hermes sessions list hermes sessions delete <session-id>
When the session belongs to a named profile, pass -p <profile> so Hermes targets that profile's state.db:
hermes -p <profile> sessions list hermes -p <profile> sessions delete <session-id>
Deleting rows in SQLite frees their pages inside state.db for future sessions without shrinking the file on disk. To reclaim the disk space immediately, close Hermes and run VACUUM:
sqlite3 "${HERMES_HOME:-$HOME/.hermes}/state.db" "VACUUM;"
How to delete all of it
With Hermes closed, removing state.db (and any -wal or -shm files beside it) clears every session in the default store:
cd "${HERMES_HOME:-$HOME/.hermes}"
rm -f state.db state.db-wal state.db-shm
To clear every named profile's history as well:
rm -f "${HERMES_HOME:-$HOME/.hermes}"/profiles/*/state.db*
Removing state.db does not touch config.yaml, your installed plugins under ~/.hermes/plugins/, or the curated notes in MEMORY.md. deja delete refuses Hermes sessions rather than editing state.db; use hermes sessions delete for the source store and deja forget <id> to drop a session from deja's index.
What you lose
The conversation turns, the terminal commands and their exit codes, the patch and write_file diffs, and the pre-compaction turns archived in messages. Once deleted, hermes --resume <id> can no longer reopen the session, and Hermes's own in-agent session search will no longer find it.
Keeping it searchable instead
deja reads state.db across your default home and every profile — along with the other forty-two agents' histories on the machine — into one local index:
curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh deja "hermes session about the migration"
Indexing and search stay local, credentials are stripped as the index is built, and deja forget removes a session from the index for good. A session you removed in Hermes stays readable with deja show and under the Deleted tab of bare deja; deja resume refuses a deleted session with a pointer to deja show rather than handing back a hermes --resume command that Hermes will reject, and deja never writes rows back into state.db. DEJA_HERMES_HOME, DEJA_HERMES_PROFILES_ROOT, DEJA_HERMES_DB and DEJA_HERMES_PG_DSN let you point deja at a backup database or a Postgres store without moving Hermes.
Where every agent keeps its history · Memory for Hermes · The Hermes format
Found this useful? Star deja-vu on GitHub.