#how to delete subagent and hook chat history

1 messages · Page 1 of 1 (latest)

marsh jewel
#

Deleting via the dashboard is too slow; I want to know where they are stored so I can delete them directly from the server.

short epochBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

crystal streamBOT
#

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-memory hook writes summaries to <workspace>/memory/*.md
  • command-logger writes 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.