Allow to delete threads in the Codex app

Resolved 💬 26 comments Opened Feb 27, 2026 by CharlesIC Closed Jun 7, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

Codex macOS app

What feature would you like to see?

Requested feature

Allow to delete threads instead of just archiving them.

Context

At the moment I have to go to ~/.codex/archived_sessions/, locate the file related to the thread I want to delete and manually delete it. I'd appreciate having the option to do that from the UI instead.

Proposed solutions

  • A delete button showing in the UI next to the archive button in the Threads section of the sidebar
  • A delete option in the thread context menu below the "Archive thread" item
  • A button to delete a thread next to the unarchive button on the "Settings/Archived threads" screen

Additional information

<img width="232" height="44" alt="Image" src="https://github.com/user-attachments/assets/88e24aba-10ea-4bb9-8ad6-d05368f3c364" />

<img width="188" height="248" alt="Image" src="https://github.com/user-attachments/assets/a646df23-12af-4199-8c55-2c0eebddacc9" />

<img width="721" height="167" alt="Image" src="https://github.com/user-attachments/assets/3aaaa926-b2b2-417c-824f-2ae4ae9cbd2c" />

View original on GitHub ↗

26 Comments

TobiasArg · 4 months ago

Yes, please. It’s really annoying to have to see a lot of old threads that are now useless. The only way to hide them is by archiving them, but that’s just like moving the dust under the carpet — it’s not a real solution.

MiladInk · 4 months ago

I also support this. I don't like just archiving and not deleting.

devhogu · 4 months ago

i wonder what is the reason for codex to keep collecting them and not letting to delete, what's the point.

YodaEmbedding · 3 months ago
kelvinovo00 · 3 months ago

2 months passed, this simple feature still not be supported, why it happens?

prithagupta · 3 months ago

Current workaround (macOS Codex app):

  1. Open Finder.
  2. Press Cmd + Shift + G.
  3. Go to:

``text
~/.codex/archived_sessions/
``

  1. Find the archived session file for the thread you want gone.
  2. Delete that file.
  3. Reopen Codex (or refresh the sidebar).

If the thread is still active (not archived yet):

  • Archive it first from the app.
  • Then remove the file from archived_sessions.

Optional terminal command:

rm -f ~/.codex/archived_sessions/*

This deletes all archived threads, so use it only if that’s what you want.

inwake · 3 months ago

Really? We cannot delete chats!? Couldn't find the option, and shocked to find this issue
Hoping this was just an oversight, and gets fixed promptly

Current workaround (macOS Codex app): 1. Open Finder. 2. Press Cmd + Shift + G. 3. Go to: `` ~/.codex/archived_sessions/ `` ...

Can confirm this works on Windows as well. Easiest to just treat "archived" as marked for deletion, then delete the files in ~\.codex\archived_sessions in explorer,

Or with powershell:

Remove-Item ~\.codex\archived_sessions\* -Force

For anyone coming here later only to find disappointment, maybe this unrelated usage tip can help.

I needed to run Codex as administrator (which I think is recommended) and also with --disable-gpu (electron app) argument since all electron apps don't render correctly at all on my older GTX 1080 GPU. And I usually just make a shortcut for electron apps I use to pass that argument

But Codex, unfortunately is only distributed via Microsoft Store and winget, both of which get installed into just objectively terrible nonsensical paths:

C:\Program Files\WindowsApps\OpenAI.Codex_26.409.7971.0_x64__2p2nqsd0c76g0\app\Codex.exe

And every update the path actually changes as new app directory is created with new date and hash and the old one is not removed, which is very convenient for people wanting to keep all previous versions on disk. It probably does get removed eventually by Microsoft, since it manages this bloat. There are also symlinks that are used to open the app and change even more often. They have even more ridiculous paths:

C:\Users\$env:USERNAME\AppData\Local\Microsoft\WinGet\Links\codex.exe

So I needed to make a shortcut that:

  • Uses the correct codex.exe
  • Runs it as administrator
  • Solves my GPU issue with command line argument
  • Ideally does not point to a powershell script, which I would need to keep track of and remember it exists

And I got all of it to work with a basic shortcut only! The shortcut target can accept a short powershell script to find the path of the latest codex install/update, add the argument, and run it as admin. This worked for me:

"C:\Program Files\PowerShell\7-preview\pwsh.exe" -W Hidden -C "$f=gci 'C:\Program Files\WindowsApps\OpenAI.Codex_*'|sort {[version]($_.Name.Split('_')[1])}-Desc|select -f 1;if($f){Start-Process \"$($f.FullName)\app\Codex.exe\" '--disable-gpu' -Verb RunAs}"

<img width="222" height="480" alt="Image" src="https://github.com/user-attachments/assets/2d7ebc23-bbf1-491a-bee6-39d4f786664d" />

Important to note that:

  • "Run as administrator" in advanced shortcut properties is not checked
  • "Start in" is empty, since it is not used

I am realizing how niche of an issue I just described but could still be useful to know!

tiancaixiaoeyu · 2 months ago

really disappointed to see that simple issue havent been solved yet even though a 2 months passed

Aesthermortis · 2 months ago

I want to add a related data-retention/privacy angle to this request.

This is not only about cleaning up the sidebar. If Codex stores local session or
archived thread data under CODEX_HOME, users should not have to manually browse
internal date-based/session folders to remove old conversations.

In practice, the current workaround is still manual filesystem cleanup: locate
the relevant session/archive data and delete it by hand. That is brittle because
users have to infer which internal files are safe to remove.

This matters because Codex threads can contain sensitive or semi-sensitive local
context, such as:

  • source code
  • file paths
  • project names
  • diffs
  • commands
  • logs
  • environment details
  • personal notes
  • accidental secrets

If those files remain on disk indefinitely, any process with access to the user's
profile can potentially read or copy them.

A complete fix should distinguish:

  • Archive thread
  • Delete thread from the UI
  • Delete archived thread
  • Delete associated local session/transcript data
  • Clear all archived or old sessions
  • Configure retention by age or count
  • Show/open the local storage location

Archiving should not be treated as deletion.

The UI should make local data management explicit instead of requiring users to
manually delete files from internal Codex storage folders.

Several months have passed since this was reported, and the workaround is still
manual cleanup of internal session/archive files for something that should be a
basic thread-management action.

hanityx · 2 months ago

@Aesthermortis
had the same problem, so I built ThreadLens to make local AI sessions
searchable and cleanable without digging through Codex folders by hand.
It separates finding, backing up, archiving, and cleanup. https://github.com/hanityx/threadlens
but I agree this should really be native in Codex.

Aesthermortis · 2 months ago

@hanityx Clearing the Codex project list UI itself seems simple: deleting the session contents removes the entries.

The bigger problem is finding where Codex stores those sessions inside VS Code and knowing what else is stored in that folder. I have not checked the whole Codex storage structure yet, so manually deleting files is not ideal.

The current experience becomes messy very quickly. Old Codex sessions get in the way, archiving is not my preferred workflow, and now they are also mixed with Copilot chats, which makes the list feel chaotic.

A built-in option to delete or clean up old Codex sessions from the project list would make this much easier.

Thanks for sharing ThreadLens. This actually illustrates the problem very well.

It is impressive work, but users should not need a separate tool just to discover, review, back up, and clean up local AI sessions created by Codex, Copilot, or other assistants.

For Codex specifically, the issue is not just that old sessions exist. The problem is that the storage location and cleanup workflow are not obvious from inside VS Code/ Codex App. Manually deleting files is risky unless the user understands what else is stored in those folders, and archiving is not the same as actually cleaning up unwanted sessions.

The fact that tools like ThreadLens are needed is a strong signal that Codex should expose better built-in session management: clear session discovery, safe deletion, cleanup preview, and a way to understand what will be removed before anything destructive happens.

That would make the project list much easier to keep clean without forcing users to dig through VS Code/ Codex App or provider-specific storage folders.

jocelyn-racoillet · 2 months ago

This should be flagged as a Security/Privacy issue: session may need to be fully deleted when they inadvertently contain sensitive content.

daniz-trust · 2 months ago

Any update on this? seems like a straight forward feature i dont see the reason this is postponed so much

LeeeeTX · 2 months ago

We built a small open-source macOS tool for managing local Codex App/CLI conversation history:

https://github.com/LeeeeTX/codex-history-cleaner

It provides a terminal UI to list, search, preview, and delete local Codex sessions from ~/.codex. Deletion is recoverable by default with backups, and permanent deletion is also available with an extra confirmation step.

Hope this is useful for anyone who wants local controls for Codex history cleanup.

gspNadesico · 2 months ago

Adding another user request for this, from Codex desktop on Windows.

The current archive-only behavior is confusing for users who expect the same distinction they know from ChatGPT: archive should hide a thread, while delete should permanently remove it. In this case, the user specifically wanted to delete the current Codex chat to verify that deletion works, but only archiving was available.

Requested behavior:

  • Add an explicit Delete thread action in the Codex app UI, separate from Archive.
  • Make the confirmation copy clear about what is removed locally and, where applicable, from synced/account-backed storage.
  • Consider adding an optional retention setting such as "automatically delete threads older than N days" for users who do not want long-lived local/session history.

This would help users manage privacy and clutter without needing to locate and manually remove session files.

HyunKN · 2 months ago

I’d like to add a concrete Windows Codex Desktop case to this request.

My use case is narrower than “clear all history”: inside one project, I have several conversations in the sidebar, and I want to delete exactly one of them from the UI while keeping the rest of the project’s conversations intact.

Requested UX

In the project/sidebar conversation list:

Right-click conversation -> Delete thread...

Then show a confirmation dialog that clearly says this deletes the local conversation/session data for that one thread only, and does not delete or modify any workspace/project files.

Archive and delete should stay distinct actions:

Rename
Archive
Delete thread...

For archived threads:

Unarchive
Delete permanently...

Local evidence

On Windows, one visible sidebar conversation appears to map cleanly to a single thread id.

For one conversation I inspected locally, the related state was spread across:

%USERPROFILE%\.codex\session_index.jsonl
%USERPROFILE%\.codex\state_5.sqlite
%USERPROFILE%\.codex\sessions\YYYY\MM\DD\rollout-...jsonl
%USERPROFILE%\.codex\logs_2.sqlite

For that one thread, I found roughly:

session_index.jsonl: multiple records for the same thread id, due to renames
state_5.sqlite threads: 1 row
state_5.sqlite thread_dynamic_tools: a small number of related rows
stage1_outputs/thread_goals/thread_spawn_edges: none in this case
logs_2.sqlite logs: none in this case
rollout JSONL: one conversation transcript file

This makes the desired behavior feel well-scoped: delete one thread id and its associated local session/index/log records, without touching other conversations in the same project.

Expected behavior

Deleting one thread from the UI should:

  1. Remove only that one conversation from the project/sidebar list.
  2. Remove or trash the associated rollout JSONL for that thread.
  3. Remove matching local metadata/index rows for that thread.
  4. Remove only auxiliary rows tied to that thread, such as dynamic tools, goals, stage outputs, spawn edges, and logs.
  5. Never delete or mutate workspace/project files.
  6. Leave all other conversations in the same project visible and resumable.
  7. Require explicit confirmation before destructive deletion.
  8. Prefer the OS Trash/Recycle Bin where possible, or clearly explain that deletion is permanent.
  9. Block or warn more strongly for active/running threads, pinned threads, or threads with spawned descendants.

Why this matters

Right now, the only practical workaround is to inspect internal Codex storage and manually delete/edit files or SQLite rows. That is risky and not something users should need to do.

This is both a UX issue and a local data-retention/privacy issue. Codex conversations can contain paths, diffs, commands, logs, project names, and accidental sensitive context. Users need a supported way to delete exactly one local conversation from the UI.

1939869736luosi · 2 months ago

Related follow-up with local verification evidence: #23991

Codex Desktop now has an archived-chat delete action, and in my local test it did remove the main rollout JSONL and some state DB rows. However, the same thread ID still remained in session_index.jsonl, logs_2.sqlite, and desktop state after deletion.

I also published the small verifier/cleanup tool used for the before/after check here: https://github.com/1939869736luosi/codex-sessions-manager

Not proposing it as a replacement for the built-in delete UI; it is mainly useful for verifying and cleaning local residues after deletion.

Aesthermortis · 1 month ago

This is very suspicious, I'm starting to think what the reason for keeping the chats is. I have also noticed that there is a .git in the memory folder. that git is recreated every x amount of time.

matthew-mw · 1 month ago
Related follow-up with local verification evidence: #23991 Codex Desktop now has an archived-chat delete action, and in my local test it did remove the main rollout JSONL and some state DB rows. However, the same thread ID still remained in session_index.jsonl, logs_2.sqlite, and desktop state after deletion. I also published the small verifier/cleanup tool used for the before/after check here: https://github.com/1939869736luosi/codex-sessions-manager Not proposing it as a replacement for the built-in delete UI; it is mainly useful for verifying and cleaning local residues after deletion.

This works on my device.
However, I would like to add that it fails to work on cloud tasks dating back to last year from before the apps were released.

andrew-woo-dev · 1 month ago

It appears that a third-party application is required to facilitate functionality. Such a fundamental feature cannot be supplied internally; therefore, one must question the confidence in utilizing Codex.

kotoru-maker · 1 month ago

Still not solved. I don't understand why codex can't add a feature that is entirely regular in the ChatGPT browser function. OpenAI says it deletes data within 30 days, but that seems irrelevant if you can't delete the chat.

At this point it's not even clear, if deleting the entire openai account solves this issue.

etraut-openai contributor · 1 month ago

The app now supports deletion of archived sessions. Open Settings, then go to "Archived chats", and click on the trash can icon next to the session you wish to delete.

matthew-mw · 1 month ago

@etraut-openai Any plans to make deletion of cloud-based sessions possible?

Aesthermortis · 1 month ago

Deleting archived content doesn't seem like a good solution; the content should be deleted without archiving it first. This seems very poorly written. It seems like they don't even care about the issue.

The app now supports deletion of archived sessions. Open Settings, then go to "Archived chats", and click on the trash can icon next to the session you wish to delete.
kotoru-maker · 1 month ago

'Any plans to make deletion of cloud-based sessions possible?' Claude Code already offered this long time ago and deletes the sessions within 24h. Codex will remain flawed until it can offer the same service.