Edit past messages
Open 💬 20 comments Opened Aug 30, 2025 by archodev
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
It would be nice if past messages could be edited, this would be useful if you make a typo or forgot to add a detail to a message. Specifically for the IDE extension, this would pair nicely with automatically undoing all the way back to where the message you edited is as the undo functionality is already built
20 Comments
This would indeed pair nicely with the recent implementation in the CLI. It would be wonderful if the edit/regen-tree was navigable as well (in both IDE + CLI) bringing the currently-rudimentary branching support up to par with ChatGPT:
<img width="492" height="227" alt="Image" src="https://github.com/user-attachments/assets/00af8271-b28b-4939-bcf1-c2834f5ba00a" />
relevant comment: https://github.com/openai/codex/pull/2898#issuecomment-3237244645
+1
In Codex CLI, you can press
Esctwice to edit messages. Keep hitting it to go up messages, and thenEnterto edit.I also need this function
+1, specifically for wanting to go back and 'restore' a prev conv tree and take it in new direction
Claude Code, for example, has
--fork-session, but the user experience is detached from the chat UI / not very fluid or intuitive. I personally don't find slash commands (eg/fork, along the lines of/undo) to be a great approach to this either.Amp's message editing + forking UX, on the other hand, is on par with ChatGPT web:
<img width="1057" height="413" alt="Image" src="https://github.com/user-attachments/assets/7a211d86-9914-43ce-a8fe-3f0bba0dda05" />
Edit states + forked messages can be returned to by the user at any time, with a spatial thread map for navigation:
https://github.com/user-attachments/assets/ffa57a64-66c4-4fd3-b07c-eecaffc0d62d
(video source)
I once searched for a tool like that a year ago and agree that would be a really really cool and useful addition to the Codex extension!
+1
message edit is currently broken in the CLI
When hitting ESC then Return on the message to edit, it starts a fresh session
It might be caused by the usage of the /review command in the session where it happens
@J3m5, if you think you're seeing a bug, please open a new bug report. This thread is discussing a new feature request.
+1
Keeping accidentally sent past prompts in the thread isn’t just a UX issue—it can degrade model performance, and it can keep Codex from reaching its full potential (_which is unfortunate_), for example:
Also, not only for mistakes: when parts of the thread are no longer needed, being able to go back to an earlier point and keep the conversation clean would help the LLM use its capabilities more effectively.
Therefore, the ability to _edit past messages_ and _branch conversations_ is essential.
I’m really looking forward to this—hope we can get it in soon!
The thread seems to mix two topics (“editing” vs “branching”), so here’s a possible breakdown:
A) Edit last message: quick undo for typos / accidental prompts.
B) Edit older message: rewrite/remove stale content and keep a single clean canonical thread.
C) Branch: fork from an earlier point and continue with an alternative direction.
Capability-wise, C can cover many A/B use-cases by forking from the last correct state (C ⊇ B ⊇ A).
But UX-wise they’re different: editing keeps one canonical thread clean, while branching preserves history and starts a new path. Having both (even a minimal A + C) would address most of the performance/quality issues discussed above.
I often send messages by mistake, so I’d like A as soon as possible.
I also want C. Sometimes I need to explore multiple approaches in parallel, and without branching, Codex tends to be influenced by ideas I’ve already abandoned. Because of that, I reluctantly switch to the ChatGPT web UI (which supports branching and editing) and copy-pasting the discussion back and forth as a workaround (tedious ...).
@etraut-openai ,maintainers,
this thread is titled “Edit past messages,” but the discussion is also expanding into conversation branching(C).
Should we keep this together (broaden scope/title), or track branching in a separate canonical issue?
My guess is they share the same underlying foundation, but from a UX perspective they’re different, and the implementation timeline may differ as well.
One concern: if we bundle A/B/C too tightly, it might delay A, which would be immediately helpful for many of us. Even if we keep the discussion unified, it may still make sense to ship A first and treat branching (C) as a follow-up on its own timeline.
+1
isn't this trivial to implement ?
Is this a business decision to drain token usage , to not implement this?
oh i missed this . somehow hard to use
+1
Even Gemini Code Assisent has this function
You can edit in the MacOS app if you are using ollama. 🤷♂️just not with open ai.
Editing my past messages now seems to work perfectly using open AI models. Also for ollama models so this should be closed. At least for the Mac app.