codex icon indicating copy to clipboard operation
codex copied to clipboard

IDE-integrated diff / approval

Open yuan763161 opened this issue 3 months ago • 24 comments

What feature would you like to see?

Codex CLI already has a good approval flow: it can show red/green diffs in the terminal and ask the user to approve or reject changes. This works well, but currently it only happens in the terminal.

It would be great to also have this experience directly inside an IDE (e.g. VS Code or Cursor). For example:

Show the diff inline in the IDE’s editor

Let the user approve, approve for session, or reject from there

Then send the decision back so Codex can apply or skip the patch

This would feel much smoother, similar to how CloudCode shows changes inside the editor, instead of switching back to the terminal.

Are you interested in implementing this feature?

Yes — I’d be happy to help prototype an extension that connects Codex approvals into VS Code / Cursor.

Additional information

No response

yuan763161 avatar Aug 31 '25 19:08 yuan763161

Sounds good. I would vote to see it also in a Jetbrains IDE as well

kromacie avatar Sep 01 '25 08:09 kromacie

Is the accept or discard edits API exposed in VScode?

https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode#_accept-or-discard-edits

bhack avatar Sep 04 '25 12:09 bhack

Image Image

It would be great if Codex had a feature to attach the code from the currently viewed file or selected line when sending commands.

This is already supported in Claude Code.

azeek avatar Sep 05 '25 08:09 azeek

Yes, this would be very helpful. I'd like an integration between IDE and Codex CLI (not the VSCode extension) that includes:

  • Sending selected lines in the IDE to the CLI
  • Sharing diagnostics like type and lint errors from IDE to CLI
  • Diff viewing

eugene-kim avatar Sep 12 '25 14:09 eugene-kim

Was going to submit an issue asking for this, specifically for IDE integration that is agnostic.

A good example that I am aware of (and currently use) is https://github.com/stevemolitor/monet which sends diff proposals from Claude Code to an Emacs diff buffer through a websocket connection.

yathxyz avatar Sep 15 '25 07:09 yathxyz

The CC VScode extension has a much better diff viewing experience. It allows you to view the full diff in VScode's diff viewer BEFORE the file is written to disk. Codex only shows a tiny little window with a proposed diff and there is not even a way to expand it to full screen. You have to let it write to disk to use git and/or VSCode diff viewer which is not ideal when you are trying to collaborate and approve each change rather than using full on autonomous mode.

theclunkerjunker avatar Sep 16 '25 16:09 theclunkerjunker

@theclunkerjunker Have you tried clicking "View all changes". That will open a full editor pane with all of the diffs. We will also be iterating on this surface over time.

Image

For the folks who want the CLI <> IDE integration, what do you prefer about the CLI vs using the extension directly?

gpeal avatar Sep 18 '25 17:09 gpeal

Have you tried clicking "View all changes". That will open a full editor pane with all of the diffs

That's the view that we are looking for, but we'd like to be able to see it before accepting or rejecting the proposed changes. Right now the View all changes button to see the full editor diff is only visible after accepting the changes

It's a much nicer experience to be able to see the diff in the full editor view when deciding if the changes should be accepted or rejected. Especially when there are a lot of proposed changes, it's a lot harder to read them in the small chat window. For me it's the number 1 missing feature from Codex compared to Claude Code

swfunc avatar Sep 18 '25 17:09 swfunc

@gpeal @swfunc yes, exactly that. You cannot "view changes" until the files have been written to disk already.

CC has this great workflow I use where it proposes a change, shows me a full diff in the VSCode native diff viewer (not yet written to disk), and allows me to either approve it or "Reject and tell Claude what to do instead". Claude also seems to retain the context of the rejected diff and incorporates it into feedback.

I've yet to be able to replicate this workflow with Codex.

theclunkerjunker avatar Sep 18 '25 17:09 theclunkerjunker

Reject and tell Claude what to do instead

This one I'd also love to have in Codex

swfunc avatar Sep 18 '25 18:09 swfunc

@theclunkerjunker Have you tried clicking "View all changes". That will open a full editor pane with all of the diffs. We will also be iterating on this surface over time.

Image For the folks who want the CLI IDE integration, what do you prefer about the CLI vs using the extension directly?

@gpeal I prefer being able to have Codex in a CLI so that it's in a dedicated screen. This allows me to have maximum real estate for code and my filetree in my main monitor. Viewing the Codex extension means I can't see my file tree. I also find the Codex extension hard to read. If I want to make its text bigger, that zooms everything in, which isn't ideal.

eugene-kim avatar Sep 18 '25 19:09 eugene-kim

The current "View all changes" is a good start, but I find it hard to use in practice.

As mentioned by @bhack the accept or discard edits API offers the best usability in vscode and derivates https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode#_accept-or-discard-edits.

shiroyasha avatar Sep 19 '25 18:09 shiroyasha

But I think that API is not exposed to extensions so probably we need to open a feature request in Vscode repo. /cc @isidorn what do you think?

bhack avatar Sep 19 '25 18:09 bhack

Yes, please open a feature request https://github.com/microsoft/vscode and feel free to ping me @isidorn on it. Thanks 🙏

isidorn avatar Sep 20 '25 03:09 isidorn

@isidorn Please check https://github.com/microsoft/vscode/issues/267581

bhack avatar Sep 20 '25 11:09 bhack

The error appears somewhere, when I run new project with codex extension + vs code

Image

I no longer see the option to view all changes and undo

vatchatyeutoi avatar Sep 21 '25 04:09 vatchatyeutoi

The error appears somewhere, when I run new project with codex extension + vs code

Image I no longer see the option to view all changes and undo

i have same problem, i couldn't see this anywhere

bobbui avatar Sep 22 '25 21:09 bobbui

@theclunkerjunker Have you tried clicking "View all changes". That will open a full editor pane with all of the diffs. We will also be iterating on this surface over time.

Image For the folks who want the CLI IDE integration, what do you prefer about the CLI vs using the extension directly?

Hi. This does not show up in my Codex extension in VS Code. How do I bring it back?

Gian44 avatar Sep 22 '25 22:09 Gian44

@gpeal I prefer being able to have Codex in a CLI so that it's in a dedicated screen. This allows me to have maximum real estate for code and my filetree in my main monitor. Viewing the Codex extension means I can't see my file tree. I also find the Codex extension hard to read. If I want to make its text bigger, that zooms everything in, which isn't ideal.

At least your first part of wanting to see the files and see your chat is easily possible by dragging and dropping Codex to another part of the screen. The multi-monitor and desire to have different zoom levels is still valid. I don't see a way to popout an extension to place on a 2nd monitor and I don't see a way to control any different font sizes other than setting it for both code, file view, and Codex (which is perfectly fine for me, but is still a valid issue).

Image

spotshare-nick avatar Sep 23 '25 03:09 spotshare-nick

Claude Code and Cline seem to have this support for viewing a proposed patch in a readable-sized UI element BEFORE it is made, without requiring some privileged access to vscode or a pending feature. I think this ticket, unlike the one that was closed referencing this one, mixes up a few different requests and issues. For the request to have the ability to see a proposed change before accepting it, in a UI element that can be expanded beyond a few lines worth of space, it seems possible with today's VS code?

jamie-cogitait avatar Sep 25 '25 16:09 jamie-cogitait

This is actually what is needed. I really can't work reliably with codex without this feature. gpt5 still needs a lot of handholding, so being able to have every diff show and be accepted or denied in the IDE would be very helpful. Also having this tight integration between files or text in the IDE that the cli can view.

ReyJ94 avatar Sep 27 '25 10:09 ReyJ94

I think Gemini CLI gets this right, this is what I want (from the Gemini CLI docs):


  • Workspace Context: The CLI automatically gains awareness of your workspace to provide more relevant and accurate responses. This context includes:

    -The 10 most recently accessed files in your workspace.

    • Your active cursor position.
    • Any text you have selected (up to a 16KB limit; longer selections will be truncated).
    • Native Diffing: When Gemini suggests code modifications, you can view the changes directly within your IDE's native diff viewer. This allows you to review, edit, and accept or reject the suggested changes seamlessly.
  • VS Code Commands: You can access Gemini CLI features directly from the VS Code Command Palette (Cmd+Shift+P or Ctrl+Shift+P):

  • Gemini CLI: Run: Starts a new Gemini CLI session in the integrated terminal.

  • Gemini CLI: Accept Diff: Accepts the changes in the active diff editor.

  • Gemini CLI: Close Diff Editor: Rejects the changes and closes the active diff editor.

  • Gemini CLI: View Third-Party Notices: Displays the third-party notices for the extension.

https://github.com/google-gemini/gemini-cli/blob/main/docs/ide-integration/index.md

holgum avatar Oct 02 '25 14:10 holgum

Hello @gpeal

Have you tried clicking "View all changes". That will open a full editor pane with all of the diffs. We will also be iterating on this surface over time.

Viewing the diff after the fact and having the option to undo the changes is not the same as being presented with a diff prior to the edit and having the option to reject the changes and suggest modifications. A rejected diff kept in context followed by a prompt that alters the edits is a very common workflow in other coding agents and for good reason: A proposed diff may be 99% ok but require a single line of code to change to reach an acceptable state.

IDE integration, what do you prefer about the CLI vs using the extension directly?

Can launch multiple CLI instances in different terminals work on various parts of the codebase in parallel each with a unique context.

m4riok avatar Oct 11 '25 19:10 m4riok

Here's an example of how Claude Code handles it, that we would love to see in Codex TUI.

Being able to accept/deny specific changes, by lines/groups of lines, is very helpful when you want to have a bit more control of what is being edited/patched.

Image

BCenzoT avatar Dec 01 '25 18:12 BCenzoT

@gpeal I was about to open a new issue for this, but found this thread and wanted to share here instead. I explored a small experimental macOS-only prototype of this idea and recorded a short demo of the workflow using VS Code’s native diff viewer during patch approval.

https://github.com/user-attachments/assets/d170413f-a03a-4f39-a12e-2dfe93a7fb3c

It would be great to see something along these lines supported in a stable, official way soon!

KaranPradhan266 avatar Dec 07 '25 20:12 KaranPradhan266

I need this very much

eqr avatar Dec 17 '25 17:12 eqr