hermes-session-maintenance

Inspect, back up, prune, and diagnose Hermes Agent session history stored in SQLite.

115|9|Updated Aug 5, 2026
One-click install
npx skills add https://github.com/AtlasOmnia/donna-starter --skill hermes-session-maintenance-atlasomnia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hermes-session-maintenance
Source: https://github.com/AtlasOmnia/donna-starter/tree/main/skills/autonomous-ai-agents/hermes-session-maintenance
Command: npx skills add https://github.com/AtlasOmnia/donna-starter --skill hermes-session-maintenance-atlasomnia

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Hermes Agent session history grows unbounded in the local SQLite database, consuming gigabytes of disk space, and users lack a safe, verified procedure for pruning old sessions, configuring retention, or diagnosing sessions that burned excessive tokens. ## Core Features & Use Cases - Session Pruning & Retention: Inspect database size with hermes sessions stats, export JSONL backups, and configure sessions.auto_prune with a chosen retention_days window. - Source-Specific Cleanup: Prune CLI and Telegram sessions on different schedules using a cron-driven script, or perform a one-time destructive CLI-only clear directly against state.db. - Session Forensics: Diagnose suspected loops and token burn by querying the sessions and messages tables and correlating with gateway.log delivery patterns. - Use Case: Your Hermes session database has grown to 6.7 GB across 35,000 sessions. Use this Skill to export a backup, enable 30-day auto-prune, run a manual prune, and verify the reclaimed space. ## Quick Start Ask the assistant to check my Hermes session database size and recommend a safe retention and pruning plan.

Frequently Asked Questions about hermes-session-maintenance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prune old Hermes Agent sessions?

Run `hermes sessions stats` to check volume, export a backup with `hermes sessions export`, then run `hermes sessions prune --older-than 30`. Add `--source cli` to prune only one channel and `--yes` to skip confirmation.

How do I enable automatic session retention in Hermes?

Set `hermes config set sessions.auto_prune true` and `hermes config set sessions.retention_days 30`. Note that setting retention_days alone does nothing; auto_prune must be true for automatic deletion to occur.

Can I keep Telegram sessions longer than CLI sessions?

Global auto_prune supports only one retention window, so disable it and schedule a cron script that runs `hermes sessions prune --older-than 15 --source cli` and `--older-than 45 --source telegram` separately with no_agent=true.

Why does hermes sessions prune not delete all CLI sessions?

The pruner only removes ended sessions; CLI sessions with `ended_at IS NULL` are treated as active and skipped. A one-time full clear requires deleting rows directly in `~/.hermes/state.db` while preserving the newest session, then running VACUUM.

Why did my Hermes session burn so many tokens?

Query the sessions and messages tables in state.db for token totals and per-message payload sizes, then check gateway.log for duplicate-send suppression. High input tokens with one inbound message usually indicate an internal tool-call cascade, not a delivery loop.

Does pruning sessions delete my memory, skills, or cron jobs?

No. Session pruning only removes session transcripts and state from the database. Memory, skills, cron jobs, notes, and project files are stored separately and remain unaffected.