Codex IDE for Emacs is a pure Emacs Codex client, inspired by claude-code-ide.el.
This package provides native integration with codex app-server which, unlike terminal-based wrappers, renders Codex sessions as normal Emacs buffers and keeps the interaction surface fully inside Emacs.
- Runs Codex as an Emacs major mode with no terminal wrapper.
- Renders code blocks with full Emacs major-mode syntax highlighting instead of terminal-style formatting.
- Displays diffs using Emacs diff rendering, so patches look and read like they belong in Emacs, including a canonical session diff buffer that can follow live work or transcript position.
- Turns Codex file and code references into clickable Emacs widgets that jump straight to real buffers.
- Keeps approvals in-buffer with an interactive review flow for confirming commands and changes without leaving the session.
- Lets you expand or collapse transcript detail, so you can skim the headline progress or inspect the full turn-by-turn output.
- Uses MCP integration to give Codex awareness of your live Emacs window and buffer state when that extra context is available.
- Provides an interactive configuration menu for model choice, sandboxing, personality, and other session controls.
- Shows live header-line status for quota and token usage while a session is running.
- Provides a session management mode to preview, search, and restore previous Codex sessions from inside Emacs.
Codex knows what file and region inside Emacs is active.
Run and manage multiple agents at once.
Expand or collapse detail within Codex output
Mode for viewing and restoring past Codex sessions.
- Emacs 28.1 or higher
- Codex CLI installed and available on
PATH transientinstalledpython3andemacsclientavailable if you want the optional Emacs MCP bridge
See the official app-server documentation: OpenAI Codex app-server docs.
To install using use-package with :vc on Emacs 30+:
(use-package codex-ide
:vc (:url "https://github.com/dgillis/emacs-codex-ide" :rev :newest)
:bind ("C-c C-;" . codex-ide-menu))To install using use-package and straight.el:
(use-package codex-ide
:straight (:type git :host github :repo "dgillis/emacs-codex-ide")
:bind ("C-c C-;" . codex-ide-menu))After installation, run M-x codex-ide-menu or M-x codex-ide to start a session for the current project.
Use M-x codex-ide-menu as the main entry point. It opens a transient menu for starting a new session, continuing the most recent session, sending a prompt from the minibuffer, switching to existing buffers, opening buffer lists, and adjusting configuration.
codex-ide-session-mode is the buffer interface to Codex. It renders the conversation transcript, keeps the active prompt editable in-place, streams assistant output, turns file references into links, and handles interruption or approval flows from inside Emacs.
Key bindings:
C-c RETsubmits the active prompt.C-c C-corC-c C-kinterrupts the current response.C-c C-dopens the session diff buffer.C-M-pandC-M-nmove between prompt lines.M-pandM-ncycle prompt history while point is in the active prompt.TABandS-TABmove between clickable buttons and file links.
Codex IDE can show a canonical diff buffer for each session. Open it with
C-c C-d from a session buffer, M-x codex-ide-session-diff-open, or from
M-x codex-ide-menu with the D / Session diff entry.
The session diff buffer is derived from diff-mode, so normal Emacs diff
navigation and font-locking apply. It is tied to one Codex session and reuses a
stable buffer name ending in -session-diff, making it a good companion window
while Codex is editing files.
The buffer has three source states:
live: show the latest or currently running turn diff. Use this while Codex is actively making changes and you want a live view of what is being edited. Incoming file-change updates refresh the buffer automatically.transcript: show the diff for the prompt/response at point in the session transcript. Use this when reviewing earlier turns or comparing what changed at different points in the conversation. Moving point in the session buffer updates the diff buffer when the selected turn changes.pinned: keep showing one selected turn. Use this when you want the diff to stay fixed while you move around the transcript or while newer activity arrives.
Key bindings in codex-ide-session-diff-mode:
grefreshes the diff buffer.lswitches tolive.tswitches totranscript.pswitches topinned.C-c TABtoggles the file diff at point.C-c C-acollapses all file diffs.C-c C-eexpands all file diffs.RETjumps from a diff line to the corresponding source file location when Codex IDE can resolve it.
When a session diff buffer refreshes, Codex IDE preserves the expanded or
collapsed state of existing file and hunk sections. Newly added file sections
start expanded while all existing file sections are expanded; if any existing
file section is collapsed, new file sections start collapsed as well. Customize
codex-ide-diff-new-file-section-fold-predicate to change this policy.
The session diff buffer is separate from static turn diff buffers. Use the session diff when you want an automatically updating view; use a turn-specific diff when you want a snapshot.
context-aware-prompt.mov
buffer-code-links.mov
manage-sessions-mode.mov
This project is licensed under the MIT License.
Codex(R) is a trademark of OpenAI. Codex(R) is an application developed by OpenAI.
This project is not affiliated with, endorsed by, or sponsored by OpenAI.
