Feature Request: Add `/archive` command to Codex CLI
Resolved 💬 10 comments Opened Mar 9, 2026 by escape0707 Closed May 31, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
Codex CLI
What feature would you like to see?
Add a /archive slash command to Codex CLI so a user can archive the current conversation/session without deleting it.
Additional information
Problem
Right now, there is no documented /archive slash command in Codex CLI, unlike Codex IDE extension or Codex App. This makes it harder to clean up active sessions.
Why this matters
A dedicated archive command would help users:
- reduce clutter in active session lists
- preserve older conversations without deleting them
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
My FR is closer to https://github.com/openai/codex/issues/8784. That is a FR for /delete, though. So a slight different taste. I think it's okay to merge these two FR or track and close them separately.
Analysis
Good news: the archive infrastructure already exists in the core layer. The gap is just the TUI slash command to trigger it.
What already exists:
codex-rs/core/src/state_db.rs:152has anarchived_only: boolfield for querying archived vs active sessionscodex-rs/core/tests/suite/rollout_list_find.rs:208-213showsarchived_sessionsdirectory usage andfind_archived_thread_path_by_id_strfor locating archived threadscodex-rs/core/tests/suite/personality_migration.rs:39haswrite_archived_session_with_user_event- showing the archive data format is establishedWhat's missing:
Archivevariant in theSlashCommandenum (codex-rs/tui/src/slash_command.rs)Proposed Implementation
slash_command.rs:Archivewith description "archive the current conversation"available_during_taskshould returnfalse(matches pattern of /new, /resume, /fork)archived_sessions/directory/resumeintegration: Should/resumesurface archived sessions in a separate section? This would allow un-archiving, which completes the feature.This looks like a straightforward addition since the data layer already supports it. The Codex App and IDE extension likely use the same core archive APIs - this just surfaces them in the TUI. Happy to submit a PR if invited.
Me too, but they freeze non collaborator PR now IIRC.
https://github.com/openai/codex/blob/main/docs/contributing.md#contributing
If I understand correctly, for the TUI we are essentially talking about archiving removing items from
codex resume. Are there other UX surfaces this would hit?Beyond
codex resume, here are the other UX surfaces:/archivevariant inSlashCommandenum (tui/src/slash_command.rs), withavailable_during_taskreturning false (matching/new,/resume,/fork)resume_picker.rscurrently only shows active sessions. Archived sessions could surface in a separate section (or behind a flag) to support un-archiving. TheSessionPickerActionenum would need anArchivevariant.AppEvent::ArchiveSessionvariant (alongsideNewSession,OpenResumePicker,ForkCurrentSessioninapp_event.rs)The good news is the heavy lifting is already done. The app-server protocol already defines
ThreadArchiveParams,ThreadUnarchiveParams,ThreadArchivedNotification, andThreadUnarchivedNotificationinprotocol/v2.rs. There's even a full test suite atapp-server/tests/suite/v2/thread_archive.rsthat shows the archive flow (move rollout toarchived_sessions/, emit notification, support re-resume). The state DB already filters onarchived_only.So TUI-side it's mostly wiring: slash command -> app event -> protocol call -> status feedback. The resume picker integration (showing/hiding archived sessions) is the only part that needs a UX decision.
@mvanhorn Dude, you rely on AI too much. This is exactly why OpenAI and so many FOSS projects refuse unsolicited PRs. Revise the AI slop and transform it to your own output before post. For example:
This is not how Codex TUI handle thread status change right now. For
/compactand/fork, a command finish message is appended at the end of the (new) conversation, not "the bottom pane status indicator".Why is this even mentioned when talking about UX?
I know your first comment is AI generated, too. So I only quoted the last paragraph you write by yourself. Please show some respect to other's effort and revise AI output before posting in this doomed AI era.
---
@kendonB I think it would be helpful to let users archive sessions from
codex resumeand maybe also provide an/archivecommand in the main chatting UI. For an/archivecommand it would be cool to redirect user tocodex resumeUI rather than exiting and prepend an "archived" message.I have a working TUI implementation for this feature in a fork, but cannot open an upstream PR because this repository currently limits PR creation to collaborators.
Implementation artifact:
MichaelSpece:codex/tui-archive-chatscargo test -p codex-tui archiveWhat the patch adds:
/archiveand/unarchiveslash commands in the TUI./archive <id-or-name>and/unarchive <id-or-name>direct targeting.I also verified the upstream compare page directly in the browser. The branch compares cleanly and shows the expected commit, but GitHub does not expose the Create Pull Request control for this account. The page states that repository owners have limited PR creation to collaborators.
Any interest in this from openai?
This will be included in the next release. I've added both an
/archiveslash command and acodex archiveandcodex unarchivecommand-line option.