← 返回 Skills 市场
vyctorbrzezowski

Codex Session Image Scrubber

作者 Vyctor H. Brzezowski · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
40
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

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 "\x3Cphrase>" ~/.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 \x3Cthread-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 \x3Cthread-id> --write
    
  4. Validate after writing.

    • Confirm size dropped with ls -lh \x3Cfile> \x3Cbackup>.
    • Confirm the JSONL still parses; the script reports parseErrors: 0.
    • Check obvious image payloads are gone:
      rg -n "data:image|iVBORw0KGgo|/9j/4AAQ|UklGR" \x3Cfile>
      
      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 \x3Cimage> or \x3C/image> 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 \x3Cid>: find a rollout JSONL under ~/.codex/sessions.
  • --file \x3Cpath>: scrub a specific JSONL.
  • --write: perform the rewrite; without this the script is dry-run only.
  • --backup-dir \x3Cpath>: override the backup directory.
  • --sessions-dir \x3Cpath>: override the Codex sessions root.
  • --min-bytes \x3Cn>: threshold for suspicious image fields; defaults to 100000.
安全使用建议
Install only if you are comfortable letting the skill inspect and modify local Codex session JSONL files. Use the dry-run first, check the reported target file and expected size reduction, and keep the backup until you confirm the session still opens correctly.
能力评估
Purpose & Capability
The stated purpose is to remove large image/base64 payloads from Codex session JSONL files, and the script implements targeted replacement of image-like fields while preserving surrounding JSON structure and text.
Instruction Scope
Instructions tell the agent to confirm the target session, run a dry-run first, only write with --write, validate afterward, and stop if multiple session files match.
Install Mechanism
The package contains a skill file, one local Node.js helper script, and a simple agent prompt YAML; no install hooks, package dependencies, or automatic startup behavior are present.
Credentials
The skill reads and can rewrite local Codex session files under ~/.codex/sessions, which may contain private conversation data, but that access is directly tied to the stated cleanup purpose and is user-directed.
Persistence & Privilege
No persistence, background workers, privilege escalation, credential access, or network exfiltration behavior was found; backups are created locally under ~/.codex/session_backups by default before modifying files.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install codex-session-image-scrubber
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /codex-session-image-scrubber 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of codex-session-image-scrubber. - Locate and clean Codex session JSONL files by removing embedded image, screenshot, or base64 blobs. - Preserves all conversation text and structure while replacing images with small placeholders. - Backs up original session files before modification. - Provides both dry-run and write modes for safe operation. - Includes validation steps to confirm file integrity and successful image removal. - Adds user commands for specifying target session via thread id or search phrase.
元数据
Slug codex-session-image-scrubber
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 40 次。

如何安装 Codex Session Image Scrubber?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install codex-session-image-scrubber」即可一键安装,无需额外配置。

Codex Session Image Scrubber 是免费的吗?

是的,Codex Session Image Scrubber 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Codex Session Image Scrubber 支持哪些平台?

Codex Session Image Scrubber 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Codex Session Image Scrubber?

由 Vyctor H. Brzezowski(@vyctorbrzezowski)开发并维护,当前版本 v0.1.0。

💬 留言讨论