Summary
Two related memory inefficiencies observed in a stable Hermes 0.10.0 (2026.4.16) WSL2 deployment where Hermes and OpenClaw are configured to mutually expose each other as tools:
- Full OpenClaw MCP child fleet (
openclaw + openclaw-mcp) is respawned per OpenClaw-as-tool invocation, even when an OpenClaw gateway daemon is already running locally on its known port.
- Orphan
claude mcp serve processes (spawned via /root/.hermes/node/bin/claude mcp serve) can survive session/turn end and get reparented to systemd --user, never reaped.
Environment
- Hermes 0.10.0 (2026.4.16)
- Ubuntu 24.04 inside WSL2 on Windows
- OpenClaw 2026.5.7 also running locally; both wired to expose each other as MCP tools
- claude-cli shim backend at
/root/.hermes/node/bin/claude
Observation 1 — fleet respawn per invocation
Hermes gateway (~255 MB persistent)
├── claude mcp serve (~193 MB)
└── openclaw → openclaw-mcp (~270 MB) ← spawned per OpenClaw-as-tool invocation
Hermes claude-shim
└── claude (session)
└── [via OpenClaw tool] openclaw → openclaw-mcp (another ~270 MB)
Each scope where Hermes calls OpenClaw-as-tool spawns a fresh openclaw + openclaw-mcp pair, despite a long-running OpenClaw gateway daemon already being available locally on port 18789. The OpenClaw gateway exposes its MCP surface over that port; Hermes could attach to it rather than respawning the binary.
Cost: ~270 MB per invocation level. With nested cross-agent calls, this compounds.
Observation 2 — orphan claude mcp serve
Process tree fragment after an OpenClaw session ends:
init(1) ─── systemd --user (329)
├── claude mcp serve (PID A) ← ~192 MB RSS
└── claude mcp serve (PID B) ← ~192 MB RSS
Originally spawned via the Hermes-bundled claude binary path (/root/.hermes/node/bin/claude mcp serve). Original parent exited; children reparented to systemd --user and are not reaped.
Both processes started within 3 s of each other, runtime 16+ min at observation time, and are not attached to any current session.
Suggested fixes
- Detect and reuse a running OpenClaw gateway. When Hermes invokes OpenClaw-as-tool, probe for an existing gateway on its known port before spawning a fresh
openclaw instance. Fall back to spawn only if none is running.
- Reap children of
claude mcp serve invocations on session end. Track PIDs of spawned MCP serve workers and SIGTERM them when the originating Hermes session exits. Add a startup sweep that detects orphans (parent = systemd --user, command matches <hermes_install>/node/bin/claude mcp serve) and reaps them.
Impact
Per active session that crosses agent boundaries: ~270 MB unnecessary OpenClaw-child overhead. Multiplied by orphan misses, observed steady-state impact was ~1 GB on this side of the bridge.
Cross-reference
Mirror issue filed against openclaw/openclaw covering the symmetric case (OpenClaw invoking Hermes-as-tool): will link once filed.
Summary
Two related memory inefficiencies observed in a stable Hermes 0.10.0 (2026.4.16) WSL2 deployment where Hermes and OpenClaw are configured to mutually expose each other as tools:
openclaw+openclaw-mcp) is respawned per OpenClaw-as-tool invocation, even when an OpenClaw gateway daemon is already running locally on its known port.claude mcp serveprocesses (spawned via/root/.hermes/node/bin/claude mcp serve) can survive session/turn end and get reparented tosystemd --user, never reaped.Environment
/root/.hermes/node/bin/claudeObservation 1 — fleet respawn per invocation
Each scope where Hermes calls OpenClaw-as-tool spawns a fresh
openclaw+openclaw-mcppair, despite a long-running OpenClaw gateway daemon already being available locally on port 18789. The OpenClaw gateway exposes its MCP surface over that port; Hermes could attach to it rather than respawning the binary.Cost: ~270 MB per invocation level. With nested cross-agent calls, this compounds.
Observation 2 — orphan
claude mcp serveProcess tree fragment after an OpenClaw session ends:
Originally spawned via the Hermes-bundled claude binary path (
/root/.hermes/node/bin/claude mcp serve). Original parent exited; children reparented tosystemd --userand are not reaped.Both processes started within 3 s of each other, runtime 16+ min at observation time, and are not attached to any current session.
Suggested fixes
openclawinstance. Fall back to spawn only if none is running.claude mcp serveinvocations on session end. Track PIDs of spawned MCP serve workers and SIGTERM them when the originating Hermes session exits. Add a startup sweep that detects orphans (parent = systemd --user, command matches<hermes_install>/node/bin/claude mcp serve) and reaps them.Impact
Per active session that crosses agent boundaries: ~270 MB unnecessary OpenClaw-child overhead. Multiplied by orphan misses, observed steady-state impact was ~1 GB on this side of the bridge.
Cross-reference
Mirror issue filed against
openclaw/openclawcovering the symmetric case (OpenClaw invoking Hermes-as-tool): will link once filed.