Install
openclaw skills install codex-session-image-scrubberUse when a Codex thread or local session is slow because prior turns contain heavy image, screenshot, or base64 payloads. Helps locate the session JSONL, back it up, remove only embedded image blobs, preserve conversation text, and validate the cleaned file.
openclaw skills install codex-session-image-scrubberClean oversized Codex session logs by replacing embedded image/base64 payloads with small placeholders while keeping the surrounding conversation, tool calls, and text intact.
Use this when the user says a Codex chat/thread is heavy, slow, bloated, or contains pasted screenshots/images/base64 they want removed from history.
Confirm the target thread/session.
rg -l "<phrase>" ~/.codex/sessions ~/.codex/session_index.jsonl.Dry-run the scrubber.
node ~/.codex/skills/codex-session-image-scrubber/scripts/scrub-codex-session-images.mjs --thread-id <thread-id>
Or, with an exact file:
node ~/.codex/skills/codex-session-image-scrubber/scripts/scrub-codex-session-images.mjs --file /path/to/rollout.jsonl
If the dry-run looks right, write the cleaned file.
node ~/.codex/skills/codex-session-image-scrubber/scripts/scrub-codex-session-images.mjs --thread-id <thread-id> --write
Validate after writing.
ls -lh <file> <backup>.parseErrors: 0.rg -n "data:image|iVBORw0KGgo|/9j/4AAQ|UklGR" <file>
Exit code 1 with no output is the desired result.Tell the user the before/after size, backup path, and whether validation passed. Suggest reopening the thread so the app reloads the lighter file.
<image> or </image> text markers if present; they are small and can preserve conversation structure.~/.codex/sessions; the script defaults to ~/.codex/session_backups.The deterministic scrubber is at scripts/scrub-codex-session-images.mjs.
Useful options:
--thread-id <id>: find a rollout JSONL under ~/.codex/sessions.--file <path>: scrub a specific JSONL.--write: perform the rewrite; without this the script is dry-run only.--backup-dir <path>: override the backup directory.--sessions-dir <path>: override the Codex sessions root.--min-bytes <n>: threshold for suspicious image fields; defaults to 100000.