Codex Desktop delete leaves local session index, logs, and desktop-state residues

Open 💬 1 comment Opened May 22, 2026 by 1939869736luosi

What variant of Codex are you using?

Codex Desktop macOS app. Exact app version was not captured during this quick repro.

What issue are you seeing?

Codex Desktop archived-chat delete is not just a UI delete: in local testing it removed the main rollout JSONL and some state DB rows. However, it still left local residues for the same thread ID.

Reproduction

  1. Pick an archived chat visible in Codex Desktop Settings > Archived chats.
  2. Before deleting it in the UI, verify the local ~/.codex surfaces for that thread ID.
  3. Delete the archived chat from Codex Desktop.
  4. Verify the same thread ID immediately and again after a short delay.

Observed local state

Before Codex Desktop delete:

session file:       1
shell snapshots:    0
session_index rows: 1
history rows:       0
state thread rows:  1
dynamic tool rows:  3
log rows:           1000
desktop-state refs: 2

After Codex Desktop delete, checked immediately and again after 5 seconds:

session file:       0
shell snapshots:    0
session_index rows: 1
history rows:       0
state thread rows:  0
dynamic tool rows:  0
log rows:           1000
desktop-state refs: 2

So the built-in delete removed the main conversation file and some state rows, but did not remove:

  • ~/.codex/session_index.jsonl rows for the deleted thread
  • ~/.codex/logs_2.sqlite log rows for the deleted thread
  • ~/.codex/.codex-global-state.json desktop state references, in this case prompt history and heartbeat permission entries

The deleted thread did not appear in the local Codex trash folder.

Expected behavior

When the UI says an archived chat is permanently deleted, local storage should either:

  1. remove all local references for that thread ID, including index rows, logs, and desktop-state references; or
  2. clearly document that the UI delete removes only the conversation body and selected state rows, while local diagnostic/history residues may remain.

Why this matters

Users may reasonably read permanent delete as local cleanup for that conversation. Leaving stale local rows also makes local history audits, search behavior, cleanup tooling, and future reconciliation harder to reason about.

Additional context

I used a small local verifier/cleanup tool to compare the same thread ID before and after deletion: https://github.com/1939869736luosi/codex-sessions-manager

I am not suggesting that this tool replace the built-in Codex UI. The point is only that the built-in delete currently appears to leave local residues that can be measured by thread ID.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗