Independent OpenClaw plugin/service for capturing every llm_input and llm_output
hook into a local SQLite database and viewing the calls at http://127.0.0.1:8764/.
The package also includes an independent Hermes monitor. It tails Hermes'
native ~/.hermes/llm-audit/llm_calls_*.jsonl files, automatically imports records with a Hermes runtime task_id into a local
SQLite database, and serves a separate viewer at http://127.0.0.1:8765/.
- Node.js
>= 22.12.0(seepackage.json→engines). Hermes and OpenClaw gateways should use a compatible Node major where possible. - npm (for
npm run build,npm install, and the shell helpers). - OpenClaw deploy script path: Python 3 (
python3onPATH) for editing Hermesllm_auditin YAML; rsync; curl (health check afteropenclaw daemon restart).openclawCLI onPATHfor restart (otherwise the script skips restart and prints a manual hint). - Hermes path: Hermes installed and
~/.hermes/config.yamlwritable if you use the Hermes helpers or monitor. - OpenClaw path:
~/.openclaw/openclaw.jsonshould exist after a normal OpenClaw setup; if it is missing, the deploy script logs a warning and skips the JSON patch until you bootstrap OpenClaw once.
| You have | OpenClaw plugin + deploy helpers | Hermes monitor |
|---|---|---|
| Git clone of this repo | Use ./start-openclaw-audit-with-restart.sh and ./start-hermes-openclaw-combo.sh (scripts live in the repo root). |
Use ./start-hermes-monitor.sh or npm run monitor:hermes after npm run build. |
npm install / registry tarball |
The published package only ships dist/, package.json, and README.md (package.json → files). The start-*.sh scripts are not in the tarball. Deploy by copying/syncing the package directory into ~/.openclaw/extensions/agent-openclaw-local-monitor/ yourself, or clone this repo for the scripts. |
After install: npm run build in the package if you build from source, then npx agent-hermes-llm-monitor (see package.json → bin) or node dist/src/hermes.js. |
| Script | What it does |
|---|---|
start-hermes-monitor.sh |
Patches Hermes llm_audit in HERMES_CONFIG (default ~/.hermes/config.yaml), optional build in this repo, then runs the Hermes monitor (HERMES_LLM_AUDIT_MONITOR_PORT, default 8765) in the foreground. Does not touch OpenClaw. |
start-openclaw-audit-with-restart.sh |
Optional build in this repo, rsync into ~/.openclaw/extensions/agent-openclaw-local-monitor/ (excluding node_modules; see below), npm install --omit=dev inside that extension directory (rebuilds native deps such as better-sqlite3 there), patches ~/.openclaw/openclaw.json (allow / entries / installs), runs openclaw daemon restart, waits for http://127.0.0.1:${OPENCLAW_LLM_AUDIT_PORT:-8764}/api/health, then exits. The 8764 viewer runs inside OpenClaw, not as a separate long-lived process started by this script. |
start-hermes-openclaw-combo.sh |
Same Hermes YAML prep as above, then one npm run build in this repo (unless SKIP_BUILD=1), then invokes start-openclaw-audit-with-restart.sh with SKIP_BUILD=1 so the OpenClaw path does not build twice, then exec npm run monitor:hermes. If the OpenClaw step fails, it still starts the Hermes monitor and logs a warning. |
Run from the repo root, e.g. bash start-hermes-monitor.sh or chmod +x start-hermes-monitor.sh && ./start-hermes-monitor.sh.
start-hermes-monitor.sh/start-hermes-openclaw-combo.sh: skipsnpm install(even whennode_modulesis missing) andnpm run buildin the repository. You must already havenode_modulesand a builtdist/ornpm run monitor:hermeswill fail.start-openclaw-audit-with-restart.sh: skips only the repositorynpm install/npm run build. It still runs rsync (unlessSKIP_RSYNC=1) andnpm installinside the extension directory (unlessSKIP_INSTALL_DEPS=1).
SKIP_BUILD=1— Skipnpm install/npm run buildin the repository checkout.SKIP_RSYNC=1— Skip copying the working tree into the extensions directory.SKIP_INSTALL_DEPS=1— Skipnpm install(andbetter-sqlite3rebuild) inside~/.openclaw/extensions/agent-openclaw-local-monitor/.SKIP_OPENCLAW_RESTART=1— Skipopenclaw daemon restartand the health wait (sync / config only); exits after the manual-restart hint.SKIP_CONFIG_PATCH=1— Skip updating~/.openclaw/openclaw.json.OPENCLAW_EXTENSIONS_DIR— Extensions base directory (default~/.openclaw/extensions; plugin dir is$OPENCLAW_EXTENSIONS_DIR/agent-openclaw-local-monitor).OPENCLAW_LLM_AUDIT_PORT— Audit viewer port for the health check URL (default8764; must match the plugin’s bind port / env).OPENCLAW_WAIT_TIMEOUT— Seconds to wait for/api/health(default90).
Why rsync excludes node_modules: the extension directory runs its own npm install so node-gyp artefacts (e.g. under better-sqlite3/build/) record paths on the machine that runs OpenClaw, not your development tree.
Symlink note: OpenClaw’s extension scan uses fs.readdirSync with withFileTypes: true and only treats Dirent.isDirectory() === true as an installable folder. On typical Node/macOS setups, a symlink to a directory reports isSymbolicLink() and not isDirectory(), so the entry is skipped. Use a real directory (this script’s rsync target), not a symlink.
- Plugin id:
agent-openclaw-local-monitor - Viewer:
http://127.0.0.1:8764/(unless overridden by env / plugin config) - Database:
~/.openclaw/llm-audit/audit.db(orOPENCLAW_LLM_AUDIT_HOME; seesrc/paths.ts) - Task ID: OpenClaw
runId(stored astask_idin SQLite). The web UI may show a graysubagentlabel whentask_idorsession_keyindicates a subagent context (:subagent:in the string).
The service starts when OpenClaw loads plugin services. It does not depend on a separate “memory” plugin.
From a clone of this repository:
./start-openclaw-audit-with-restart.shThat runs openclaw daemon restart and waits for /api/health unless you set SKIP_OPENCLAW_RESTART=1 or openclaw is missing from PATH.
openclaw.plugin.jsonin the repo root is the manifest OpenClaw reads from the extension directory.package.json→openclaw.extensionslists./dist/src/index.jsfor tooling that reads npm metadata.
Host compatibility is declared under package.json → openclaw.compat.pluginApi (e.g. >=2026.4.15-beta.1). Use an OpenClaw build that satisfies that range.
Environment variables:
OPENCLAW_LLM_AUDIT=0disables capture and viewer startup.OPENCLAW_LLM_AUDIT_HOSToverrides the bind host.OPENCLAW_LLM_AUDIT_PORToverrides the viewer port.OPENCLAW_LLM_AUDIT_HOMEoverrides the audit home directory (parent ofaudit.db).
Equivalent plugin config keys are enabled, host, port, and auditHome (see openclaw.plugin.json → configSchema).
Hermes capture is separate from the OpenClaw plugin. Enable Hermes’ native audit writer, build this package, then run the Hermes monitor:
npm install
npm run build
npm run monitor:hermesFrom a git clone, you can instead:
./start-hermes-monitor.shSKIP_BUILD=1 ./start-hermes-monitor.sh skips repository npm install / npm run build (see nuance above).
start-hermes-monitor.sh does not restart OpenClaw; use start-openclaw-audit-with-restart.sh or the combo script if you need 8764.
./start-hermes-openclaw-combo.shEnvironment variables for the OpenClaw leg are the same as start-openclaw-audit-with-restart.sh (see script header). SKIP_BUILD=1 on the combo script skips only the initial repository build before delegating; the child script is always invoked with SKIP_BUILD=1 for that second phase.
Combo script does not export SKIP_RSYNC, SKIP_INSTALL_DEPS, etc. to the child; set them in the same shell before running the combo if you need them for the OpenClaw step, e.g. SKIP_RSYNC=1 ./start-hermes-openclaw-combo.sh (same process environment).
- Source JSONL directory:
~/.hermes/llm-audit(HERMES_LLM_AUDIT_SOURCE_DIR) - Viewer:
http://127.0.0.1:8765/(HERMES_LLM_AUDIT_MONITOR_HOST/HERMES_LLM_AUDIT_MONITOR_PORT) - SQLite database:
~/.hermes/llm-audit-monitor/audit.db(HERMES_LLM_AUDIT_MONITOR_HOME) - Task ID: Hermes runtime
task_id
HERMES_LLM_AUDIT_SOURCE_DIR— JSONL source directory.HERMES_LLM_AUDIT_MONITOR_HOME— Monitor DB directory (SQLite file lives here).HERMES_LLM_AUDIT_MONITOR_HOST— Bind host for the monitor HTTP server.HERMES_LLM_AUDIT_MONITOR_PORT— Viewer port (the shell helpers also acceptHERMES_MONITOR_PORTas a fallback and export the canonical name for Node).HERMES_LLM_AUDIT_MONITOR_POLL_MS— Poll interval when watching the source dir.HERMES_CONFIG— Path to Hermesconfig.yamlfor the shell helpers only (default~/.hermes/config.yaml).