Codex Archive Cleaner
Use when the user wants to delete, clear, remove, permanently delete, restore, or clean archived Codex conversations on Windows, especially when the Windows Codex UI has no delete button for archived conversations.
Install in one line
CLI$ mfkvault install codex-archive-cleanerRequires the MFKVault CLI. Prefer MCP?
Free to install — no account needed
Copy the command below and paste into your agent.
Instant access • No coding needed • No account needed
What you get in 5 minutes
- Full skill code ready to install
- Works with 1 AI agent
- Lifetime updates included
Description
--- name: codex-archive-cleaner description: Use when the user wants to delete, clear, remove, permanently delete, restore, or clean archived Codex conversations on Windows, especially when the Windows Codex UI has no delete button for archived conversations. --- # Codex Archive Cleaner This skill manages archived Codex conversations stored locally on Windows. ## Target Files Codex local data is usually stored under: `C:\Users\<USER>\.codex` Archived conversations are usually stored in: `C:\Users\<USER>\.codex\archived_sessions` The conversation index is usually: `C:\Users\<USER>\.codex\session_index.jsonl` ## Delete Archived Conversations When the user asks to delete or clear archived Codex conversations: 1. Inspect `C:\Users\<USER>\.codex\archived_sessions`. 2. List the archived session files. 3. Create a timestamped backup in the current workspace before deleting anything. 4. Back up: - all files from `archived_sessions` - `session_index.jsonl` 5. Extract archived session UUIDs from filenames. 6. Delete the archived session `.jsonl` files. 7. Remove matching UUID entries from `session_index.jsonl`. 8. Verify that `archived_sessions` contains zero files. 9. Tell the user to restart Codex if the UI still shows old archived conversations. Prefer using `scripts/clear_archived_codex_sessions.ps1` for the destructive cleanup. ## Restore Archived Conversations When the user regrets deleting archived conversations or asks to restore them: 1. Locate the timestamped backup folder or folders created by this workflow. 2. Confirm the backup contains archived session `.jsonl` files and `session_index.jsonl.bak`. 3. Save a pre-restore backup of the current `session_index.jsonl` and any current archived files. 4. Copy backed-up archived session `.jsonl` files back into `archived_sessions`. 5. Restore `session_index.jsonl` from the selected `session_index.jsonl.bak`. 6. Verify that restored archived IDs are present in the index. 7. Tell the user to restart Codex if the UI does not refresh. Prefer using `scripts/restore_archived_codex_sessions.ps1` for restoration. ## Safety And Recovery This workflow modifies local Codex data. Treat deletion as destructive. Before deleting or modifying anything under `C:\Users\<USER>\.codex`, clearly tell the user: - which archived session files will be deleted or restored - where the backup will be created or read from - that the backup can restore deleted archived conversations - that deleting the backup later makes the cleanup effectively permanent Request approval before running destructive steps. ## If The User Regrets Deleting The backup is the rollback path. To restore deleted archived conversations: 1. Copy backed-up archived session `.jsonl` files back into: `C:\Users\<USER>\.codex\archived_sessions` 2. Replace: `C:\Users\<USER>\.codex\session_index.jsonl` with the backed-up `session_index.jsonl.bak`. 3. Ask the user to restart Codex so the conversation list refreshes. ## If The User Wants Permanent Deletion After the user confirms Codex works normally and the archived conversations are gone from the UI, the backup folders can be deleted. Only delete backup folders created by this cleanup workflow, usually named like: `codex-archive-backup-YYYYMMDD-HHMMSS` Never delete unrelated folders, active session data, `sessions`, authentication files, config files, plugin data, or workspace files. ## Validation After cleanup, verify: - `archived_sessions` has `0` files - `session_index.jsonl` no longer contains the deleted archived session UUIDs - backup folders exist in the current workspace After restore, verify: - restored archived session files exist in `archived_sessions` - restored archived session UUIDs exist in `session_index.jsonl` - a pre-restore backup exists Report the result clearly to the user. # 中文说明 这个 skill 用于管理 Windows 本地保存的 Codex 归档对话。 ## 目标文件 Codex 本地数据通常位于: `C:\Users\<USER>\.codex` 归档对话通常位于: `C:\Users\<USER>\.codex\archived_sessions` 会话索引文件通常是: `C:\Users\<USER>\.codex\session_index.jsonl` ## 删除归档对话 当用户要求删除或清空 Codex 归档对话时: 1. 检查 `C:\Users\<USER>\.codex\archived_sessions`。 2. 列出归档会话文件。 3. 删除前,在当前工作区创建带时间戳的备份。 4. 备份 `archived_sessions` 里的所有文件和 `session_index.jsonl`。 5. 从归档文件名中提取会话 UUID。 6. 删除归档会话 `.jsonl` 文件。 7. 从 `session_index.jsonl` 中移除对应 UUID 的索引行。 8. 验证 `archived_sessions` 中剩余文件数为 `0`。 9. 如果 Codex 界面仍显示旧归档对话,提醒用户重启 Codex。 优先使用 `scripts/clear_archived_codex_sessions.ps1` 执行清理。 ## 恢复归档对话 当用户后悔删除,或要求恢复归档对话时: 1. 找到由本流程创建的备份文件夹。 2. 确认备份包含归档 `.jsonl` 文件和 `session_index.jsonl.bak`。 3. 先保存恢复前的当前索引和当前归档文件。 4. 把备份中的归档 `.jsonl` 文件复制回 `archived_sessions`。 5. 用备份中的 `session_index.jsonl.bak` 恢复 `session_index.jsonl`。 6. 验证恢复的归档 ID 能在索引中找到。 7. 如果界面没有刷新,提醒用户重启 Codex。 优先使用 `scripts/restore_archived_codex_sessions.ps1` 执行恢复。 ## 安全与后悔药 这个流程会修改 Codex 本地数据,应视为破坏性操作。 在删除或修改 `C:\Users\<USER>\.codex` 下的任何文件前,必须明确告诉用户: - 哪些归档会话文件会被删除或恢复 - 备份会保存在哪里,或将从哪里读取 - 备份可以用于恢复被删除的归档对话 - 之后删除备份会让这次清理变成事实上的永久删除 执行破坏性步骤前必须请求用户确认。 ## 如果用户后悔删除 备份就是回滚路径。 恢复方法: 1. 把备份中的归档 `.jsonl` 文件复制回 `C:\Users\<USER>\.codex\archived_sessions`。 2. 用备份中的 `session_index.jsonl.bak` 替换 `C:\Users\<USER>\.codex\session_index.jsonl`。 3. 提醒用户重启 Codex,让对话列表刷新。 ## 如果用户想永久删除 当用户确认 Codex 工作正常,并且归档对话已经从界面消失后,可以删除备份文件夹。 只能删除这个清理流程创建的备份文件夹,通常命名类似: `codex-archive-backup-YYYYMMDD-HHMMSS` 不要删除无关文件夹、活跃会话数据、`sessions`、认证文件、配置文件、插件数据或工作区文件。 ## 验证 清理后需要验证: - `archived_sessions` 中有 `0` 个文件 - `session_index.jsonl` 中不再包含被删除归档会话的 UUID - 当前工作区中存在备份文件夹 恢复后需要验证: - 归档 `.jsonl` 文件已经回到 `archived_sessions` - 恢复的归档 UUID 能在 `session_index.jsonl` 中找到 - 恢复前状态备份已经创建 最后向用户清楚说明结果。
Security Status
Scanned
Passed automated security checks
Related AI Tools
More Grow Business tools you might like
Linear
FreeManaging Linear issues, projects, and teams. Use when working with Linear tasks, creating issues, updating status, querying projects, or managing team workflows.
codex-collab
FreeUse when the user asks to invoke, delegate to, or collaborate with Codex on any task. Also use PROACTIVELY when an independent, non-Claude perspective from Codex would add value — second opinions on code, plans, architecture, or design decisions.
Rails Upgrade Analyzer
FreeAnalyze Rails application upgrade path. Checks current version, finds latest release, fetches upgrade notes and diffs, then performs selective upgrade preserving local customizations.
Asta MCP — Academic Paper Search
FreeDomain expertise for Ai2 Asta MCP tools (Semantic Scholar corpus). Intent-to-tool routing, safe defaults, workflow patterns, and pitfall warnings for academic paper search, citation traversal, and author discovery.
Hand Drawn Diagrams
FreeCreate hand-drawn Excalidraw diagrams, flows, explainers, wireframes, and page mockups. Default to monochrome sketch output; allow restrained color only for page mockups when the user explicitly wants webpage-like fidelity.
Move Code Quality Checker
FreeAnalyzes Move language packages against the official Move Book Code Quality Checklist. Use this skill when reviewing Move code, checking Move 2024 Edition compliance, or analyzing Move packages for best practices. Activates automatically when working