Safe Handling of Hermes Local State (state.db)

    by Drizzt Studio

    1

    Read a live Hermes state database without breaking the gateway’s write path.

    Free

    Security scanned

    Works with the AI Agents you already use

    Safe Handling of Hermes Local State (state.db)

    Example session with this skill installed

    I need to know how many times the vision_analyze tool was used in the last 7 days and which model was actually used for each call. Verify the DB safety first.

    • Read your context and instructions
    • Compiled the safe handling
    • Generated the document

    Demo result (illustrative example; values are not from a real profile):
    Command: python3 scripts/audit_tool_usage.py vision_analyze --days 7 --dump-args --profile "<your Hermes profile dir>"
    Snapshot first: a mode=ro connection plus SQLite's Connection.backup() to a temp file; the temp copy is removed when the query finishes.
    Output format (labels printed by the script are Chinese):
    工具:vision_analyze|範圍:最近 7 天|總計:1 次(1 個 session)
    2026-09-22:1 次 11:30
    逐筆參數:
    09-22 11:30 diagram.png
    Q: describe this schematic
    The script reports no success/failure status; only the recorded tool call and its arguments.
    Database integrity: not checked by the script. The snapshot is consistent (online backup) but no PRAGMA integrity_check is run; run it manually if you need that evidence.
    Step 2, model identification (not covered by the script): the per-call model and provider come from auxiliary.vision in config.yaml and from the model=<m> provider=<p> lines that agent.log prints on every turn. No model or provider column is produced by the audit script.
    Next steps

    1. Check auxiliary.vision in config.yaml and grep "Fallback activated" in logs/agent.log to confirm which model served the call.
    2. Nothing to clean up: the temp snapshot is deleted automatically after the query (only --keep-copy leaves it, and even then an incomplete snapshot is never kept).

    diagram.png

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    How to inspect Hermes Agent’s local state.db / WAL / config without triggering WAL recovery that can permanently disable writes. Covers snapshot-then-open or mode=ro only, three-layer liveness checks, and auditing which tool actually ran. The bundled script uses a read-only connection and SQLite’s backup API, then deletes its temp snapshot.

    Requires local file system access. Cannot repair already corrupted profiles. Snapshots can be large. Only supports SQLite-based Hermes state files. Model and provider per call are not part of the script output; get them from auxiliary.vision in config.yaml and the model=/provider= lines in logs/agent.log.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 16 days ago

    • Free with an Agensi account

    Software
    Python 3.8+ (standard library only)Local Hermes profile directory (state.db)
    Optional
    sqlite3 CLI (manual read-only queries)hermes CLI (config set)

    Free read-only helper. One script snapshots state.db via SQLite's backup API (mode=ro), counts assistant-side tool calls, then deletes the temp copy. Also covers three-layer liveness checks and safe config.yaml edits via the Hermes CLI. Counts and arguments only; model/provider come from agent.log.

    Permissions

    Terminal / Shell
    Environment Variables
    Read Files
    Write Files
    Listed16 days ago

    What's inside

    Frequently Asked Questions

    It documents the failure mode (a plain writable connection triggers WAL recovery and the gateway can then refuse all writes) and enforces the safe path instead: mode=ro for reads, SQLite's online backup or VACUUM INTO for a consistent snapshot, and never deleting state.db-wal/-shm. The three-layer liveness section explains how to tell a dead process from a process that connects but fails every turn.

    Any local Hermes install whose state is SQLite-based (state.db + WAL), on Windows, macOS or Linux. The file-location and junction notes are Windows-specific; the read-only and snapshot rules apply everywhere.

    A short SKILL.md covering the read-only/snapshot rules, three-layer liveness checks and config.yaml edit discipline, plus one Python script (audit_tool_usage.py) that produces a consistent snapshot with SQLite's backup API and prints tool-call counts and arguments.

    No, this skill strictly enforces a read-only snapshot workflow to ensure the live database remains untouched; direct modification of a running state.db is not supported due to corruption risks.

    The script counts invocations of any tool over a given window, groups them by day, and with --dump-args lists the file and question for each call. Fallback detection is a separate manual step: grep "Fallback activated" in logs/agent.log.

    New in DevOps & Cloud

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Free