Skip to content

dgillis/emacs-codex-ide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

254 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codex IDE for Emacs

GNU Emacs 28.1+ License: MIT

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.

Overview

Features

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

Screenshots

Codex mode inside Emacs

Emacs state aware Codex knows what file and region inside Emacs is active.

Run multiple Codex sessions

Multiple codex sessions Run and manage multiple agents at once.

Expandable Codex output

Toggle agent output Expand or collapse detail within Codex output

View and resume prior Codex sessions

Manage past sessions Mode for viewing and restoring past Codex sessions.

Installation

Prerequisites

  • Emacs 28.1 or higher
  • Codex CLI installed and available on PATH
  • transient installed
  • python3 and emacsclient available if you want the optional Emacs MCP bridge

Installing Codex CLI

See the official app-server documentation: OpenAI Codex app-server docs.

Installing the Emacs Package

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.

Getting Started

codex-ide-menu

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.

The main menu is the recommended starting point for everyday Codex IDE commands.

codex-ide-session-mode

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 RET submits the active prompt.
  • C-c C-c or C-c C-k interrupts the current response.
  • C-c C-d opens the session diff buffer.
  • C-M-p and C-M-n move between prompt lines.
  • M-p and M-n cycle prompt history while point is in the active prompt.
  • TAB and S-TAB move between clickable buttons and file links.

Session diff buffer

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:

  • g refreshes the diff buffer.
  • l switches to live.
  • t switches to transcript.
  • p switches to pinned.
  • C-c TAB toggles the file diff at point.
  • C-c C-a collapses all file diffs.
  • C-c C-e expands all file diffs.
  • RET jumps 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.

Examples

Codex session buffer mode

context-aware-prompt.mov
buffer-code-links.mov

Manage sessions mode

manage-sessions-mode.mov

License

This project is licensed under the MIT License.

Disclaimer

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.

About

Codex IDE integration for Emacs

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages