ai-chat-cleaner
v0.6.0
Published
Clean and remove AI chat with an interactive terminal UI.
Maintainers
Readme
ai-chat-cleaner
Clean and remove AI chat with an interactive terminal UI.
npx ai-chat-cleaner
npx ai-chat-cleaner --agent codex- Supported agents:
- Codex (
codex) - Claude Code (
claude-code)
- Codex (
[!WARNING] Please restart your AI coding tool after deletion.
It is recommended to clean history while Codex is not running, to avoid concurrent writes.
Codex cleanup
Codex conversations are deleted through the official codex delete --force command. Codex Desktop stores sidebar tasks and scheduled automation runs in separate SQLite indexes, so the cleaner also removes selected entries from local_thread_catalog and automation_runs. This includes orphaned sidebar tasks and automation runs whose underlying conversation was already deleted.
Quit Codex before cleaning. Restart it after deletion so the sidebar reloads the updated desktop task indexes.
If a forked chat still uses a selected chat's paginated history, the cleaner asks whether to delete the fork too or skip the affected selected chats. It checks these references before deleting anything and removes dependent chats first.
The command is resolved in this order:
AI_CHAT_CLEANER_CODEX_BIN, when set- The Codex binary bundled with the macOS ChatGPT/Codex desktop app
codexonPATH
The selected executable must support codex delete --force. Update the Codex desktop app or install the Codex CLI if no compatible executable is found.
This is a local cleanup: it removes the Codex session and selected desktop task indexes from this computer. It does not delete the automation definition or the conversation from your ChatGPT account.
Delete Codex chats from your ChatGPT account
To delete a Codex chat from your account, use the official ChatGPT desktop app flow:
- Archive the chat from the Codex history sidebar.
- Open Settings → Archived chats.
- Delete the archived chat.
OpenAI schedules deleted chats for permanent deletion from its systems within 30 days, subject to its stated exceptions. See How to archive and delete Codex chats in the ChatGPT app.
Credit
The terminal interaction mode is inspired by taze.
Claude Code cleanup implementation references claude-chats-delete.
License
MIT License © jinghaihan
