设计与多媒体

Codex Session Image Scrubber

试用

Use when a Codex thread or local session is slow because prior turns contain heavy image, screenshot, or base64 payloads. Helps locate the session JSONL, bac...

它能做什么

Use when a Codex thread or local session is slow because prior turns contain heavy image, screenshot, or base64 payloads. Helps locate the session JSONL, bac...

技能文档

Codex Session Image Scrubber

Purpose

Clean 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.

Workflow

  1. Confirm the target thread/session.

    • Prefer a thread id if the user provides one.
    • If they provide a remembered phrase, locate the session with rg -l "" ~/.codex/sessions ~/.codex/session_index.jsonl.
    • Do not edit the active file until you know which JSONL is the target.
  2. Dry-run the scrubber.

    node ~/.codex/skills/codex-session-image-scrubber/scripts/scrub-codex-session-images.mjs --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
    
  3. 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  --write
    
  4. Validate after writing.

    • Confirm size dropped with ls -lh .
    • Confirm the JSONL still parses; the script reports parseErrors: 0.
    • Check obvious image payloads are gone:
      rg -n "data:image|iVBORw0KGgo|/9j/4AAQ|UklGR" 
      
      Exit code 1 with no output is the desired result.
  5. Tell the user the before/after size, backup path, and whether validation passed. Suggest reopening the thread so the app reloads the lighter file.

Safety Rules

  • Only remove image payloads, not text that mentions images.
  • Keep or text markers if present; they are small and can preserve conversation structure.
  • Always keep a backup outside ~/.codex/sessions; the script defaults to ~/.codex/session_backups.
  • If multiple session files match a thread id, stop and pick explicitly instead of guessing.
  • If the user wants the backup removed later, ask for confirmation before deleting it.

Script

The deterministic scrubber is at scripts/scrub-codex-session-images.mjs.

Useful options:

  • --thread-id : find a rollout JSONL under ~/.codex/sessions.
  • --file : scrub a specific JSONL.
  • --write: perform the rewrite; without this the script is dry-run only.
  • --backup-dir : override the backup directory.
  • --sessions-dir : override the Codex sessions root.
  • --min-bytes : threshold for suspicious image fields; defaults to 100000.

相关技能

Use this skill when the user wants to inspect, search, export, verify, clean up, delete, restore, or purge local Codex sessions stored under a Codex root suc...

16 次安装1 星标

Export a Codex session JSONL from ~/.codex/sessions into a clean Markdown transcript in ~/Documents/Exports. Use when the user wants to export, save, or conv...

14 次安装1 星标

Export a Codex CLI or Codex Desktop (App) session to Markdown, HTML, or Obsidian notes. Use when the user asks to export, save, share, or review a past chat, session, or transcript. Supports --brief, --redact, --since/--until, --grep, --append (incremental), --interactive (message picker), --sessions (merge), --watch (auto-incremental), and --list. Works with both Codex CLI and Codex Desktop app sessions.

Use when a user wants to turn local Codex image_generation capability into a local HTTP image server for apps such as Photoshop plugins, design tools, or int...

12 次安装

Safely inspect and remove locally archived Codex conversation data on Windows, macOS, and Linux, including archived rollout JSONL files, archived session row...

1 星标

Summarize Codex token usage from local Codex Desktop or CLI session JSONL logs. Use when the user asks to count, audit, total, compare, or report Codex/OpenA...

5 次安装1 星标