agentleFS
iapiap/hermes-guide/skills/diagnosing-storage/SKILL.md

diagnosing-storage

Skill6 starsChanged 8 days agoMITView on GitHub

Diagnose Hermes storage issues — state.db size, disk pressure, session database bloat, and cleanup opportunities.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After applying the fix:

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Diagnosing Storage

Goal: reduce any storage problem to one concrete fix — a database optimization, a cleanup command, or a disk pressure resolution.

1. How to inspect

  • hermes guide — runs check_storage (state.db size audit)
  • hermes sessions optimize-storage — reclaim space from session database
  • ``cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; du -sh "$home/"— total Hermes disk usage (resolve home viahermes config path, never assume ~/.hermes`)
  • cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; du -sh "$home/state.db" — session database size

2. Common failures

state.db too large

Symptom: hermes guide storage check warns; hermes sessions optimize-storage is slow.

Cause: Accumulated session history without cleanup; large context resends stored in DB.

Fix:

hermes sessions optimize-storage   # reclaim space (stop gateway first)
# Or prune old sessions:
hermes sessions list --limit 50
hermes sessions delete <session_id>

Disk pressure (host full)

Symptom: Hermes commands fail with "No space left on device"; sessions can't be saved.

Cause: Host disk full; Hermes state.db + logs + caches consume space.

Fix:

df -h /                          # check disk usage
cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; du -sh "$home"/*  # Hermes breakdown (custom $HERMES_HOME safe)
# Clean caches:
cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; find "$home/cache/scratch" -maxdepth 1 -type f -delete  # scratch files (24h TTL anyway)
# Prune old sessions:
hermes sessions optimize-storage
# See hermes-disk-housekeeping skill for full cleanup

state.db missing

Symptom: hermes guide storage check reports "no state.db yet".

Cause: Hermes hasn't run yet, or $HERMES_HOME points to wrong directory.

Fix:

hermes config path               # verify $HERMES_HOME
ls -la $(hermes config path | xargs dirname)/state.db
# If genuinely missing, run Hermes once to create it:
hermes --version

state.db unreadable

Symptom: hermes guide storage check reports STORAGE_UNREADABLE.

Cause: Permission error, corrupted file, or dangling symlink.

Fix:

cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; ls -la "$home/state.db"
cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; file "$home/state.db"
# Fix permissions:
cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; chmod 600 "$home/state.db"
# If corrupted, back up and let Hermes recreate:
cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; mv "$home/state.db" "$home/state.db.bak"
hermes --version

3. Verification

hermes guide               # storage check healthy
cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; du -sh "$home/state.db"  # size reasonable
hermes sessions optimize-storage  # completes without error

Pass: storage check shows healthy; state.db size is reasonable.

Fail: storage check shows warning — re-check disk usage and state.db.

Verification

After applying the fix:

hermes guide               # storage check healthy
cfg=$(hermes config path) && [ -n "$cfg" ] && home=$(dirname "$cfg") || { echo 'hermes config path failed'; exit 1; }; du -sh "$home/state.db"  # size reasonable
hermes sessions optimize-storage  # completes without error (stop gateway first)

Pass: storage check shows healthy; state.db size is reasonable.

Fail: storage check shows warning — re-check disk usage and state.db.

4. Related

  • hermes-disk-housekeeping — full disk cleanup procedures
  • diagnosing-host-pressure — OOM and host load issues
  • diagnosing-sessions — session health issues

Facts re-verified 2026-10-31 against upstream source at commit cedf4a3d78675283fa93e4e6ea2d6212bf414667: hermes_cli/checks.py (check_storage), hermes_constants.py (get_hermes_home). Re-verify before reuse.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.