# Preview OpenClaw memory forget with --dry-run

Canonical: https://cwyn.com/pages/openclaw-guide-memory-forget-preview.html
Last updated: 2026-11-27T04:59:11-05:00

OpenClaw operations guide

Stop the Gateway that owns the memory store, then run `openclaw memory forget --agent <agent-id> --session <id-or-key> --dry-run --json`. The preview lists tracked entries without deleting them. Check `mixedLineageEntryKeys` for entries shared with other sessions that a purge would remove in full. The original transcript stays in the session store.

Last updated November 27, 2026 · Published November 18, 2026

The [OpenClaw Native Memory Activation Kit](https://cwyn.com/pages/pack-openclaw-native-memory-activation-kit.html) is an optional paid kit with memory rollout, retrieval verification and promotion-policy templates.

OpenClaw Native Memory Activation Kit $39.95

Enable OpenClaw native memory, retrieval, and dreaming safely with activation sequencing, pre-widening readiness, rollout controls, and rollback-ready governance.

By CWYN · Reviewed November 27, 2026 against the [OpenClaw 2026.11.5 memory CLI reference](https://raw.githubusercontent.com/openclaw/openclaw/v2026.11.5/docs/cli/memory.md) · Checked against docs, not run

When a detail from an old chat still appears in memory search, identify the source before deciding what to remove. The built-in memory plugin can preview the artifacts it can trace to one session. Original transcripts, untracked workspace text and external copies have their own retention paths.

## 1. Identify the exact agent and session

Confirm that the target agent uses the bundled `memory-core` store you intend to inspect. Use `openclaw sessions --agent <agent-id> --limit all --json` to locate the exact key or full case-sensitive session ID. Keep those identifiers and the output private. [2026.11.5 memory provenance reference](https://raw.githubusercontent.com/openclaw/openclaw/v2026.11.5/docs/concepts/memory-provenance.md)

## 2. Use a maintenance window for the preview

On 2026.11.5, stop the Gateway that owns the state directory through its service owner. Run the CLI with the same configuration and state on the Gateway host or in the deployment’s maintenance container. Even previews can initialize writable stores and require exclusive ownership. [2026.11.5 memory CLI reference](https://raw.githubusercontent.com/openclaw/openclaw/v2026.11.5/docs/cli/memory.md)

## 3. Preview only the selected session

Run `openclaw memory forget --agent <agent-id> --session <id-or-key> --dry-run --json`. Keep `--dry-run` in place. The command deletes immediately without it, without a confirmation prompt. Confirm the selected agent and `sessionResolutions` before reading the artifact counts. Restart the Gateway through the same owner when the preview is complete.

## 4. Check whole-entry removals and separate retention

Review `mixedLineageEntryKeys` for entries that would be removed in full even though they also came from other sessions. Use `curatedWrites` and `untargetableEntryKeys` as leads for manual inspection. Inventory the original transcript, archives, backups and external stores separately. [Documented deletion boundaries](https://docs.openclaw.ai/concepts/memory-provenance)

## 5. Test the retention check with harmless data

In an isolated test profile, seed a distinct phrase for the target session and a second phrase for a session that should stay searchable. After an authorized test cleanup, repeat the preview and confirm the expected search behavior from a fresh session. Before approving a production cleanup, agree on the affected artifacts, retained copies and how they will be handled. A search miss verifies only the retrieval route you tested.

[Get your free CWYN Score](https://cwyn.com/score) to choose your next setup improvement.

## Related guides

- [OpenClaw memory index stale: test whether new notes are searchable](https://cwyn.com/pages/openclaw-guide-memory-index-stale.html)
- [OpenClaw multi-agent memory isolation: test scope before sharing](https://cwyn.com/pages/openclaw-guide-multi-agent-memory-isolation.html)
- [OpenClaw daily session reset hour (default 4 AM)](https://cwyn.com/pages/openclaw-guide-daily-session-reset.html)
- [OpenClaw memory not saving: why Memory Wiki notes go missing](https://cwyn.com/pages/openclaw-guide-memory-wiki-not-saving.html)

## Next steps

- [All 135 OpenClaw guides](https://cwyn.com/guides/openclaw/)
- [OpenClaw setup walkthrough](https://cwyn.com/setup/openclaw/)
- [Check your OpenClaw AGENTS.md](https://cwyn.com/score/setup-file-checker/?profile=openclaw)
- [OpenClaw Complete Setup Pack ($14.95)](https://cwyn.com/pages/pack-openclaw-complete-setup-pack.html)
