Skip to content

Repository files navigation

ai-chat-cleaner

npm version bundle JSDocs License

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)

Warning

Please restart your AI coding tool after deletion.

It is recommended to clean history while Codex is not running, to avoid concurrent writes.

screenshot

Codex cleanup

Codex conversations are deleted through the official codex delete --force command. The CLI keeps the existing interactive selection UI, but no longer edits Codex SQLite or JSONL files directly.

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
  • codex on PATH

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 from this computer. It does not delete 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:

  1. Archive the chat from the Codex history sidebar.
  2. Open SettingsArchived chats.
  3. 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

About

Clean and remove AI chat with an interactive terminal UI.

Topics

Resources

Stars

25 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages