OpenClaw operations guide
OpenClaw session storage growing? Preview cleanup
OpenClaw keeps session transcripts and archives for each agent, so even a few sessions can occupy substantial disk space. Verify a backup of the affected store. To preview cleanup, run openclaw sessions cleanup --agent AGENT_ID --dry-run with that agent’s ID. Check which conversations the plan keeps before applying it.
Last updated · Published
By CWYN · Nov 27, 2026 · Checked against docs, not run · OpenClaw session cleanup
Use this when OpenClaw state grows between runs or a full volume starts interrupting writes. Start on the machine that owns the state. If the volume is already full, make room through your host’s storage procedure or expand the volume before asking OpenClaw to write an archive or run maintenance.
1. Find the volume and the largest storage owner
Record the effective state directory, affected agent, and free space on the backing volume. In Docker, check the persistent mount and its host volume too. Measure agent databases, transcript artifacts, workspaces, logs, and backups separately. On Unix-like hosts, df -h on the state path shows the backing filesystem. Comparing the same directory sizes at two times shows which owner is growing.
2. Preview the affected agent’s maintenance
Check the installed Sessions CLI help. Run openclaw sessions cleanup --agent AGENT_ID --dry-run, replacing AGENT_ID with the affected agent. Keep the plan private because session keys can identify conversations. Record which entries would be kept, archived, or removed. Use the same agent and settings in any repeat comparison.
3. Explain a large store with few cleanup candidates
A long transcript can take up space under a single session entry. OpenClaw also keeps archived transcripts on disk. See where OpenClaw stores session history. If backups, media, workspace files, or scheduler run-history records account for the growth, use that owner’s retention procedure. A preview with zero candidates is a reason to recheck attribution before lowering retention.
4. Rehearse the retention change on a copy
Choose which history must be kept and verify a backup stored on a volume with headroom. Use the documented copy-based procedure for your release to preview one policy change against staging. Check the proposed removals against required history. Keep live maintenance pending if the plan includes protected history or the estimated change fails to address the measured storage owner.
5. Confirm storage recovery and retained history
After an approved maintenance run, remeasure free space and usage for the same agent. A smaller row count alone gives no measurement of space returned to the filesystem. Reopen a retained conversation and, once there is space for writes, verify that a disposable session can persist a new turn. Record the growth rate over the next comparable workload window and assign someone to review remaining headroom.
Get your free CWYN Score to choose your next setup improvement.