#how to delete subagent and hook chat history
1 messages · Page 1 of 1 (latest)
They’re under the OpenClaw state dir — default:
~/.openclaw
# or whatever OPENCLAW_STATE_DIR points to
Main places:
~/.openclaw/agents/<agentId>/sessions/sessions.json # session metadata
~/.openclaw/agents/<agentId>/sessions/*.jsonl # chat transcripts
~/.openclaw/tasks/runs.sqlite # subagent/ACP/cron task ledger
Subagents are normal session entries too — look for session keys like:
agent:<agentId>:subagent:<uuid>
Hook-triggered chats don’t usually have a separate “hook history”; they land in whatever agent/session the hook used. Exceptions:
session-memoryhook writes summaries to<workspace>/memory/*.mdcommand-loggerwrites to~/.openclaw/logs/commands.log
To discover actual paths safely:
openclaw sessions --all-agents --json
find "${OPENCLAW_STATE_DIR:-$HOME/.openclaw}/agents" -path '*/sessions/sessions.json' -print
If you edit/delete directly: stop the gateway first, back up the sessions dir, then remove both the matching sessions.json entry and its matching .jsonl transcript. If you only delete one side, the dashboard/doctor may show orphaned or missing history.