Improve session management UX: show session IDs and allow archive/delete from resume picker

Open 💬 5 comments Opened Jun 17, 2026 by MainArgs
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Problem

Managing saved Codex sessions is currently hard from the CLI.

codex resume --all shows a picker for sessions, but it does not expose an easily copyable session ID. However, commands like:

  • codex archive <SESSION>
  • codex delete <SESSION>
  • codex unarchive <SESSION>

require a session UUID or exact session name.

As a result, users have to inspect internal files such as ~/.codex/state_5.sqlite to find the session ID, which feels like an internal implementation detail leaking into normal usage.

Expected UX

One or more of the following would make this much easier:

  1. Show session IDs in codex resume --all, or provide a toggle to display/copy them.
  2. Add a dedicated command, for example:
  • codex sessions list
  • codex sessions archive <id>
  • codex sessions delete <id>
  1. Allow actions directly inside the resume picker:
  • Enter resume
  • a archive
  • d delete
  • c copy session ID
  • / search/filter

Why this matters

Users often need to clean up old sessions or identify the current directory's sessions. The current flow requires too much hidden knowledge and makes simple session management feel unnecessarily difficult.

Current workaround

Querying the internal sqlite database works, but should not be required:

sqlite3 -header -column ~/.codex/state_5.sqlite \
"select id, datetime(updated_at,'unixepoch','localtime') as updated, cwd, title from threads where archived=0 order by updated_at desc limit 30;"

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #28187

Powered by Codex Action

Necmttn · 2 months ago

A read-only codex sessions list would remove the need to query sqlite directly.

Useful columns: id, title, cwd/project, model, updated_at, archived/deleted state, source path, and size. Then archive/delete can take id and return a lifecycle receipt with before/after state.

Putting the same ids behind a copy action in the picker would cover the interactive flow without exposing implementation tables.

---

_Generated with ax._

Ar9av · 1 month ago

Ran into the same friction — needed a session's real id/cwd without digging into state_*.sqlite. I put together a small workaround: a /bookmark skill that (for Codex) parses the rollout jsonl to get the real session id + cwd, tags whatever you're working on, and writes it to a local JSON file, plus a tiny offline dashboard to browse/filter afterward (https://github.com/Ar9av/bookmark-agent). Doesn't give you archive/delete like proposed here — just a way to keep a findable pointer to a session without querying sqlite directly.

zbchi · 29 days ago

This is a critical feature

Superbil · 3 days ago

I’d also like to request a configurable limit for the number of sessions shown in the codex resume picker.

For example:

[tui]
session_picker_limit = 10

This would keep the picker manageable while preserving access to older sessions through session IDs or search. The existing dense view helps with layout, but does not limit the number of entries.

Environment: Codex CLI 0.149.1 on macOS.