Install
openclaw skills install @lunarcache/clean-codex-archivesSafely inspect and remove locally archived Codex conversation data on Windows, macOS, and Linux, including archived rollout JSONL files, archived session rows and related logs in Codex SQLite databases, and stale session_index.jsonl entries. Use when the user asks to clear, purge, delete, or clean archived Codex conversations or their local history metadata.
openclaw skills install @lunarcache/clean-codex-archivesUse the bundled scripts/clean_codex_archives.py script as the cross-platform entry point. It uses only Python's standard library and preserves active sessions.
--codex-home argument, then the CODEX_HOME environment variable, then the current user's .codex directory.state_5.sqlite as the source of truth. Only rows with threads.archived = 1 are eligible for deletion.--apply first. Use --apply only after the user explicitly authorizes deletion.thread_dynamic_tools and thread_spawn_edges rows when those tables are present.archived_sessions/*.jsonl files. Do not delete the archive directory itself or unrelated files.session_index.jsonl only after database cleanup, retaining entries whose IDs still exist in state_5.sqlite and rejecting malformed JSON instead of silently dropping it.--apply.--vacuum only when the user also wants SQLite files compacted; it may require exclusive database access and is not needed for logical deletion.quick_check reports ok for modified databases.# Inventory only; no changes. Use python3 on Unix-like systems.
python3 ./scripts/clean_codex_archives.py
# Apply the explicitly authorized cleanup.
python3 ./scripts/clean_codex_archives.py --apply
# Use a specific Codex data root.
python3 ./scripts/clean_codex_archives.py --codex-home "$HOME/.codex" --apply
# Optional physical compaction after deletion.
python3 ./scripts/clean_codex_archives.py --apply --vacuum
On Windows, use python instead of python3.