Skip to content

Allow to delete threads in the Codex app #13018

Closed

Description

@CharlesIC

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

Image Image Image

Activity

  1. TobiasArg commented on Feb 28, 2026

    @TobiasArg

    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.

  2. MiladInk commented on Mar 6, 2026

    @MiladInk

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

  3. devhogu commented on Mar 6, 2026

    @devhogu

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

  4. changed the title [-]Allow to delete threads in the Codex macOS app[/-] [+]Allow to delete threads in the Codex app[/+] on Mar 7, 2026
  5. YodaEmbedding commented on Apr 2, 2026

    @YodaEmbedding

    Near duplicate: #7727

  6. kelvinovo00 commented on Apr 15, 2026

    @kelvinovo00

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

  7. prithagupta commented on Apr 16, 2026

    @prithagupta

    Current workaround (macOS Codex app):

    1. Open Finder.

    2. Press Cmd + Shift + G.

    3. Go to:

      ~/.codex/archived_sessions/
      
    4. Find the archived session file for the thread you want gone.

    5. Delete that file.

    6. 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.

  8. inwake commented on Apr 16, 2026

    @inwake

    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}"
    Image

    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!

  9. added
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Apr 28, 2026
  10. tiancaixiaoeyu commented on Apr 29, 2026

    @tiancaixiaoeyu

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

  11. 7 remaining items

  12. HyunKN commented on May 12, 2026

    @HyunKN

    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.

  13. 1939869736luosi commented on May 22, 2026

    @1939869736luosi

    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.

  14. Aesthermortis commented on May 22, 2026

    @Aesthermortis

    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.

  15. matthew-mw commented on May 28, 2026

    @matthew-mw

    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.

  16. andrew-woo-dev commented on May 29, 2026

    @andrew-woo-dev

    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.

  17. kotoru-maker commented on Jun 6, 2026

    @kotoru-maker

    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.

  18. etraut-openai commented on Jun 7, 2026

    @etraut-openai
    Contributor

    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.

  19. matthew-mw commented on Jun 7, 2026

    @matthew-mw

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

  20. Aesthermortis commented on Jun 8, 2026

    @Aesthermortis

    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.

  21. kotoru-maker commented on Jun 19, 2026

    @kotoru-maker

    '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.

  22. basantmandal commented on Jul 27, 2026

    @basantmandal

    Log in at https://chatgpt.com
    open the task so its URL shows the task id (https://chatgpt.com/codex/cloud/tasks/task_e_...), then in the browser DevTools console:

    const { accessToken } = await (await fetch('/api/auth/session')).json();
    const TASK_ID = 'task_e_69ca1c6290cc8331ab33a422b626ef48';
    const r = await fetch(`/backend-api/wham/tasks/${TASK_ID}`, {
      method: 'DELETE',
      headers: {
        Authorization: `Bearer ${accessToken}`
      }
    });
    console.log(r.status);
    
  23. SHi-ON commented on Aug 25, 2026

    @SHi-ON

    Log in at https://chatgpt.com open the task so its URL shows the task id (https://chatgpt.com/codex/cloud/tasks/task_e_...), then in the browser DevTools console:

    const { accessToken } = await (await fetch('/api/auth/session')).json();
    const TASK_ID = 'task_e_69ca1c6290cc8331ab33a422b626ef48';
    const r = await fetch(`/backend-api/wham/tasks/${TASK_ID}`, {
      method: 'DELETE',
      headers: {
        Authorization: `Bearer ${accessToken}`
      }
    });
    console.log(r.status);
    

    Confirmed!

  24. SHi-ON commented on Aug 25, 2026

    @SHi-ON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    User RequestappIssues related to the Codex desktop appenhancementNew feature or requestsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions