Codex CLI v0.130 Reference: codex remote-control, Multi-Environment view_image, Bedrock AWS-login Auth
# Codex v0.130 (May 8, 2026) adds the codex remote-control entrypoint, multi-environment view_image resolution, Bedrock auth via AWS console-login credentials, app-server thread pagination, plugin-bundled hook visibility with discoverability controls, live config refresh, configurable OpenTelemetry trace metadata, and sandbox hardening on Linux and Windows.
Codex v0.130 (May 8, 2026) adds the codex remote-control entrypoint, multi-environment view_image resolution, Bedrock auth via AWS console-login credentials, app-server thread pagination, plugin-bundled hook visibility with discoverability controls, live config refresh, configurable OpenTelemetry trace metadata, and sandbox hardening on Linux and Windows.
TL;DR: Codex is a multi-surface coding agent that reads your codebase, runs commands in an OS-level sandbox, patches files, and delegates tasks to the cloud. Master five core systems (config.toml, sandbox/approval model, AGENTS.md, MCP, and skills) and Codex becomes a force multiplier. Use profiles for context-switching,
/compactto manage the context budget,/goalfor persisted work goals, and AGENTS.md for cross-tool project instructions that work in Codex, Cursor, Amp, and more. GPT-5.5 (launched April 23, 2026) is the recommended default in Codex — 400K context window in Codex (1M in the API), $5/$30 per MTok, 82.7% Terminal-Bench 2.0 SOTA.83 As of CLI v0.130.0 (May 8, 2026), Codex ships a top-levelcodex remote-controlcommand for headless app-server control, multi-environmentview_imageresolution, Bedrock auth via AWSaws loginconsole-login credentials, app-server thread pagination, plugin-detail visibility for bundled hooks with share-link metadata and discoverability controls, live config refresh on running threads, configurable OpenTelemetry trace metadata, and continued sandbox hardening on Linux and Windows. v0.129.0 (May 7, 2026) added modal Vim editing (/vim), a redesigned workflow picker, an in-TUI/hooksbrowser, a theme-aware status line, plugin workspace sharing with marketplace operations, and a/goallifecycle change. Continue to prefer explicit sandbox/approval flags or permission profiles over legacy--full-auto;js_replremains removed.86878991
Codex operates as a multi-surface coding agent, not a chatbot that writes code. The CLI reads your codebase, executes commands in a sandbox, patches files, connects to external services via MCP, and delegates long-running tasks to the cloud. It runs locally but thinks globally; the same intelligence powers five distinct surfaces depending on how you work, including the new Chrome extension that runs Codex in your browser without taking it over.90
The difference between casual and effective Codex usage comes down to five core systems. Master these and Codex becomes a force multiplier:
- Configuration system: controls behavior via
config.toml - Sandbox & approval model: gates what Codex can do
- AGENTS.md: defines project-level operating contracts
- MCP protocol: extends capabilities to external services
- Skills system: packages reusable domain expertise
I spent months running Codex alongside Claude Code across production codebases, CI/CD pipelines, and team workflows. This guide distills that experience into the complete reference I wish existed when I started. Every feature includes actual syntax, real configuration examples, and the edge cases that trip up experienced users.
Stability note: Features marked
[EXPERIMENTAL]orunder developmentare subject to change between releases. As of v0.130.0 (May 8, 2026), Codex Cloud and code mode remain experimental or under development, while core CLI, sandboxing, AGENTS.md, config.toml, Skills, hooks, multi-agent tools, and plugins are stable surfaces. v0.130.0 adds thecodex remote-controltop-level command (simpler entrypoint for a headless, remotely-controllable app-server), multi-environmentview_imageresolution, Bedrock auth via AWSaws loginconsole-login credentials, app-server thread pagination with unloaded / summary / full turn views, plugin detail visibility for bundled hooks plus share-link metadata and discoverability controls, live app-server config refresh (running threads pick up config changes without restart), removed “research preview” wording from thecodex execstartup banner, configurable OpenTelemetry trace metadata, Linux sandbox startup hardening, and Windows sandbox grant for the desktop runtime binary cache.91 v0.129.0 (May 7, 2026) added modal Vim editing in the composer (/vim+ configurable default-mode), a redesigned TUI workflow picker (easier resume/fork, raw scrollback), the/hooksbrowser, a theme-aware status line with optional PR + branch summaries, plugin workspace sharing + marketplace operations + share access controls + source filtering, a/goallifecycle change (experimental goals stay paused across resume unless opted back in), Linux sandbox startup hardening, Windows sandbox reliability improvements, and a Bubblewrap bump to 0.11.2 with upstream security patches.89 v0.128.0 (April 30, 2026) introduced persisted/goalworkflows,codex update, configurable TUI keymaps, and expanded permission profiles; legacy--full-autoremains deprecated andjs_replremains removed.8687
Key Takeaways
- Five surfaces, one brain: CLI, desktop app, IDE extension, cloud tasks, and the new Chrome extension all share the same GPT-5.x-Codex intelligence, so pick the surface that fits your workflow.90
- OS-level sandboxing: Codex enforces filesystem and network restrictions at the kernel level (Seatbelt on macOS, Landlock + seccomp on Linux), not inside containers.
- AGENTS.md is cross-tool: Your project instructions work in Codex, Cursor, Copilot, Amp, Jules, Gemini CLI, Windsurf, Cline, Aider, Zed, and 60,000+ open source projects. Write once, use everywhere.
- Profiles save context-switching overhead: Define named config presets (
fast,careful,auto) and switch between them with--profile. - Context management matters: GPT-5.4 offers 1M context; GPT-5.4 mini provides 400K for subagent work; GPT-5.3-Codex provides 272K input. Use
/compact, focused prompts, and@filereferences to manage token budgets proactively.
How to Use This Guide
This is a 2,500+ line reference — start where your experience level fits:
| Experience | Start Here | Then Explore |
|---|---|---|
| New to Codex | Installation → Quick Start → Mental Model | Configuration, Sandbox |
| Daily user | AGENTS.md, Skills, Plan Mode | MCP, Hooks |
| Team lead / enterprise | Enterprise Deployment → Best Practices | Decision Frameworks, Workflow Recipes |
| Migrating from another tool | Migration Guide | Decision Frameworks |
The Quick Reference Card at the end provides a scannable summary of all major commands.
How Codex Works: The Mental Model
Before diving into features, understand how Codex’s architecture shapes everything you do with it. The system operates across four surfaces backed by a shared intelligence layer:
┌─────────────────────────────────────────────────────────┐
│ CODEX SURFACES │
├─────────────────────────────────────────────────────────┤
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐ │
│ │ CLI │ │ Desktop │ │ IDE │ │ Cloud │ │
│ │ Terminal │ │ App │ │Extension │ │ Tasks │ │
│ └──────────┘ └──────────┘ └──────────┘ └────────┘ │
│ Local exec Multi-task Editor-native Async │
│ + scripting + worktrees + inline edits detached │
├─────────────────────────────────────────────────────────┤
│ EXTENSION LAYER │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ MCP │ │ Skills │ │ Apps │ │ Search │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ External tools, reusable expertise, ChatGPT │
│ connectors, web search (cached + live) │
├─────────────────────────────────────────────────────────┤
│ SECURITY LAYER │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Sandbox (Seatbelt / Landlock / seccomp) │ │
│ │ + Approval Policy (untrusted → never) │ │
│ └─────────────────────────────────────────────────┘ │
│ OS-level filesystem + network restrictions │
├─────────────────────────────────────────────────────────┤
│ CORE LAYER │
│ ┌─────────────────────────────────────────────────┐ │
│ │ GPT-5.x-Codex Intelligence │ │
│ │ Tools: Shell, Patch, Read, Web Search │ │
│ │ (legacy artifact, read_file, grep_files │ │
│ │ removed in v0.117.0) │ │
│ └─────────────────────────────────────────────────┘ │
│ Shared model across all surfaces; costs tokens │
└─────────────────────────────────────────────────────────┘
Core Layer: The GPT-5.x model family powers everything. As of April 23, 2026, gpt-5.5 is the recommended model when available — 400K context in Codex (1M in the API), 82.7% Terminal-Bench 2.0 SOTA. gpt-5.4 remains the fallback default during rollout (1M context, native computer use).8364 It reads files, writes patches, executes shell commands, and reasons about your codebase. When context fills, Codex compacts the conversation to free space. This layer costs tokens.
Security Layer: Every command Codex runs passes through an OS-level sandbox. On macOS, Apple’s Seatbelt framework enforces kernel-level restrictions. On Linux, Landlock + seccomp filter filesystem and syscall access. The sandbox operates at the kernel level, not inside containers. The approval policy then decides when to ask for human confirmation.
Extension Layer: MCP connects external services (GitHub, Figma, Sentry). Skills package reusable workflows that Codex loads on demand. Apps connect to ChatGPT connectors. Web search adds real-time context from the internet.
Surface Layer: CLI for terminal power users and automation. Desktop app for multi-threaded project management. IDE extension for edit-compile-test loops. Cloud for async tasks that run independently.
The key insight: Most users only use one surface. Power users use all four: Cloud for long-running tasks, CLI for deterministic repo operations, IDE extension for tight coding loops, and the desktop app for planning and coordination.
Table of Contents
- How Do I Install Codex?
- Quick Start: Your First Session
- Core Interaction Surfaces
- Configuration System Deep Dive
- Which Model Should I Choose?
- What Does Codex Cost?
- Decision Frameworks
- How Does the Sandbox & Approval System Work?
- How Does AGENTS.md Work?
- Hooks
- What Is MCP (Model Context Protocol)?
- Code Mode
- JavaScript REPL Runtime
- What Are Skills?
- Plugins
- Plan Mode & Collaboration
- Memory System
- Session Management
- Non-Interactive Mode (codex exec)
- Codex Cloud & Background Tasks
- The Codex Desktop App
- GitHub Action & CI/CD
- Codex SDK
- Performance Optimization
- How Do I Debug Issues?
- Enterprise Deployment
- Best Practices & Anti-Patterns
- Workflow Recipes
- Migration Guide
- Quick Reference Card
- Changelog
- References
How Do I Install Codex?
Package Managers
# npm (recommended)
npm install -g @openai/codex
# Homebrew (macOS)
brew install --cask codex
# winget (Windows)
winget install OpenAI.Codex
# Upgrade to latest
npm install -g @openai/codex@latest
Direct Install Script (v0.106.0+)
For macOS and Linux, a one-line install script is available as a GitHub release asset:60
curl -fsSL https://github.com/openai/codex/releases/latest/download/install.sh | sh
The script auto-detects your platform and architecture, downloads the correct binary, and places it on your PATH.
Binary Downloads
For environments without npm or Homebrew, download platform-specific binaries from GitHub Releases1:
| Platform | Binary |
|---|---|
| macOS Apple Silicon | codex-aarch64-apple-darwin.tar.gz |
| macOS x86_64 | codex-x86_64-apple-darwin.tar.gz |
| Linux x86_64 | codex-x86_64-unknown-linux-musl.tar.gz |
| Linux arm64 | codex-aarch64-unknown-linux-musl.tar.gz |
System Requirements
- macOS: Apple Silicon or Intel (full sandbox support via Seatbelt)
- Linux: x86_64 or arm64 (sandbox via Landlock + seccomp)
- Windows: Native sandbox with restricted tokens (promoted from experimental in v0.100.0). WSL also supported2
Authentication
codex login # Interactive OAuth (recommended)
codex login --device-auth # OAuth device code flow (headless)
codex login --with-api-key # API key from stdin
codex login status # Check auth state (exit 0 = logged in)
codex logout # Clear stored credentials
Two authentication paths:
- ChatGPT Account (recommended): Sign in with your existing Plus, Pro, Team, Business, Edu, or Enterprise subscription. Full feature access including cloud tasks.
- API Key: Set via
CODEX_API_KEYenvironment variable orcodex login --with-api-key. Some features (cloud threads) may be unavailable.
Expert tip: Credential storage is configurable via
cli_auth_credentials_storeinconfig.toml. Options:file(default),keyring(OS keychain), orauto(keyring if available, file fallback).
Shell Completions
# Generate completions for your shell
codex completion bash > /etc/bash_completion.d/codex
codex completion zsh > ~/.zsh/completions/_codex
codex completion fish > ~/.config/fish/completions/codex.fish
Verify Installation
codex --version
# Codex CLI v0.104.0
Quick Start: Your First Session
Get from zero to productive in 5 minutes.
1. Install and authenticate:
npm i -g @openai/codex # Install
codex login # Log in with your OpenAI account
2. Navigate to a project:
cd ~/my-project # Any git repo works
3. Start Codex:
codex
You’ll see the interactive TUI. Codex reads your project structure automatically.
4. Ask a question:
> What does this project do? Summarize the architecture.
Codex reads key files and explains the codebase. No changes are made in the default suggest mode.
5. Make a change:
> Add input validation to the login endpoint
Codex proposes edits as a diff. Review and approve with y, or reject with n.
6. Use a slash command:
> /plan Refactor the database layer to use connection pooling
Codex creates a plan without executing. Review the plan, then approve to begin execution.
7. Check your work:
> /diff
See all changes Codex has made in the current session.
What’s next:
- Set up AGENTS.md with project instructions (see How Does AGENTS.md Work?)
- Configure a profile for your workflow (see Profiles)
- Try codex exec for non-interactive automation (see Non-Interactive Mode)
Core Interaction Surfaces
Codex provides four distinct interfaces backed by the same intelligence. Each surface optimizes for a different workflow pattern.
1. Interactive CLI (Terminal UI)
codex # Launch TUI
codex "fix the failing tests" # Launch with initial prompt
codex -m gpt-5.5 # Specify model
codex --sandbox workspace-write --ask-for-approval on-request
The terminal UI is a full-screen application with:
- Composer: Type prompts, attach files with
@, run shell commands with!prefix - Output pane: Streaming model responses, tool calls, and command output
- Status bar: Model, token usage, git branch, sandbox mode
Key TUI shortcuts:
| Shortcut | Action |
|---|---|
@ |
Fuzzy file search (attach to context) |
!command |
Run shell command directly |
Ctrl+G |
Open external editor ($VISUAL / $EDITOR) |
Ctrl+R |
Reverse history search (v0.121.0+) — readline-style search through prior prompts, including slash commands issued in earlier turns82 |
Enter (while running) |
Inject new instructions mid-turn |
Esc twice |
Edit previous messages |
| Arrow keys | Navigate draft history |
Status line change (v0.121.0): The old context-window meter in the status line has been replaced by a context-percent indicator showing how full your context window is. If you have scripts or hooks parsing the status line, check for this format change.82 Codex will also surface a CLI update announcement when a new version is available.
Slash commands available in the TUI:
| Command | Description |
|---|---|
/quit or /exit |
Exit the CLI |
/new |
Start new conversation in same session |
/resume |
Resume a saved conversation |
/fork |
Fork current conversation into new thread |
/model |
Switch model and reasoning effort |
/compact |
Summarize conversation to free tokens |
/diff |
Show git diff including untracked files |
/review |
Code review of working tree |
/plan |
Enter plan mode |
/goal |
Create, pause, resume, or clear persisted work goals (v0.128.0+). Lifecycle change in v0.129.0: experimental goals now stay paused across resume unless explicitly opted back in. |
/vim |
Toggle modal Vim editing in the composer (v0.129.0+). Configure via TUI keymap settings to set Vim as the default editing mode.89 |
/hooks |
Browse and toggle lifecycle hooks from the TUI (v0.129.0+). Discover available hooks, see which are active, and toggle individual hooks without leaving the session.89 |
/mention |
Attach file to conversation |
/init |
Generate AGENTS.md scaffold |
/status |
Session config and token usage |
/permissions |
Set approval policy |
/personality |
Communication style (friendly/pragmatic/none) |
/mcp |
List configured MCP tools |
/apps |
Browse ChatGPT connectors |
/ps |
Show background terminals |
/skills |
Access and invoke skills |
/plugins |
Browse and manage installed plugins (v0.117.0+); v0.129.0 adds workspace sharing and marketplace operations.89 |
/title |
Set terminal window title (v0.117.0+) |
/config |
Print effective config values and sources |
/statusline |
Configure TUI footer; v0.129.0 adds an optional theme-aware status line with PR + branch-change summaries.89 |
/feedback |
Send logs to Codex maintainers |
/logout |
Sign out |
Workflow picker redesign (v0.129.0): Resume and fork are now easier to reach from a redesigned picker, and a new raw scrollback mode lets you scroll through the unrendered transcript when you need to copy commands or model output verbatim. Useful when triaging a long debugging session or piping output to another tool.89
2. Codex Desktop App (macOS + Windows)
codex app # Launch desktop app (auto-installs if missing)
The desktop app adds capabilities the CLI doesn’t have:
- Multi-tasking: Run multiple parallel agents across different projects simultaneously
- Git worktree isolation: Each thread works on an isolated copy of your repo
- Inline diff review: Stage, revert, and commit changes without leaving the app
- Integrated terminal: Per-thread terminal for running commands
- Conversation forking: Branch conversations to explore alternatives
- Floating pop-out windows: Detach conversations into portable windows
- Automations: Schedule recurring tasks (issue triage, CI monitoring, alert response)
When to use the app vs CLI: Use the desktop app when you’re coordinating multiple workstreams or need visual diff review. Use the CLI when you want terminal composability, scripting, or CI/CD integration.
3. IDE Extension (VS Code, Cursor, Windsurf)
The Codex IDE extension integrates directly into your editor:
- Agent mode by default: Reads files, makes edits, runs commands
- Inline edits: Context-aware suggestions in your active files
- Shared sessions: Sessions sync between CLI and IDE extension
- Same authentication: Sign in with ChatGPT account or API key
Install from the VS Code Marketplace or Cursor/Windsurf extension stores.3
4. Codex Cloud [EXPERIMENTAL]
Cloud tasks run asynchronously in OpenAI-managed environments:
- Fire and forget: Queue tasks that run independently of your local machine
- Parallel execution: Run multiple cloud tasks simultaneously
- PR creation: Codex creates pull requests from completed work
- Local apply: Pull cloud results into your local repo with
codex apply <TASK_ID>
codex cloud list # List recent cloud tasks
codex apply <TASK_ID> # Apply diff from a specific cloud task
Cloud tasks are also accessible from chatgpt.com/codex.4
5. Codex for Chrome [NEW]
Codex ships as a browser extension for Chrome, adding a fifth surface alongside the CLI, desktop app, IDE extension, and cloud. The extension is designed to ride alongside your normal browsing rather than take it over: Codex works in parallel across tabs in the background, and you stay in control of which sites it touches.90
- Parallel tab execution: Codex operates across multiple tabs at once without locking the foreground tab.
- Per-site control: You allow-list which websites Codex can interact with; default is no access.
- Browser as the workbench: The extension is best for app-and-website work where the page is the source of truth — admin consoles, internal dashboards, content-management UIs, ticket systems — not a replacement for the CLI on local repos.
- Same brain: Codex for Chrome runs the same GPT-5.x-Codex intelligence the other surfaces use, so an AGENTS.md or skills configuration that works in the CLI carries the same conventions into browser-driven work.
Install from the Codex Chrome extension docs.90
Configuration System Deep Dive
Codex uses TOML for configuration. Understanding the precedence hierarchy is critical because it determines which settings win when they conflict.
Precedence (Highest to Lowest)
- Session overrides (highest): CLI flags (
--model,--sandbox,--ask-for-approval,--search,--enable/--disable,--profile) and-c key=valueoverrides - Project config (
.codex/config.toml, discovered from CWD upward to project root; closest directory wins) - User config (
$CODEX_HOME/config.toml, defaults to~/.codex/config.toml) - System config (
/etc/codex/config.tomlon Unix) - Built-in defaults (lowest)
requirements.tomlacts as a policy constraint layer that restricts what values users can select after normal config merging. See Enterprise Deployment.
Config File Locations
| Scope | Path | Purpose |
|---|---|---|
| User | ~/.codex/config.toml |
Personal defaults |
| Project | .codex/config.toml |
Per-repo overrides |
| System | /etc/codex/config.toml |
Machine-wide defaults |
| Managed | /etc/codex/requirements.toml |
Admin-enforced policy constraints |
Expert tip: The
CODEX_HOMEenvironment variable overrides the default~/.codexdirectory. Useful for CI/CD or multi-account setups.
Complete Configuration Reference
# ~/.codex/config.toml — annotated reference
# ─── Model Selection ───────────────────────────────────
model = "gpt-5.5" # Recommended model when available
model_provider = "openai" # Provider (openai, oss, or custom provider id)
model_context_window = 272000 # Token count available to active model (override)
model_auto_compact_token_limit = 200000 # Threshold triggering automatic history compaction
model_reasoning_effort = "medium" # minimal|low|medium|high|xhigh (model-dependent)
model_reasoning_summary = "auto" # auto|concise|detailed|none
model_verbosity = "medium" # low|medium|high
personality = "pragmatic" # none|friendly|pragmatic
review_model = "gpt-5.5" # Optional model for /review command
oss_provider = "lmstudio" # lmstudio|ollama (used with --oss)
# ─── Sandbox & Approval ───────────────────────────────
sandbox_mode = "workspace-write" # read-only|workspace-write|danger-full-access
approval_policy = "on-request" # untrusted|on-request|never
[sandbox_workspace_write]
writable_roots = [] # Additional writable paths
network_access = false # Allow outbound network
exclude_tmpdir_env_var = false # Exclude $TMPDIR from sandbox
exclude_slash_tmp = false # Exclude /tmp from sandbox
# ─── Web Search ────────────────────────────────────────
web_search = "live" # Web search mode (constrained by allowed modes)
# ─── Instructions ──────────────────────────────────────
developer_instructions = "" # Additional injected instructions
model_instructions_file = "" # Custom instructions file path
compact_prompt = "" # Custom history compaction prompt
# ─── Shell Environment ─────────────────────────────────
allow_login_shell = false # Allow login shell semantics (loads .profile/.zprofile)
[shell_environment_policy]
inherit = "all" # all|core|none
ignore_default_excludes = false # Set true to keep KEY/SECRET/TOKEN vars
exclude = [] # Glob patterns to exclude
set = {} # Explicit overrides
include_only = [] # Whitelist patterns
# ─── Authentication ────────────────────────────────────
cli_auth_credentials_store = "file" # file|keyring|auto
forced_login_method = "chatgpt" # chatgpt|api
mcp_oauth_callback_port = 0 # Fixed port for MCP OAuth callback (0 = random)
mcp_oauth_credentials_store = "auto" # auto|file|keyring
# ─── History & Storage ─────────────────────────────────
[history]
persistence = "save-all" # save-all|none
max_bytes = 0 # Cap size (0 = unlimited)
tool_output_token_limit = 10000 # Max tokens per tool output
log_dir = "" # Custom log directory
# ─── UI & Display ──────────────────────────────────────
file_opener = "vscode" # vscode|vscode-insiders|windsurf|cursor|none
hide_agent_reasoning = false
show_raw_agent_reasoning = false
check_for_update_on_startup = true
[tui]
notifications = false # Enable notifications
notification_method = "auto" # auto|osc9|bel
animations = true
show_tooltips = true
alternate_screen = "auto" # auto|always|never
status_line = ["model", "context-remaining", "git-branch"]
# ─── Project Trust ─────────────────────────────────────
project_doc_max_bytes = 32768 # Max AGENTS.md size (32 KiB)
project_doc_fallback_filenames = [] # Alternative instruction filenames
project_root_markers = [".git"] # Project root detection
# ─── Feature Flags ─────────────────────────────────────
# Use `codex features list` for current names/stages/defaults.
[features]
shell_tool = true # Shell command execution (stable)
collaboration_modes = true # Plan mode (stable)
personality = true # Personality selection (stable)
request_rule = true # Smart approvals (stable)
unified_exec = true # PTY-backed exec (stable)
shell_snapshot = true # Shell env snapshots (stable)
command_attribution = true # Codex co-author in commits (v0.103.0+)
request_user_input = true # Allow agent to ask clarifying questions in Default mode (v0.106.0+)
multi_agent = false # Enable multi-agent collaboration tools (v0.102.0+)
apply_patch_freeform = false # Expose freeform apply_patch tool
apps = false # ChatGPT Apps/connectors (experimental)
child_agents_md = false # AGENTS.md guidance (experimental)
runtime_metrics = false # Runtime summary in turns
search_tool = false # Enable search_tool_bm25 for Apps discovery
# ─── Multi-Agent Roles (v0.102.0+) ───────────────────
[agents]
max_threads = 4 # Maximum concurrent agent threads
[agents.explorer]
description = "Read-only codebase navigator"
config_file = "~/.codex/profiles/explorer.toml"
# ─── Notifications ────────────────────────────────────
notify = ["terminal-notifier", "-title", "Codex"] # Command for notifications
# ─── Per-Project Overrides ────────────────────────────
[projects."/absolute/path/to/repo"]
trust_level = "trusted" # Per-project trust override
Profiles
Named configuration presets for different work modes:
# Define profiles in ~/.codex/config.toml
[profiles.fast]
model = "gpt-5.1-codex-mini"
model_reasoning_effort = "low"
approval_policy = "on-request"
sandbox_mode = "workspace-write"
personality = "pragmatic"
[profiles.careful]
model = "gpt-5.4"
model_reasoning_effort = "xhigh"
approval_policy = "untrusted"
sandbox_mode = "read-only"
[profiles.auto]
model = "gpt-5.4"
model_reasoning_effort = "medium"
approval_policy = "never"
sandbox_mode = "workspace-write"
Activate a profile:
codex --profile fast "quick refactor"
codex --profile careful "security audit"
codex -p auto "fix CI"
Expert tip: Set a default profile with
profile = "fast"at the top level of your config. Override per-session with--profile.
Custom Model Providers
Connect to Azure, AWS Bedrock, local models, or proxy services:
[model_providers.azure]
name = "Azure OpenAI"
base_url = "https://YOUR_PROJECT.openai.azure.com/openai"
wire_api = "responses"
query_params = { api-version = "2025-04-01-preview" }
env_key = "AZURE_OPENAI_API_KEY"
# Built-in amazon-bedrock provider (v0.123.0+, first-class in v0.124.0+)
# AWS SigV4 signing + credential-based auth; AWS profile selectable via the
# nested `aws.profile` field (NOT a top-level `aws_profile` key).
# v0.130.0+ also accepts credentials from `aws login` (the AWS console-login
# flow) — Codex resolves the cached console-login session for the chosen
# profile if static keys are absent.
[model_providers.amazon-bedrock]
name = "Amazon Bedrock"
[model_providers.amazon-bedrock.aws]
profile = "default" # any profile from ~/.aws/credentials
# Region/credential resolution otherwise follows the standard AWS chain;
# v0.130.0 added support for `aws login` console-login profiles in addition
# to static access keys and IAM role assumption.[^168]
[model_providers.ollama]
name = "Ollama (Local)"
base_url = "http://localhost:11434/v1"
wire_api = "chat"
Warning: The
chat/completionswire API (wire_api = "chat") was deprecated for OpenAI-hosted models, with OpenAI announcing removal in February 2026.34 Local providers (Ollama, LM Studio) may still accept this format. For OpenAI endpoints, usewire_api = "responses"instead.
Use local models with the --oss flag:
codex --oss "explain this function" # Uses default OSS provider
codex --oss --local-provider lmstudio "explain" # Explicit LM Studio
codex --oss --local-provider ollama "explain" # Explicit Ollama
Or set in config:
model_provider = "oss"
oss_provider = "lmstudio" # or "ollama"
Inline Config Overrides
Override any config value from the command line:
codex -c model="gpt-5.5" "refactor the API"
codex -c 'sandbox_workspace_write.network_access=true' "install dependencies"
codex -c model_reasoning_effort="xhigh" "debug the race condition"
Which Model Should I Choose?
Available Models (April 2026)
| Model | Input / Total Context | Default Reasoning | Best For |
|---|---|---|---|
| gpt-5.5 (Codex) | 400K / 400K | medium |
New flagship (April 23, 2026) — 82.7% Terminal-Bench 2.0 SOTA; recommended default for most Codex tasks. In API: 1M context window.83 |
| gpt-5.5-pro | 1M / 1M | high |
Highest-effort tier on GPT-5.5 (April 24, 2026, API-available)83 |
| gpt-5.4 | 1M / 1M | medium |
Prior flagship; kept as default while GPT-5.5 rolls out across surfaces |
| gpt-5.4-mini | 400K / 400K | medium |
Subagent work, simpler tasks — 30% of GPT-5.4 quota, 2x faster76 |
| gpt-5.3-codex | 272K / 400K | medium |
Coding specialist: complex software engineering |
| gpt-5.3-codex-spark | 128K / 128K | high |
Near-instant iteration, text-only (Pro users, Cerebras partnership)67 |
| gpt-5.2-codex | 272K / 400K | medium |
Legacy model; OpenAI lists gpt-5.4 as the substitute for the July 23, 2026 shutdown88 |
| gpt-5.1-codex-mini | 272K / 400K | medium |
Legacy cost-sensitive model; OpenAI lists gpt-5.4-mini as the substitute for the July 23, 2026 shutdown88 |
GPT-5.5 (April 23, 2026) is OpenAI’s recommended choice for most Codex tasks: complex coding, computer use, knowledge work, and research workflows. Available in Codex CLI / web / desktop on April 23 for ChatGPT Plus / Pro / Business / Enterprise / Edu / Go; in the OpenAI API on April 24. Context window: 400K in Codex, 1M in the API — Codex caps the window at 400K to balance throughput and cost across subscriber tiers; the API exposes the full 1M. Pricing (API): $5 input / $30 output per MTok (2× the GPT-5.4 rate; OpenAI states ~20% effective increase after token-efficiency improvements). Benchmarks: 82.7% Terminal-Bench 2.0 (current SOTA across publicly available models), 84.9% GDPval (44 occupations), 78.7% OSWorld-Verified, 98.0% Tau2-bench Telecom (no prompt tuning). OpenAI used GPT-5.5 + Codex internally to rewrite serving infrastructure pre-launch — yielded a 20% boost in token generation speed.83
GPT-5.4 stays available across all Codex surfaces (CLI, app, IDE extension, cloud).64 The exact model list varies by account and rollout. Check your local cache:
~/.codex/models_cache.json.Deprecation note (March 11, 2026): GPT-5.1 models are no longer available in ChatGPT. Existing conversations automatically continue on GPT-5.3 Instant, GPT-5.4 Thinking, or GPT-5.4 Pro. GPT-5.1-Codex-Mini remains available via API and CLI for cost-sensitive workloads.71
Free-tier note (May 5, 2026): GPT-5.5 Instant rolled out to the ChatGPT free tier on May 5, 2026. This widens the audience for the GPT-5.5 family beyond paid plans, though Codex CLI access continues to require an eligible Plus / Pro / Business / Enterprise / Edu / Go subscription or API key.92
GPT-5.4 mini (March 17, 2026): A smaller, faster variant of GPT-5.4 with 400K context at $0.75/$4.50 per MTok — uses only 30% of GPT-5.4 quota. Ideal for subagent delegation: let GPT-5.4 handle planning and coordination while GPT-5.4 mini subagents handle narrower subtasks (codebase search, file review, document processing) in parallel.76
Model Selection Flowchart
Is this a quick fix or simple question?
├─ Yes → gpt-5.1-codex-mini (fastest, cheapest)
└─ No
├─ Do you need real-time pairing speed?
│ ├─ Yes → gpt-5.3-codex-spark (near-instant, Pro only)
│ └─ No
│ ├─ Subagent or parallel subtask (search, review, processing)?
│ │ ├─ Yes → gpt-5.4-mini (30% of GPT-5.4 quota, 2x faster)
│ │ └─ No
│ │ ├─ Pure coding task (refactor, migration, feature build)?
│ │ │ ├─ Yes → gpt-5.3-codex (coding specialist, 272K context)
│ │ │ └─ No → gpt-5.5 (new flagship: 400K context in Codex / 1M in API, 82.7% Terminal-Bench 2.0 SOTA)
└─ Still unsure? → gpt-5.5
Reasoning Effort
Control how much the model “thinks” before responding:
| Level | Behavior | When to Use |
|---|---|---|
minimal |
Minimal reasoning (GPT-5 models only) | Trivial tasks, quick lookups |
low |
Brief reasoning | Standard coding tasks, formatting |
medium |
Balanced (default) | Most development work |
high |
Extended reasoning | Complex bugs, architecture |
xhigh |
Maximum reasoning | Security audits, deep analysis |
Supported levels are model-dependent.
minimalis only available for GPT-5 models. Not all models support every level.
codex -c model_reasoning_effort="xhigh" "find the race condition"
Expert tip:
xhighreasoning can use 3-5x more tokens thanmediumfor the same prompt. Reserve it for genuinely hard problems where the extra thinking pays off.
TUI quick reasoning controls (v0.124.0+).85 In an interactive TUI session, Alt+, lowers reasoning one step and Alt+. raises it one step — useful when a hard problem mid-session warrants a temporary medium → high → xhigh ramp without /effort or -c. When you accept a model upgrade mid-session, reasoning resets to the new model’s default rather than carrying the prior level over.
Model Switching
Switch models mid-session with the /model slash command, or set per-run via --model / -m:
codex -m gpt-5.3-codex-spark "pair with me on this component"
What Does Codex Cost?
See also Model Selection for capabilities and Decision Frameworks for choosing the right model per task.
Access via ChatGPT Plans
Codex availability depends on your ChatGPT plan and organization settings:51
| Plan | Price | Codex Access | Rate Limits (5-hour window) |
|---|---|---|---|
| Free / Go | $0 / $5 | Limited time promotional access | Low |
| Plus | $20/mo | Local CLI + cloud tasks (2x rate limits) | 45-225 local msgs, 10-60 cloud tasks |
| Pro | $200/mo | Priority processing, GPT-5.3-Codex-Spark (2x rate limits) | 300-1500 local msgs, 50-400 cloud tasks |
| Business | $25/user/mo ($20 annual) | Standard seat includes Codex + ChatGPT, SAML SSO | Rate-limited per plan |
| Business (Codex-only seat) | Pay-as-you-go | Token-based billing, no fixed seat fee, no rate limits | Token-based |
| Enterprise / Edu | Contact sales | Custom allocation, admin controls, audit logs, Codex-only seats available | Scales with contract |
| API Key | Usage-based | CLI, SDK, IDE only (no cloud features) | Token-based |
April 2026 pricing update: Business annual pricing dropped from $25 to $20/seat/mo. Codex-only seats with pay-as-you-go pricing are now available for Business and Enterprise workspaces — no fixed seat fee, billed on token consumption.79 Promotional 2x rate limits for paid plans (from the February 2026 Desktop App launch) remain active.16
May 2026 usage limit boost (through May 31, 2026): Codex on the Plus plan runs at a 25× 5-hour limit (vs the standard 20× boost), and the $100/month tier is doubled for the same window. Use this period to push longer cloud-task batches or higher-throughput agent runs without hitting your normal 5-hour wall.89
Credit Costs
Codex operations consume credits from your plan allocation:
| Operation | Approx. Credits | Notes |
|---|---|---|
| Local message (GPT-5.3-Codex) | ~5 | Standard flagship model |
| Local message (GPT-5.1-Codex-Mini) | ~1 | 4x more messages per credit budget |
| Cloud task | ~25 | Runs in OpenAI-managed environment |
| Code review (per PR) | ~25 | Via /review or cloud review |
Enterprise and Edu plans scale credits with contract allocation. Check
/statusin the TUI for current usage.
API Billing
When using Codex through the API, OpenAI bills usage per token under standard OpenAI API pricing for the selected model (plus any applicable prompt-caching discounts). Check the official API pricing page for current rates.20
Cost Optimization Strategies
- Use profiles: Create a
fastprofile withgpt-5.1-codex-miniandmodel_reasoning_effort = "low"for routine tasks - Reserve high reasoning: Only use
xhighfor genuinely hard problems, as it costs 3-5x more tokens - Use
--ephemeral: Skip session persistence in CI/CD to reduce overhead - Minimize reasoning summaries: Set
model_reasoning_summary = "none"when you don’t need explanations - Batch with exec mode:
codex execavoids TUI overhead for automation workflows - Monitor usage: Check
/statusin the TUI and your org billing dashboards
Real-World Cost Examples
Representative API costs for common tasks (gpt-5.3-codex at standard pricing, medium reasoning):
| Task | Input Tokens | Output Tokens | Approx. Cost |
|---|---|---|---|
| Explain a 500-line module | ~15K | ~2K | ~$0.25 |
| Fix a failing test (1-2 files) | ~30K | ~5K | ~$0.50 |
| Add a new API endpoint with tests | ~60K | ~15K | ~$1.10 |
| Refactor auth module (10 files) | ~120K | ~30K | ~$2.25 |
Full repo audit via codex exec |
~200K | ~20K | ~$3.00 |
| Cloud task: triage 20 open issues | ~250K | ~40K | ~$4.50 |
Costs vary by reasoning effort, caching, and conversation length. Use
gpt-5.1-codex-minifor routine tasks to reduce costs by ~40-60%. Cached input tokens are billed at a discount.
Hidden Token Overhead
Every tool call adds tokens beyond your visible prompt:
| Overhead Source | Approx. Cost |
|---|---|
| System prompt + AGENTS.md | ~2-5K tokens per turn (loaded once, cached thereafter) |
| Tool definitions | ~500 tokens per registered tool |
File reads (@file) |
Full file content tokens |
| MCP tool definitions | ~200-500 tokens per connected server |
| Reasoning traces | Variable; xhigh can add 3-5x overhead |
Expert tip: Monitor your actual usage via
/statusin the TUI. The token count includes all overhead, not just your visible messages. If costs surprise you, check how many MCP servers are connected — each adds tool definitions to every API call.
Team Cost Management
| Team Size | Recommended Config | Expected Monthly Cost |
|---|---|---|
| Solo developer | Default model, medium reasoning |
$20-80 |
| Small team (3-5) | Profiles (fast/careful), code reviews via codex exec |
$200-500 |
| Medium team (10-20) | Enterprise plan, requirements.toml limits, CI integration |
$1,000-3,000 |
| Large org (50+) | Enterprise with admin controls, audit logging, allocated budgets | Custom pricing |
Strategies for team cost control:
- Set requirements.toml to enforce model and reasoning effort limits organization-wide
- Use gpt-5.1-codex-mini for CI/CD — automated pipelines rarely need maximum reasoning
- Profile-based budgeting — define ci, review, and dev profiles with appropriate cost ceilings
- Monitor via OpenTelemetry — enterprise deployments can export usage telemetry to existing observability stacks
Decision Frameworks
When to Use Each Surface
| Scenario | Best Surface | Why |
|---|---|---|
| Quick bug fix | CLI | Fast, focused, scriptable |
| Multi-file refactor | CLI or App | CLI for deterministic patches; App for visual diff review |
| Exploring unfamiliar code | CLI | Terminal composability, grep/find integration |
| Parallel workstreams | Desktop App | Worktree isolation, multi-task management |
| Active file editing | IDE Extension | Inline edits, tight compile-test loop |
| Long-running migration | Cloud | Runs independently, creates PR when done |
| CI/CD automation | codex exec |
Non-interactive, JSON output, scriptable |
| Code review | CLI or App | /review command with presets |
| Team onboarding | Desktop App | Visual, guided, less terminal knowledge needed |
When to Use Each Sandbox Mode
| Scenario | Mode | Approval | Why |
|---|---|---|---|
| Exploring unknown code | read-only |
untrusted |
Maximum safety, can’t break anything |
| Daily development | workspace-write |
on-request |
Good balance of speed and safety |
| Trusted automation | workspace-write |
never |
Fast, uninterrupted, sandboxed |
| System administration | danger-full-access |
on-request |
Needs full access but human approval |
| CI/CD pipeline | workspace-write |
never |
Automated, sandboxed to workspace |
When to Use Each Reasoning Level
| Task Type | Reasoning | Model | Profile |
|---|---|---|---|
| Formatting, linting | low |
gpt-5.1-codex-mini |
fast |
| Standard coding | low-medium |
gpt-5.3-codex |
default |
| Complex debugging | high |
gpt-5.3-codex |
careful |
| Security audit | xhigh |
gpt-5.3-codex |
careful |
| Rapid prototyping | low |
gpt-5.3-codex-spark |
fast |
| Migration/refactor | medium-high |
gpt-5.5 or gpt-5.4 |
default |
Plan Mode vs Direct Execution
Will Codex need to change more than 3 files?
│
├── YES → Use Plan Mode (/plan)
│ Codex designs the approach BEFORE making changes.
│ You review and approve the plan.
│ Best for: refactors, new features, migrations
│
└── NO → Is the change well-defined?
│
├── YES → Direct execution
│ Just describe the task. Codex executes immediately.
│ Best for: bug fixes, small features, test additions
│
└── NO → Use Plan Mode (/plan)
Let Codex explore and propose an approach first.
Best for: unfamiliar codebases, ambiguous requirements
Steer Mode: Enter vs Tab
| Situation | Use Enter | Use Tab |
|---|---|---|
| Codex is about to make a mistake | Send correction immediately | |
| You have a follow-up task | Queue it for after current work | |
| Codex picked the wrong file | Send redirect immediately | |
| You want to add scope | Queue the addition | |
| Urgent priority change | Send new priority immediately | |
| Non-critical context | Queue it — no rush |
Rule of thumb: Enter = “stop, listen to this now.” Tab = “when you’re done, also do this.”
Desktop App vs CLI
How do you prefer to work?
│
├── Terminal-first → Use CLI
│ │
│ ├── Single focused task → codex (interactive TUI)
│ ├── Scripted automation → codex exec (non-interactive)
│ └── Quick one-shot → codex exec "prompt" -o result.txt
│
└── Visual/multi-project → Use Desktop App
│
├── Multiple parallel tasks → Multi-thread with worktree isolation
├── Visual diff review → Built-in Git diff viewer
├── Scheduled automation → Automations tab
└── Voice-driven → Ctrl+M for voice dictation
| Capability | CLI | Desktop App |
|---|---|---|
| Interactive sessions | Yes | Yes |
| Parallel agents | Manual (multiple terminals) | Built-in (worktree isolation) |
| Diff review | /diff (text) |
Visual inline diffs |
| Automations | Cron + codex exec |
GUI scheduler |
| Voice input | No | Yes (Ctrl+M) |
| CI/CD integration | codex exec + GitHub Action |
No |
| Session sync | Yes | Yes (shared with CLI) |
Which Profile?
Match your task to a pre-configured profile:
| Task Type | Profile | Key Settings |
|---|---|---|
| Quick questions, formatting | fast |
model = "gpt-5.1-codex-mini", model_reasoning_effort = "low" |
| Daily development | (default) | model = "gpt-5.3-codex", model_reasoning_effort = "medium" |
| Architecture, security | careful |
model = "gpt-5.3-codex", model_reasoning_effort = "xhigh" |
| Real-time pairing | pair |
model = "gpt-5.3-codex-spark", model_reasoning_effort = "high" |
| CI/CD automation | ci |
model = "gpt-5.1-codex-mini", model_reasoning_effort = "low", sandbox_mode = "workspace-write" |
config.toml setup:
# Default profile
profile = "default"
[profiles.fast]
model = "gpt-5.1-codex-mini"
model_reasoning_effort = "low"
[profiles.careful]
model = "gpt-5.3-codex"
model_reasoning_effort = "xhigh"
[profiles.pair]
model = "gpt-5.3-codex-spark"
model_reasoning_effort = "high"
[profiles.ci]
model = "gpt-5.1-codex-mini"
model_reasoning_effort = "low"
sandbox_mode = "workspace-write"
Switch profiles per-session: codex --profile careful
How Does the Sandbox & Approval System Work?
Codex uses a two-layer security model that separates what is technically possible from when Codex asks for human approval. The approach differs fundamentally from Claude Code’s permission system — Codex enforces restrictions at the OS kernel level.5 See also Enterprise Deployment for requirements.toml constraints that administrators enforce organization-wide.
Layer 1: Sandbox (What Is Possible)
The sandbox controls filesystem and network access using OS-native mechanisms:
| Mode | File Access | Network | Implementation |
|---|---|---|---|
read-only |
Read only everywhere | Blocked | Strictest; mutations need explicit approval |
workspace-write |
Read/write in workspace + /tmp |
Blocked by default | Normal development; safe default |
danger-full-access |
Full machine access | Enabled | Maximum capability; use with caution (denylist-only variant removed in v0.121.0 — now binary on/off)82 |
Platform-specific enforcement:
- macOS: Apple’s Seatbelt framework via
sandbox-execwith mode-specific profiles compiled at runtime and enforced by the kernel6. As of v0.121.0, macOS sandbox profiles can allowlist specific Unix sockets (e.g.,docker.sock, editor IPC sockets) and private DNS resolution is no longer blocked by default.82 - Linux: Landlock for filesystem restrictions + seccomp for syscall filtering. A standalone helper process (
codex-linux-sandbox) provides defense-in-depth isolation.5 Bubblewrap (bwrap) is vendored and compiled as part of the Linux build (promoted from optional in v0.100.0)7. v0.117.0 improved sandbox reliability on older distros with legacy kernel configurations.75 v0.129.0 hardened sandbox startup on Linux and bumped vendored Bubblewrap to 0.11.2 with upstream security patches; v0.130.0 added further startup hardening.8991 - Windows: Native sandbox with restricted tokens (promoted from experimental in v0.100.0). WSL also supported (inherits Linux Landlock + seccomp). v0.117.0 includes restricted-token sandbox improvements for better process isolation.75 v0.130.0 grants sandbox users access to the desktop runtime binary cache so that the Windows sandbox can resolve runtime binaries reliably for workspace-sandbox users.91
Why this matters: Unlike container-based sandboxing (Docker), OS-level sandboxing is faster, lighter, and harder to escape. The kernel enforces restrictions before Codex even sees the system call.
Security fixes:
- zsh-fork sandbox bypass (v0.106.0): Fixed a vulnerability where shell execution via zsh forking could bypass sandbox restrictions.60 If you are on an earlier version, upgrade immediately.
- Input size cap (v0.106.0): Codex now enforces an approximately 1-million-character input cap to prevent hangs from excessively large payloads.60
- Secure devcontainer profile (v0.121.0): A new hardened customer profile for Docker devcontainers uses Bubblewrap for sandboxing inside the container. WSL2 is supported; WSL1 is explicitly rejected (Bubblewrap is incompatible with WSL1’s kernel shim).82
- Guardian review + hooks (v0.121.0): Hooks are disabled during Guardian review sessions so pre/post-tool hooks cannot interfere with the Guardian subagent’s decisions.82 If you rely on hooks for logging or validation, be aware that a Guardian review skips them — fall back on app-server observability if you need a full audit trail.
- Linux /dev filesystem (v0.105.0): Sandboxed commands on Linux now receive a minimal /dev filesystem, improving compatibility with tools that expect device nodes.61
ReadOnlyAccess policy (v0.100.0+): A configurable policy shape for granular read access control. Use it to restrict which directories Codex can read from, even in workspace-write mode:
[sandbox_workspace_write]
read_only_access = ["/etc", "/usr/local/share"] # Only these paths readable outside workspace
Layer 2: Approval Policy (When To Ask)
The approval policy determines when Codex pauses to ask for human confirmation:
| Policy | Behavior | Use Case |
|---|---|---|
untrusted |
Auto-runs safe reads; prompts for everything else | Highest trust barrier; unfamiliar repos |
on-request |
Approves within sandbox; prompts for boundary violations | Default; good balance |
never |
No prompts whatsoever | CI/CD, trusted automation |
on-failure still appears in some older examples and compatibility paths, but current OpenAI configuration docs mark it deprecated. Prefer on-request for interactive runs and never for non-interactive runs that already have an external safety boundary.87
Distinct Approval IDs (v0.104.0+)
Codex now assigns distinct approval IDs to each command within a multi-step shell execution. This means approvals are granular — approving one command in a sequence doesn’t automatically approve subsequent ones in the same shell invocation.49
Flexible Approval Controls (v0.105.0+)
The approval flow now supports extra sandbox permissions and granular rejection:61
- Extra sandbox permissions: When a command needs access beyond the current sandbox mode, Codex can request specific additional permissions rather than requiring a full mode change
- Granular rejection: Reject individual tool calls with feedback so Codex can adjust its approach rather than simply re-attempting the same command
Runtime Permission Requests (v0.113.0+)
Codex now includes a built-in request_permissions tool that allows the model to request additional permissions at runtime.69 When the model encounters a task requiring elevated access, it can formally request specific permissions (filesystem paths, network access, etc.) through the TUI approval flow rather than failing silently or requiring the user to restart with different flags.
Permission Profiles (v0.113.0+, expanded in v0.128.0)
Permission profiles split filesystem and network sandbox policies into named, reusable sections. Set default_permissions to a built-in profile such as :read-only, :workspace, or :danger-no-sandbox, or point it at a custom [permissions.<name>] table.87
default_permissions = "project-safe"
[permissions.project-safe.filesystem]
"/usr/local" = "read"
glob_scan_max_depth = 3
[permissions.project-safe.filesystem.":project_roots"]
"." = "write"
"**/*.env" = "none"
[permissions.project-safe.network]
enabled = true
mode = "limited"
[permissions.project-safe.network.domains]
"api.github.com" = "allow"
"registry.npmjs.org" = "allow"
Use none for sensitive files and globs that should be unreadable even when the project root is writable. For one-off command exceptions, prefer rules over broadly expanding a profile.87
Legacy --full-auto Guidance
Older guides described --full-auto as a convenience alias for:
codex --sandbox workspace-write --ask-for-approval on-request
In v0.128.0, release notes mark --full-auto deprecated, and current CLI help no longer lists it for interactive runs. Use the explicit flags above or a named permissions profile instead.86
Sandbox reliability (v0.129.0): Linux sandbox startup hardening reduces races on slow filesystems or symlinked checkouts; Windows sandbox reliability improvements address several edge-case crashes during long-running runs; and the vendored Bubblewrap is bumped to 0.11.2 with upstream security patches. No config changes required. Run
codex updateto pick these up.89
Recommended Configurations
Daily development (safe default):
sandbox_mode = "workspace-write"
approval_policy = "on-request"
Power user (full access, human-in-the-loop):
sandbox_mode = "danger-full-access"
approval_policy = "untrusted"
The combination is the community-recommended “sweet spot”: maximum capability but approval required for every command.8
CI/CD automation:
sandbox_mode = "workspace-write"
approval_policy = "never"
Smart Approvals with Guardian Subagent (v0.115.0+)
Smart Approvals can route review requests through a guardian subagent instead of requiring human approval for every action. The guardian session persists across approvals to reuse prompt cache and avoid startup overhead. Each review gets a clean history (prior decisions don’t leak into later reviews).73
Configure the reviewer in config.toml:
approvals_reviewer = "guardian_subagent" # "user" (default) or "guardian_subagent"
This is particularly useful for CI/CD workflows where you want automated review with reasoning rather than blanket approval_policy = "never".
Enabling Network Access
Codex blocks network access by default in workspace-write mode. Enable it when needed:
# Per-run
codex -c 'sandbox_workspace_write.network_access=true' "install the packages"
# In config.toml
[sandbox_workspace_write]
network_access = true
writable_roots = ["/path/to/extra/dir"] # Additional writable directories
exclude_slash_tmp = false # Prevent /tmp from being writable
exclude_tmpdir_env_var = false # Prevent $TMPDIR from being writable
WebSocket Proxy Support (v0.104.0+)
For corporate environments that route WebSocket traffic through a proxy, Codex now supports WS_PROXY and WSS_PROXY environment variables:49
export WSS_PROXY="https://proxy.corp.example.com:8443"
codex "update the README"
These complement the existing HTTPS_PROXY and SOCKS5 proxy support (v0.93.0+), covering all transport layers.
Testing the Sandbox
Verify sandbox behavior before trusting it:
codex sandbox macos --permissions-profile :workspace -- ls /etc/passwd # macOS test
codex sandbox linux --permissions-profile :workspace -- cat /etc/shadow # Linux test
If the sandbox is working correctly, both commands should fail with a permission denied error under a workspace-scoped profile. If either command succeeds, your sandbox configuration needs investigation.
How Does AGENTS.md Work?
AGENTS.md is Codex’s project instruction system — an open standard9 now governed by the Linux Foundation’s Agentic AI Foundation. Supported by Codex, Cursor, Copilot, Amp, Jules (Google), Gemini CLI, Windsurf, Cline, Aider, Zed, Factory, RooCode, and 60,000+ open source projects. It defines how Codex behaves within a specific repository or directory. See Skills for reusable expertise packages that complement AGENTS.md.
Discovery Hierarchy
Codex builds an instruction chain at session start by walking the directory tree:
- Global (
~/.codex/):AGENTS.override.md>AGENTS.md - Project (git root to current directory): Each level checked for
AGENTS.override.md>AGENTS.md> fallback filenames - Merging: Files concatenate root-down; closer files appear later in the prompt and override earlier guidance
~/.codex/AGENTS.md ← Global defaults
└─ /repo/AGENTS.md ← Project-wide rules
└─ /repo/services/AGENTS.md ← Service-specific rules
└─ /repo/services/payments/
AGENTS.override.md ← Overrides everything above for this dir
What Makes a Great AGENTS.md
Based on direct guidance from Codex itself and community patterns10:
DO:
- Be specific: "Use rg --files for discovery" beats "search efficiently"
- Define closure: What does “done” mean? (tests pass, lint clean, etc.)
- Include commands: Build, test, lint, format (exact invocations)
- Organize by task: Coding, review, release, incident/debug sections
- Define escalation: What to do when blocked or encountering unexpected state
DON’T: - Dump entire style guides without execution rules - Use ambiguous directives (“be careful,” “optimize”) - Mix contradictory priorities (speed + exhaustive verification + no runtime budget) - Write prose documentation (AGENTS.md is operational policy, not README)
Example: Production AGENTS.md
# Repository Guidelines
## Build, Test, and Development Commands
- Run API (dev): `python3 -m uvicorn main:app --reload`
- Install deps: `pip install -r requirements.txt`
- Lint: `python3 -m ruff check .` (auto-fix: `--fix`)
- Format: `python3 -m ruff format .`
- Tests: `python3 -m pytest -v`
- Coverage: `python3 -m pytest --cov=app --cov-report=term-missing`
## Coding Style & Naming Conventions
- Python 3.11+. Type hints on all functions.
- Ruff enforced: 88-char lines, double quotes, spaces for indent.
- Naming: modules `snake_case.py`, classes `PascalCase`, functions `snake_case`.
## Commit & Pull Request Guidelines
- Conventional Commits: `feat:`, `fix:`, `docs:`, `refactor:`, `chore:`, `test:`
- Commits should be small and focused.
- PRs must include: description, test plan, and screenshots for UI changes.
## Security
- Never commit secrets. Use `.env` for local config.
- Validate all external API calls with proper error handling.
The Override Mechanism
AGENTS.override.md at any directory level replaces the normal AGENTS.md for that scope. Use for:
- Release freezes: “No new features, fixes only”
- Incident mode: “All changes must be reviewed by on-call”
- Temporary hardening: “No dependency updates this sprint”
Configuration
# Custom fallback filenames (in addition to AGENTS.md)
project_doc_fallback_filenames = ["TEAM_GUIDE.md", ".agents.md"]
# Increase max size for large instruction files
project_doc_max_bytes = 65536 # 64 KiB (default: 32 KiB)
Scaffold Generation
codex # Launch TUI
/init # Generate AGENTS.md scaffold
Or verify your instruction chain:
codex --ask-for-approval never "Summarize your current instructions"
Hooks
Codex introduced hooks in v0.99.0 (AfterAgent) and v0.100.0 (AfterToolUse), then added an experimental hooks engine in v0.114.0 with SessionStart and Stop events.70 As of v0.124.0 (April 23, 2026), hooks are stable.85 They are now configurable inline in config.toml and requirements.toml — no more separate hook scripts file required — and they observe MCP tools alongside apply_patch and long-running Bash sessions. The system now covers session lifecycle and tool-level automation, closing the gap with Claude Code’s hook model.
Available Hook Events
| Event | When It Fires | Added |
|---|---|---|
SessionStart |
Once at the beginning of a session; hook stdout is injected as startup context before the first turn | v0.114.0 [EXPERIMENTAL] |
Stop |
When the session ends | v0.114.0 [EXPERIMENTAL] |
AfterAgent |
After the agent finishes a complete turn | v0.99.0 |
AfterToolUse |
After each individual tool call completes | v0.100.0 |
UserPromptSubmit |
Before a user prompt is executed; can block or augment the prompt before it enters history | v0.116.0 [EXPERIMENTAL] |
Hook Configuration
Hooks are configured in .codex/config.toml:
[[hooks]]
event = "AfterToolUse"
command = "echo 'Tool completed' >> /tmp/codex-log.txt"
[[hooks]]
event = "SessionStart"
command = "echo 'Current date: $(date +%Y-%m-%d)'"
The SessionStart hook’s stdout feeds into the model’s context, making it ideal for injecting dynamic information (dates, branch names, environment variables) at session start.
Replicating Claude Code Hook Patterns
If migrating from Claude Code, here’s how to achieve similar automation:
| Claude Code Pattern | Codex Alternative |
|---|---|
PreToolUse file blocking |
AGENTS.md instructions + sandbox read-only mode |
PostToolUse linting |
AfterToolUse hook running your linter |
SessionStart context injection |
SessionStart hook (v0.114.0) with stdout injection |
Stop notification |
Stop hook (v0.114.0) with notification command |
SubagentStop notification |
AfterAgent hook with notification script |
| Async hooks | Not yet supported; use Cloud tasks for background work |
Expert tip: As of v0.124.0 (April 23, 2026) the hooks engine is stable. New hook events still ship in releases — check the Codex changelog.
In-TUI hook browser (v0.129.0): Run
/hooksin the TUI to discover available hooks, see which are currently active, and toggle individual hooks without editingconfig.toml. Useful when troubleshooting a misbehaving plugin-bundled hook or temporarily disabling anAfterToolUselinter for a heads-down editing session.89
What Is MCP (Model Context Protocol)? [EXPERIMENTAL]
MCP extends Codex’s capabilities by connecting to external tools and services. The codex mcp command group is currently marked experimental, and commands and config format may change between releases. Codex supports two transport types: STDIO (local processes) and Streamable HTTP (remote servers).11
v0.121.0 MCP changes: Tools are now registered with a namespace, so tool names in listings appear as
<server>:<tool>rather than bare names — update any scripts or prompts that grep against unqualified tool names. A newsupports_parallel_tool_callsflag is plumbed through to included MCPs, enabling parallel execution for servers that declare support. Sandbox-state metadata now flows through MCP tool metadata so servers can adapt behavior (e.g., warn if running under a read-only sandbox). The customcodex/sandbox-staterequest has been removed — use the metadata path instead. Phase 3 of the MCP Apps rollout lands here with tool-call support; flattened deferred tool calls are now supported for servers using the deferred-call pattern.82
Configuring MCP Servers
STDIO servers (local processes):
# In ~/.codex/config.toml or .codex/config.toml
[mcp_servers.context7]
enabled = true
required = true # Fail startup if unavailable
command = "npx"
args = ["-y", "@upstash/context7-mcp"]
env = { "MY_VAR" = "value" } # Static env vars
env_vars = ["PATH", "HOME"] # Forward host env vars
cwd = "/path/to/project" # Optional working directory
startup_timeout_sec = 10
tool_timeout_sec = 60
enabled_tools = ["search", "summarize"] # Tool allowlist
disabled_tools = ["slow-tool"] # Tool denylist
HTTP servers (remote):
[mcp_servers.figma]
enabled = true
url = "https://mcp.figma.com/mcp"
bearer_token_env_var = "FIGMA_OAUTH_TOKEN"
http_headers = { "X-Figma-Region" = "us-east-1" }
env_http_headers = { "X-Org-Id" = "FIGMA_ORG_ID" } # Headers from env vars
startup_timeout_sec = 10
tool_timeout_sec = 60
CLI Management
codex mcp add context7 -- npx -y @upstash/context7-mcp
codex mcp add context7 --env API_KEY=... -- npx -y @upstash/context7-mcp # With env vars
codex mcp add figma --url https://mcp.figma.com/mcp --bearer-token-env-var FIGMA_OAUTH_TOKEN
codex mcp list # List all configured servers
codex mcp list --json # JSON output
codex mcp get context7 # Show server config
codex mcp get context7 --json # JSON output
codex mcp login <server> # OAuth flow for HTTP servers
codex mcp logout <server> # Remove OAuth credentials
codex mcp remove <server> # Delete server definition
In-session: /mcp shows active servers and available tools. /mcp verbose (v0.123.0+)84 returns full server diagnostics, resources, and resource templates — useful when a server is failing to load or tools aren’t appearing where expected. Plain /mcp stays fast.
Plugin MCP loading (v0.123.0+) accepts both the standard mcpServers schema and top-level server maps in .mcp.json, so plugins authored against either convention load cleanly.84
Running Codex AS an MCP Server
Codex can expose itself as an MCP server for multi-agent orchestration:12
codex mcp-server # Start as MCP server (stdio transport)
The server exposes two tools:
1. codex(): Start a new session with prompt, sandbox, model, and approval parameters
2. codex-reply(): Continue an existing session with threadId and prompt
Use with the Agents SDK (Python):
from agents import Agent, Runner
from agents.mcp import MCPServerStdio
async with MCPServerStdio(
name="Codex CLI",
params={"command": "npx", "args": ["-y", "codex", "mcp-server"]},
client_session_timeout_seconds=360000,
) as codex_mcp_server:
agent = Agent(name="Developer", mcp_servers=[codex_mcp_server])
result = await Runner.run(agent, "Fix the failing tests")
Notable MCP Servers
| Server | Purpose | Install |
|---|---|---|
| Context7 | Up-to-date library docs | npx -y @upstash/context7-mcp |
| Figma | Design file access | HTTP: https://mcp.figma.com/mcp |
| Playwright | Browser automation | npx -y @anthropic/mcp-playwright |
| Sentry | Error monitoring | HTTP: https://mcp.sentry.dev/mcp |
| GitHub | Repository operations | npx -y @anthropic/mcp-github |
Practical Patterns
Pattern 1: Context-aware development — Pair Context7 with your framework docs so Codex always has current API references:
[mcp_servers.context7]
enabled = true
required = true
command = "npx"
args = ["-y", "@upstash/context7-mcp"]
Pattern 2: Output limits — MCP tool responses are truncated at ~25K characters by default. For tools that return large payloads (database queries, log captures), use enabled_tools to restrict to specific tools and keep responses focused.
Pattern 2a: Multimodal tool output (v0.107.0) — Custom tools can now return multimodal output (images, rich content) alongside text. This enables tools that produce visual artifacts — screenshots, diagrams, chart renders — to pass them directly to the model for analysis.62
Pattern 3: Enterprise MCP governance — Lock down which MCP servers developers can use via requirements.toml:
# In /etc/codex/requirements.toml — only approved servers allowed
[mcp_servers.approved-internal]
identity = { command = "npx @company/internal-mcp" }
Any server not matching an identity in requirements.toml will be blocked at startup. See Enterprise Deployment for full policy configuration.
Code Mode [EXPERIMENTAL]
Code mode (v0.114.0) provides more isolated coding workflows by restricting the agent’s scope to code-focused operations.70 When enabled, the agent focuses on reading, writing, and testing code without broader system interactions.
This feature is experimental. Check release notes for updates.
JavaScript REPL Runtime [REMOVED]
Codex v0.100.0 added an experimental JavaScript REPL runtime (js_repl) and v0.106.0 promoted it through the /experimental surface.60 That guidance is now historical. In v0.128.0, the release changelog includes “Remove js_repl feature,” and the current feature list marks both js_repl and js_repl_tools_only as removed.86
Do not add features.js_repl = true to new configs. Use shell commands, checked-in scripts, MCP tools, or a Codex skill with a scripts/ directory when you need repeatable executable logic.
What Are Skills?
Skills are reusable, task-specific capability packages that Codex loads on demand. They follow the open agent skills standard.13
Skill Structure
my-skill/
SKILL.md (required: instructions)
scripts/ (optional: executable scripts)
references/ (optional: reference docs)
assets/ (optional: images, icons)
agents/openai.yaml (optional: metadata, UI, dependencies)
Discovery Locations
Codex stores user-installed skills in $CODEX_HOME/skills (default: ~/.codex/skills), including built-in system skills under .system/. Codex supports symlinked skill folders.
| Scope | Path |
|---|---|
| Project/team | Repository skill folders (layout may vary by version) |
| User | ~/.codex/skills/ (or $CODEX_HOME/skills/) |
| Admin | /etc/codex/skills/ |
| System | Bundled by OpenAI (under ~/.codex/skills/.system/) |
Creating a Skill
SKILL.md format:
---
name: security-audit
description: Run a thorough security audit on the codebase.
---
## Security Audit Procedure
1. Scan for hardcoded secrets using `rg -i "(api_key|password|secret|token)\s*=" --type py`
2. Check for SQL injection: look for string interpolation in queries
3. Verify input validation on all API endpoints
4. Check dependency vulnerabilities: `pip audit` or `npm audit`
5. Review authentication and authorization patterns
6. Report findings with severity levels (Critical/High/Medium/Low)
Metadata (agents/openai.yaml):
interface:
display_name: "Security Audit"
short_description: "Full codebase security review"
icon_small: "./assets/shield.svg"
brand_color: "#DC2626"
default_prompt: "Run a security audit on this repository"
policy:
allow_implicit_invocation: false # Require explicit $skill
dependencies:
tools:
- type: "mcp"
value: "snyk"
transport: "streamable_http"
url: "https://mcp.snyk.io/mcp"
Invoking Skills
- Explicit:
/skillsmenu or$skill-namemention in prompt - Implicit: Codex auto-detects matching skills from task description (if
allow_implicit_invocation: true) - Creator: Use
$skill-creatorto interactively build a new skill - Installer: Use
$skill-installer install <name>to install community skills
Enable/Disable
[[skills.config]]
path = "/path/to/skill/SKILL.md"
enabled = false
Skills vs Slash Commands
| Skills | Slash Commands | |
|---|---|---|
| Defined in | SKILL.md files with optional metadata |
Built into Codex CLI binary |
| Scope | Project, user, or admin level | Global (always available) |
| Invocation | $skill-name in prompt, /skills menu, or implicit detection |
/command syntax |
| Customizable | Fully — you write the instructions | Fixed behavior |
| Dependencies | Can declare MCP server requirements | None |
| Sharing | Copy skill folder to team repo or ~/.codex/skills/ |
Not shareable |
Debugging Skills
If a skill isn’t activating:
- Check discovery:
/skillsshould list it in the TUI - Verify path: Ensure the skill folder is in a recognized location (
~/.codex/skills/, project root, or/etc/codex/skills/) - Check
enabled: Skills withenabled = falsein config.toml won’t load - Check implicit activation: If relying on auto-detection, ensure
allow_implicit_invocation: trueinagents/openai.yaml - Use keywords: Include the skill’s
descriptionterms in your prompt to improve implicit matching
Production Example: Deploy Skill
A complete multi-file skill showing references and scripts working together:
deploy-skill/
SKILL.md
references/
runbook.md
rollback-checklist.md
scripts/
pre-deploy-check.sh
smoke-test.sh
agents/openai.yaml
SKILL.md:
---
name: deploy
description: Deploy the application to staging or production. Runs pre-flight checks, executes deployment, and verifies with smoke tests.
---
## Deployment Procedure
### Pre-flight
1. Run `scripts/pre-deploy-check.sh` to verify:
- All tests pass
- No uncommitted changes
- Branch is up to date with remote
2. Review the runbook at `references/runbook.md` for environment-specific steps.
### Deploy
3. Execute the deployment command for the target environment.
4. Monitor logs for errors during rollout.
### Verify
5. Run `scripts/smoke-test.sh <environment-url>` to confirm critical paths.
6. If smoke tests fail, follow `references/rollback-checklist.md`.
Invoke with: $deploy to staging or $deploy production with canary rollout
Plugins
Plugins unify skills, MCP entries, hooks, and app connectors into a single installable package (v0.110.0+).65 As of v0.117.0, plugins are first-class citizens: product-scoped plugins sync automatically at startup and /plugins provides an in-TUI browser for discovery and management.75 v0.128.0 expanded plugin workflows with marketplace installation, remote bundle caching, remote uninstall APIs, plugin-bundled hooks, hook enablement state, and external-agent config import.86 v0.129.0 (May 7, 2026) adds plugin workspace sharing (push a plugin set to teammates without re-publishing), share access controls (per-recipient enable/disable, revoke), source filtering (limit which marketplaces a workspace pulls from), and marketplace operations that can be invoked directly from the /plugins browser instead of the CLI.89 v0.130.0 (May 8, 2026) makes plugin packaging more transparent and the share workflow more controllable:91
- Bundled hooks visible in plugin details. The
/pluginsdetail view now lists every lifecycle hook a plugin bundles (SessionStart,UserPromptSubmit,Stop, etc.). Before installing a plugin, you can see exactly which hooks it will register against your session — no more surprise hook side effects from a plugin you trust on its tools alone. - Plugin share metadata in
shareContext. When a plugin is shared from a workspace, the share-link payload now exposes link metadata (creator, scope, freshness) so receiving sessions can show provenance and decide whether to accept. - Discoverability controls on share settings. Share settings expose a discoverability toggle so teams can publish plugins to specific workspaces or recipient lists without making them generally listable across an organization.
Plugin Sources
| Source | Location | Description |
|---|---|---|
| Config | config.toml |
Manually declared plugins |
| Local marketplace | marketplace.json |
Project-local plugin catalog |
| Install endpoint | App server v2 | Remote plugin installation |
| Product-scoped | Synced at startup | Automatically synchronized plugins (v0.117.0+) |
Plugin Discovery
Codex tells the model which plugins are enabled at session start (v0.111.0), improving discovery of installed MCPs, apps, and skills.65 The model can suggest relevant plugins during a session based on the task context. In v0.117.0, product-scoped plugins are synced at startup, ensuring the latest plugin catalog is available without manual intervention.75
@plugin Mentions (v0.112.0+)
Reference any installed plugin directly in chat with @plugin-name.68 When you mention a plugin, its context (capabilities, tools, configuration) is automatically included in the model’s context window — no need to describe what the plugin does.
@deploy push this branch to staging with canary rollout
@linter check for unused imports in src/
This works with any installed plugin, including custom skills, MCP servers, and app connectors.
Plugin Marketplace (v0.113.0+)
The plugin marketplace now includes richer discovery with metadata, categories, and ratings.69 Install-time auth checks verify that plugins requiring API keys or OAuth have valid credentials before installation. An uninstall endpoint cleanly removes plugins and their associated configuration.
Adding Third-Party Marketplaces (v0.121.0+)
As of current CLI v0.128.0, marketplace source management lives under codex plugin marketplace. This formalizes third-party plugin distribution beyond OpenAI’s first-party marketplace and supports GitHub repo shorthand, HTTP(S) Git URLs, SSH URLs, and local marketplace root directories.86
# GitHub repository (shorthand)
codex plugin marketplace add owner/repo
# Arbitrary git URL
codex plugin marketplace add https://git.example.com/team/plugins.git
# SSH Git URL
codex plugin marketplace add [email protected]:team/plugins.git
# Local directory
codex plugin marketplace add /path/to/local/marketplace
# Upgrade or remove a configured marketplace
codex plugin marketplace upgrade <marketplace-name>
codex plugin marketplace remove <marketplace-name>
Once added, a marketplace’s plugins appear in the /plugins browser alongside the default ones. App-server callers (IDE/desktop integrations) have a parallel endpoint to register marketplaces programmatically.82
Security consideration: Third-party marketplaces run arbitrary plugin code with your Codex permissions. Vet sources before adding them, and prefer sandboxed execution during first runs.
Managing Plugins
codex plugin marketplace add <src> # Add a marketplace source
codex plugin marketplace upgrade [name] # Upgrade one marketplace or all
codex plugin marketplace remove <name> # Remove a configured marketplace
In the TUI, use /plugins (v0.117.0+) to browse, install, and remove individual plugins interactively without leaving your session.75
Expert tip: Plugins consolidate what used to require separate MCP config, skill installation, and app connector setup. A single plugin can bundle all three — making team onboarding faster and configuration more portable.
Plan Mode & Collaboration
Plan mode lets Codex design an approach before executing changes. It’s enabled by default (since v0.94.0).14 See Decision Frameworks for the “Plan Mode vs Direct Execution” decision tree.
Entering Plan Mode
/plan # Switch to plan mode
/plan "redesign the API layer" # Plan mode with initial prompt
In plan mode, Codex: - Reads files and analyzes the codebase - Proposes an implementation plan - Does not make changes until you approve - Streams the plan in a dedicated TUI view
Steer Mode
Steer mode (enabled by default since v0.98.0) allows you to inject new instructions while Codex is actively working, without interrupting its current task.14
There are two injection methods:
| Input | Behavior | When to Use |
|---|---|---|
| Enter | Sends instructions immediately; Codex sees them during the current turn | Urgent corrections (“stop — don’t modify that file”), clarifications (“the config is in /etc/app.conf, not the default path”), or priority changes (“focus on the tests first”) |
| Tab | Queues instructions for the next turn; Codex finishes its current work first | Follow-up tasks (“after this, also update the changelog”), scope additions (“when you’re done, run the linter”), or non-urgent context (“the deploy target is staging, not prod”) |
Practical examples:
# Codex is refactoring the auth module...
[Enter] "Use bcrypt instead of argon2 — we already have it as a dependency"
→ Codex adjusts immediately, mid-turn
[Tab] "Once auth is done, update the migration script too"
→ Codex finishes auth refactor, then starts the migration
Steer mode is always active in the TUI. If you prefer to wait until Codex finishes before giving instructions, just type normally after the turn completes — no special mode needed.
TUI Enhancements (v0.105.0–v0.106.0)
Syntax highlighting (v0.105.0): The TUI now syntax-highlights fenced code blocks and diffs inline. Use /theme to choose a color scheme.61
New TUI commands (v0.105.0+):61
| Command / Key | Description |
|---|---|
/copy |
Copy the last response to the clipboard |
/clear |
Clear the TUI screen |
Ctrl+L |
Clear screen (keyboard shortcut) |
/theme |
Switch syntax highlighting color scheme |
/plugins |
Browse, install, and remove plugins (v0.117.0+)75 |
/title |
Set terminal window title; works in TUI and app-server TUI (v0.117.0+)75 |
Voice transcription (v0.105.0, experimental): Press spacebar to dictate prompts via voice transcription. This feature is experimental and may require microphone permissions.61 As of v0.107.0, realtime voice sessions support microphone and speaker device selection, allowing you to choose specific audio input/output hardware.62
Other improvements:
- Long links now remain clickable even when wrapped across TUI lines (v0.105.0)61
- Local file links render with improved formatting (v0.106.0)60
- Ctrl+C handling for sub-agents fixed to properly terminate child processes (v0.106.0)60
Memory System
Codex has a persistent memory system (v0.100.0+) that stores facts, preferences, and project context across sessions.24
Memory Commands
| Command | Description |
|---|---|
/m_update <fact> |
Save a memory (e.g., /m_update always use pytest, never unittest) |
/m_drop <query> |
Remove a memory matching the query |
Memories are stored in markdown files under ~/.codex/memory/. Codex loads them at session start and uses them to inform behavior across all future sessions.
What to Store
Memories work best for persistent preferences and project facts:
- Project conventions: “This project uses tabs, not spaces” or “API responses always include a
metafield” - Tool preferences: “Use
pnpminstead ofnpm” or “Run tests withpytest -x --tb=short“ - Architecture decisions: “The auth module is in
src/core/auth/, notsrc/middleware/“ - Workflow preferences: “Always run the linter before showing me a diff”
Memory in Pipelines
When running codex exec, memories are loaded automatically. This means CI/CD pipelines and scripts benefit from the same context as interactive sessions — no need to repeat instructions in every invocation.
Memory Refinements (v0.101.0–v0.107.0)
- Secret sanitization: Memories are automatically scanned for secrets before being written to disk
- CWD awareness: Memory files now include the working directory context for project-specific recall
- Developer message exclusion: Developer/system messages are excluded from phase-1 memory input, improving memory quality by focusing on user interactions
- Diff-based forgetting (v0.106.0): Memory now uses diff-based forgetting to remove stale facts, keeping the memory store lean and relevant over time60
- Usage-aware selection (v0.106.0): Memory retrieval is now usage-aware, prioritizing frequently accessed and recently relevant memories60
- Configurable memories (v0.107.0): Memories are now fully configurable. Use
codex debug clear-memoriesto reset all stored memories for a clean slate — useful when switching contexts between unrelated projects or when memory state has drifted62 - Phase-2 model upgrade (v0.121.0): The phase-2 memory consolidation model is now
gpt-5.4(up from the prior default). The phase-2 pipeline runs between sessions to distill phase-1 transcripts into durable facts; the model change improves recall quality at the same token cost.82 - TUI memories menu (v0.121.0): A new in-session UI exposes memory mode, individual memory deletion, and a reset button. Memory reset now preserves past rollouts rather than invalidating them, so resetting clears the future recall surface without breaking session replay.82
Memory vs AGENTS.md
| Use Case | Memory (/m_update) |
AGENTS.md |
|---|---|---|
| Personal preferences | Use memory (persists across all projects) | Not appropriate |
| Project conventions | Either (memory for personal recall, AGENTS.md for team sharing) | AGENTS.md for team |
| Architecture decisions | AGENTS.md (shared context) | Primary choice |
| Tool commands | Memory (quick personal reference) | AGENTS.md for team |
Tip: Use
/m_updatefor facts that should persist indefinitely. For session-specific context, just tell Codex directly in the conversation. For shared team context, use AGENTS.md.
Session Management
Codex persists sessions under ~/.codex/sessions/, enabling resume, forking, and multi-thread workflows across CLI and desktop surfaces.
Resume
Pick up where you left off:
codex resume # Interactive picker (sorted by recency)
codex resume <SESSION_ID> # Resume a specific session
codex exec resume --last "continue" # Non-interactive: resume most recent
The /resume slash command inside the TUI opens the same interactive picker with search.
Fork
Branch a conversation to explore alternatives without losing your current progress:
/fork # Fork current conversation
/fork "try a different approach" # Fork with new prompt
Forks create independent threads sharing the same history up to the fork point. Changes in one fork don’t affect the other. This is useful for comparing approaches (e.g., “fork and try Redis instead of Memcached”) or exploring risky changes safely.
Thread forking into sub-agents (v0.107.0): Threads can now be forked into independent sub-agents, allowing a conversation to spawn parallel work streams that execute autonomously. This extends the existing fork model — instead of just branching the conversation, the forked thread becomes a sub-agent with its own execution context.62 As of v0.117.0, sub-agents use path-based addresses (e.g., /root/agent_a) with structured inter-agent messaging, making multi-agent coordination more explicit and debuggable.75
Thread Listing
View and manage active sessions:
/status # Current session info and token usage
/ps # Show background terminals in session
In the desktop app, threads are visible in the sidebar with full history and diff previews.
Session Lifecycle
| Action | CLI | Desktop App |
|---|---|---|
| Start new | codex or /new |
New Thread button |
| Resume | codex resume or /resume |
Click thread in sidebar |
| Fork | /fork |
Right-click thread → Fork |
| End | /quit or Ctrl+C |
Close thread tab |
| Delete | Remove from ~/.codex/sessions/ |
Right-click → Delete |
Sessions sync between CLI and desktop app — start in one, continue in the other.
Non-Interactive Mode (codex exec)
codex exec runs Codex non-interactively for scripting, CI/CD, and automation.15
Basic Usage
codex exec "summarize the repository structure"
codex exec --sandbox workspace-write --ask-for-approval on-request "fix the CI failure"
codex exec --json "triage open bugs" -o result.txt
By default, codex exec writes progress/events to stderr and the final agent message to stdout. The design makes it composable with standard Unix pipelines.
JSON Lines Output
With --json, stdout becomes a JSONL event stream:
codex exec --json "fix the tests" | jq
Event types: thread.started, turn.started/completed/failed, item.started/completed, error
{"type":"thread.started","thread_id":"019c5c94-..."}
{"type":"turn.started"}
{"type":"item.started","item":{"id":"item_1","type":"command_execution","status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_3","type":"agent_message","text":"..."}}
{"type":"turn.completed","usage":{"input_tokens":24763,"cached_input_tokens":24448,"output_tokens":122}}
Structured Output
Enforce response shape with JSON Schema:
codex exec "Extract project metadata" \
--output-schema ./schema.json \
-o ./project-metadata.json
-o / --output-last-message writes the final message to a file.
Session Resume and Review
codex exec resume --last "continue where you left off"
codex exec resume <SESSION_ID> "fix the remaining issues"
codex exec review --base main # Code review against a branch
Key Flags
| Flag | Description |
|---|---|
--sandbox workspace-write --ask-for-approval on-request |
Workspace-scoped automation with approval for boundary crossings |
--json |
JSONL event stream to stdout |
-o, --output-last-message <file> |
Save final message to file |
--output-schema <file> |
Validate response against JSON Schema |
--ephemeral |
Don’t persist session files |
-C, --cd <dir> |
Set working directory |
--add-dir <dir> |
Extra writable directories |
--skip-git-repo-check |
Allow running outside git repos |
--dangerously-bypass-approvals-and-sandbox |
No sandbox, no approvals (CI only) |
CI Authentication
codex exec supports CODEX_API_KEY for non-interactive authentication in automation environments.
codex execstartup banner (v0.130.0). Thecodex execstartup banner no longer prints the legacy “research preview” wording. If your CI scrapes startup output, the banner text is now slimmer; structured--jsonevents are unchanged.91
codex remote-control (v0.130.0+)
codex remote-control is a top-level command that starts a headless app-server intended to be driven by another process — IDE extensions, custom orchestrators, or remote control planes. It replaces the multi-flag codex app-server invocation many integrators were stitching together by hand and gives third-party tooling a single, stable entrypoint into the same app-server runtime that ships under the desktop and IDE surfaces.91
# Start a headless, remotely controllable app-server
codex remote-control
# Same lifecycle as a TUI session: thread store, hooks, plugins, MCP, sandbox
# all initialize from your normal config.toml.
Pair codex remote-control with the app-server pagination APIs below when you are building UIs that need to enumerate large thread histories without hydrating every turn into memory at once.
App-Server Thread Pagination (v0.130.0+)
App-server clients can now page large threads through three distinct turn item views:91
| View | Use Case |
|---|---|
| Unloaded | Listing-only — thread structure without turn payload (cheapest) |
| Summary | Compact per-turn metadata — useful for sidebars and resume pickers |
| Full | Complete turn payload, including tool calls and outputs |
Pair pagination with the ThreadStore interface introduced in v0.121.0 to walk long-running threads efficiently, especially in remote-control deployments where the orchestrator may be on a different machine than the rollout files.82
Live App-Server Config Refresh (v0.130.0+)
Live app-server threads now pick up config.toml changes without requiring a restart — edit the config, save, and the running thread reflects the new values on its next turn. This is the bug-fix counterpart to codex remote-control: a long-running headless server can be reconfigured in place rather than torn down.91
Codex Cloud & Background Tasks [EXPERIMENTAL]
Status: Codex Cloud is an experimental feature. Interfaces, pricing, and availability may change. OpenAI manages the cloud environments, and you do not control the infrastructure.
Codex Cloud runs tasks asynchronously in OpenAI-managed environments.4 See also GitHub Action & CI/CD for integrating Codex into your CI pipeline.
How It Works
- Submit a task (via chatgpt.com/codex, Slack integration, or CLI)
- Codex clones your repo into an isolated cloud sandbox
- The agent works independently: reads code, runs tests, makes changes
- When done, Codex creates a PR or provides a diff for review
- Apply results locally with
codex apply <TASK_ID>
Internet Access in Cloud
Agent internet is off by default and configured per environment:
- Off: No agent internet access (default)
- On: Optional domain allowlist + HTTP method restrictions
Allowed domains: pypi.org, npmjs.com, github.com
Allowed methods: GET, HEAD, OPTIONS
Setup scripts can still use internet to install dependencies, even when agent internet is off.
Slack Integration
Mention @Codex in a Slack channel or thread to start a cloud task.
Prerequisites: 1. Eligible ChatGPT plan (Plus, Pro, Business, Enterprise, or Edu) 2. Connected GitHub account 3. At least one configured cloud environment 4. Slack app installed for your workspace
Codex replies with a task link and posts results when complete.
Cloud CLI
codex cloud exec --env <ENV_ID> "Fix failing tests" # Start a cloud task
codex cloud status <TASK_ID> # Check task progress
codex cloud diff <TASK_ID> # View task diff
codex cloud list # List recent tasks
codex cloud list --json # JSON output
codex cloud apply <TASK_ID> # Apply from cloud subcommand
codex apply <TASK_ID> # Apply diff (top-level shortcut)
The Codex Desktop App
The Codex desktop app (macOS and Windows) provides a graphical interface optimized for multi-project management.16 The Windows version launched on March 4, 2026 with native PowerShell support and native Windows sandbox.66
Installation
codex app # Auto-downloads and installs on first run
Or download directly: Codex.dmg (macOS) | Available in the Microsoft Store (Windows)
Key Features
| Feature | Description |
|---|---|
| Parallel threads | Run multiple tasks across projects simultaneously |
| Thread modes | Start threads in Local, Worktree, or Cloud mode |
| Built-in Git tools | Review diffs, add comments, stage/revert chunks, commit/push, create PRs |
| Integrated terminal | Per-thread terminal (Cmd+J) |
| Voice dictation | Prompt by voice (Ctrl+M) |
| Automations | Schedule recurring tasks |
| Notifications | Completion/approval notifications when app is backgrounded |
| Prevent sleep | Optional setting to keep machine awake while tasks run |
| Skills + MCP | Shared configuration across app, CLI, and IDE extension |
| MCP shortcuts | Quick-access MCP tool shortcuts in the composer (App v26.226)63 |
| Review @mentions | @mention collaborators in code review comments (App v26.226)63 |
| Custom themes | Color controls and font selection in Settings (App v26.312)72 |
| App-server TUI | Enabled by default (v0.117.0+): ! shell commands, filesystem watch, remote WebSocket with bearer auth, prompt history recall across sessions75 |
Thread Modes
Each thread runs in one of three modes, selected when you create it:
| Mode | Isolation | File Access | Best For |
|---|---|---|---|
| Local | None — works directly in your project directory | Full read/write | Quick tasks, exploration, non-destructive work |
| Worktree | Git worktree — isolated branch copy of your repo | Isolated copy | Feature development, risky refactors, parallel experiments |
| Cloud | Remote server — runs on OpenAI infrastructure | No local access | Long-running tasks, CI-like workflows, async delegation |
Worktree isolation mechanics:
When you start a Worktree thread, the desktop app:
1. Creates a new git worktree (git worktree add) in a temporary directory
2. Checks out a fresh branch from your current HEAD
3. Runs the agent inside the worktree — all file changes are isolated
4. Presents a diff review when done — you choose which changes to merge back
This means multiple Worktree threads can run simultaneously on the same repo without conflicts. Each gets its own branch and working directory.
Automations
Automations run locally in the app, so the app must be running and the project available on disk:
- In Git repos, automations use dedicated background worktrees (isolated from your working directory)
- In non-Git projects, runs execute directly in the project directory
- Automations use your default sandbox settings
Setting up an automation: 1. Open a project in the desktop app 2. Click the Automations tab in the sidebar 3. Define a trigger (schedule, webhook, or manual) 4. Write the prompt and select execution mode (local or worktree) 5. Set the reasoning level for the automation run (App v26.312)72 6. Automations run on schedule and queue results for review
Example use cases: - Issue triage: Automatically categorize and prioritize new issues - CI monitoring: Watch build failures and suggest fixes - Alert response: React to monitoring alerts with diagnostic analysis - Dependency updates: Check for and apply security patches
Results appear in a review queue for human approval.
Windows Support
The Codex Desktop App launched on Windows on March 4, 2026 (App v26.304) with native PowerShell support, native Windows sandbox, and full feature parity including skills, automations, and worktrees without requiring WSL.66
GitHub Action & CI/CD
The official GitHub Action integrates Codex into your CI/CD pipeline.18
Basic Usage
# .github/workflows/codex.yml
name: Codex
on:
pull_request:
types: [opened]
jobs:
codex:
runs-on: ubuntu-latest
outputs:
final_message: ${{ steps.run_codex.outputs.final-message }}
steps:
- uses: actions/checkout@v5
- name: Run Codex
id: run_codex
uses: openai/codex-action@v1
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
prompt-file: .github/codex/prompts/review.md
sandbox: workspace-write
safety-strategy: drop-sudo
Configuration Options
| Input | Purpose |
|---|---|
openai-api-key |
API key for proxy/auth setup |
responses-api-endpoint |
Override endpoint (e.g. Azure Responses URL) |
prompt / prompt-file |
Task instructions (one required) |
working-directory |
Directory passed to codex exec --cd |
sandbox |
workspace-write / read-only / danger-full-access |
codex-args |
Extra CLI flags (JSON array or shell string) |
output-schema / output-schema-file |
Structured output schema for --output-schema |
model / effort |
Agent configuration |
output-file |
Save final message to disk |
codex-version |
Pin CLI version |
codex-home |
Custom Codex home directory |
allow-users / allow-bots |
Trigger allowlist controls |
safety-strategy / codex-user |
Privilege-reduction behavior and user selection |
Output: final-message, the final Codex response text for downstream steps/jobs.
Safety Strategies
| Strategy | Description |
|---|---|
drop-sudo (default) |
Linux/macOS; removes sudo capability after action step |
unprivileged-user |
Run Codex as a pre-created low-privilege user |
read-only |
Read-only sandbox (runner/user privilege risk still applies) |
unsafe |
No privilege reduction; required on Windows runners |
Access Controls
with:
allow-users: "admin,maintainer" # Limit who can trigger
allow-bots: false # Block bot-triggered runs
Default: Only collaborators with write access can trigger Codex workflows.
Codex SDK
The TypeScript SDK embeds Codex’s agent capabilities into custom applications.19
Installation
npm install @openai/codex-sdk
Basic Usage
import { Codex } from "@openai/codex-sdk";
const codex = new Codex();
const thread = codex.startThread();
// Multi-turn conversation
const turn1 = await thread.run("Diagnose CI failures and propose a fix");
console.log(turn1.finalResponse);
const turn2 = await thread.run("Implement the fix and add tests");
console.log(turn2.items);
// Resume a previous session
const resumed = codex.resumeThread("<thread-id>");
await resumed.run("Continue from previous work");
Advanced SDK Features
runStreamed(...): Async event stream for intermediate updatesoutputSchema: Enforce JSON-shaped final output- Multimodal input: Pass text + local images (
{ type: "local_image", path: "..." }) - Image workflows (v0.117.0):
view_imagereturns URLs, generated images are reopenable, and image history survives session resume75 - Multi-environment
view_image(v0.130.0): For sessions that span multiple environments (introduced in v0.124.0 with per-turn environment + working-directory selection, refined in v0.125.0 with sticky environments),view_imagenow resolves file paths through the selected environment rather than the orchestrator’s local filesystem. An image attached from a remote environment is fetched relative to that environment’s working directory, not the host running the SDK.91
Thread and Client Configuration
// Custom working directory, skip git check
const thread = codex.startThread({
workingDirectory: "/path/to/project",
skipGitRepoCheck: true,
});
// Custom environment and config overrides
const codex = new Codex({
env: { CODEX_API_KEY: process.env.MY_KEY },
config: { model: "gpt-5.5" },
});
Sessions persist under ~/.codex/sessions.
Runtime: Node.js 18+.
Performance Optimization
Context Management
Context windows vary by model. As of April 2026: GPT-5.5 in Codex offers 400K (1M in the API). GPT-5.4 / GPT-5.4-mini offer 1M / 400K respectively (API-equivalent in Codex). The GPT-5.3-Codex / GPT-5.2-Codex family runs on a 272K input + 128K output (400K total budget). All of them fill faster than you’d expect — manage proactively:
- Use
/compactregularly: Summarizes conversation history to free tokens - Provide local docs: High-quality
AGENTS.mdand local documentation reduce exploration overhead (which consumes context) - Use
@to attach specific files: Reference files directly instead of asking Codex to find them - Keep prompts focused: Scoped prompts with exact files consume less context than open-ended exploration
Token Efficiency
| Technique | Impact |
|---|---|
Set model_reasoning_summary = "none" |
Reduces output tokens ~20% |
Use model_verbosity = "low" |
Shorter explanations, more action |
| Use mini models for simple tasks | Significantly cheaper per message |
| Split complex tasks into focused sessions | Better per-session token efficiency |
| Use profiles to switch settings by task | Avoid paying for high reasoning on routine work |
Speed Optimization
gpt-5.3-codex-spark: Lower-latency variant for interactive pairing--profile fast: Pre-configured mini model with low reasoning- Parallel tool execution: Codex runs independent reads/checks concurrently, so structure prompts to enable this
- Outcome-driven loops: Ask for “implement, test, fix, stop when green” instead of step-by-step instructions
How Do I Debug Issues?
Common Problems and Solutions
| Problem | Cause | Solution |
|---|---|---|
| “Re-connecting” loop | Multiple Codex instances | Kill all processes, wait 60s, restart single instance |
| 401 auth errors | Stale credentials | rm ~/.codex/auth.json && codex login |
| Network blocked in sandbox | Default behavior | -c 'sandbox_workspace_write.network_access=true' |
| WSL2 disconnections | WSL state corruption | wsl --shutdown in PowerShell, wait 1 min, restart |
| Patch failures | Line ending mismatches | Normalize to LF, provide exact file text |
| Context compacting fails | Too much context | Reduce reasoning effort, split into smaller tasks |
| Model changes unexpectedly | Config.toml override | Run /config to inspect effective settings and sources |
| Plan mode allows mutations | Known bug | Issue #11115 |
| Forgetting AGENTS.md instructions | Context limits | Keep instructions concise; use skill files for detailed procedures |
| Stalling in Read Only mode | Known issue | Discussion #7380 |
Error Messages Reference
| Error Message | Meaning | Fix |
|---|---|---|
Error: EACCES permission denied |
Sandbox blocked a file operation | Check sandbox mode; use workspace-write if Codex needs to edit files |
Error: rate limit exceeded |
API rate limit hit | Wait and retry; reduce model_reasoning_effort or switch to a lighter model |
Error: context length exceeded |
Conversation exceeded 272K input tokens | Use /compact to summarize, or start a new session with /new |
Error: MCP server failed to start |
MCP server process crashed or timed out | Check codex mcp get <name> for config; increase startup_timeout_sec |
Error: authentication required |
No valid API key or session | Run codex login or set CODEX_API_KEY |
Error: sandbox execution failed |
Command failed inside sandbox | Check command syntax; verify required tools are available in the sandbox environment |
WARN: skill not found |
Referenced skill doesn’t exist at expected path | Check /skills list; verify skill folder location |
Error: wire format mismatch |
Wrong wire_api setting for provider |
Use wire_api = "responses" for OpenAI endpoints (see Custom Model Providers) |
Diagnostic Tools
codex --version # Check CLI version
codex login status # Verify authentication
codex mcp list # Check MCP server status
codex debug app-server --help # Debug app server issues
In-session TUI diagnostics:
/status # Token/session overview
/config # Inspect effective config values and sources
/compact # Summarize history to reclaim context
Note:
codex --verboseis not a valid top-level flag. Use the debug subcommands and TUI diagnostics above.
Clean Reinstall
npm uninstall -g @openai/codex && npm install -g @openai/codex@latest
Debug Mode
codex debug app-server send-message-v2 # Test app-server client
Reporting Issues
/feedback # Send logs to Codex maintainers (in TUI)
Or file issues at github.com/openai/codex/issues.1
Codex Security [PREVIEW]
Codex Security entered research preview on March 6, 2026, bringing context-aware application security review into the Codex stack.77 Available to ChatGPT Pro, Enterprise, Business, and Edu customers via Codex web.
How it works: Codex Security analyzes repositories to build a project-specific threat model, identifies vulnerabilities classified by real-world impact, and pressure-tests findings in a sandboxed environment to validate them. The agent surfaces higher-confidence findings with fixes, reducing noise from insignificant bugs.
Performance: During research preview, Codex Security scanned 1.2 million commits and identified 10,561 high-severity vulnerabilities. Precision improved over time — cutting noise by 84%, reducing over-reported severity by 90%+, and halving false positive rates. The system has found real vulnerabilities in OpenSSH, GnuTLS, and Chromium, with 14 CVEs assigned.77
Note: Codex Security is separate from the CLI’s built-in sandbox security model. The sandbox protects your machine from Codex; Codex Security protects your codebase from vulnerabilities.
Enterprise Deployment
Admin Controls (requirements.toml)
Administrators enforce enterprise policy via requirements.toml, an admin-enforced configuration file that constrains security-sensitive settings users cannot override:21
# /etc/codex/requirements.toml
# Restrict which approval policies users can select
allowed_approval_policies = ["untrusted", "on-request", "never"]
# Limit available sandbox modes
allowed_sandbox_modes = ["read-only", "workspace-write"]
# Control web search capabilities
allowed_web_search_modes = ["cached"]
# Allowlist MCP servers by identity (both name and identity must match)
[mcp_servers.approved-server]
identity = { command = "npx approved-mcp-server" }
# Admin-enforced command restrictions
[[rules.prefix_rules]]
pattern = [{ token = "rm" }, { any_of = ["-rf", "-fr"] }]
decision = "forbidden"
justification = "Recursive force-delete is prohibited by IT policy"
[[rules.prefix_rules]]
pattern = [{ token = "sudo" }]
decision = "prompt"
justification = "Elevated commands require explicit approval"
Unlike user-level
config.tomlwhich sets preferences,requirements.tomlis a hard constraint layer that restricts what values users can select, and users cannot override it. Admin requirements rules can only prompt or forbid (never silently allow).
macOS MDM Configuration
Distribute via MDM using the com.openai.codex preference domain.21 Codex honors standard macOS MDM payloads (Jamf Pro, Fleet, Kandji, etc.). Encode TOML as base64 without line wrapping:
| Key | Purpose |
|---|---|
config_toml_base64 |
Base64-encoded managed defaults (starting values users can change) |
requirements_toml_base64 |
Base64-encoded admin-enforced requirements (users cannot override) |
Precedence (highest to lowest):
- macOS managed preferences (MDM)
- Cloud-fetched requirements (ChatGPT Business / Enterprise)
/etc/codex/requirements.toml(local filesystem)
Cloud requirements only fill unset requirement fields, so higher-precedence managed layers always win. Cloud requirements are best-effort; if the fetch fails or times out, Codex continues without the cloud layer.
OpenTelemetry Integration
Codex supports OpenTelemetry trace-context propagation from standard OTel environment variables through to OpenAI API calls. Set the standard environment variables before launching Codex:
# Point Codex at your OTel collector
export OTEL_EXPORTER_OTLP_ENDPOINT="https://otel-collector.internal:4318"
export OTEL_SERVICE_NAME="codex-cli"
export OTEL_RESOURCE_ATTRIBUTES="team=platform,env=production"
# Launch Codex — trace context propagates to all OpenAI API calls
codex
- Standard
OTEL_*environment variables are respected (endpoint, service name, resource attributes) - Trace context propagates through Codex to API calls, enabling end-to-end observability
- Use resource attributes to tag traces by team, environment, or project
- Keep privacy requirements in mind when enabling prompt/tool logging — traces may contain code snippets
- Configurable OpenTelemetry trace metadata (v0.130.0+). Beyond the standard
OTEL_RESOURCE_ATTRIBUTESenvelope, thecodex-otelcrate now exposes configurable trace metadata so administrators can tag traces with organization-specific dimensions (cost-center, project ID, ticket reference) without rebuildingOTEL_RESOURCE_ATTRIBUTESfrom scratch on every invocation. Pair this with the richer review/feedback analytics shipped in the same release for unified debugging and triage across CLI, app-server, and remote-control sessions.91
Enterprise Access
- ChatGPT Business / Enterprise / Edu: Org-admin controlled access, with cloud-fetched requirements applied automatically. Supports SSO via SAML/OIDC through your identity provider (Okta, Entra ID, etc.)
- API: Standard API auth, billing, and org/project controls. OpenAI publishes SOC 2 Type II and SOC 3 reports; HIPAA BAA available for Enterprise tier
- Codex SDK: Embed in internal tools and workflows
- Policy enforcement at scale: Use MDM-distributed
requirements_toml_base64or filesystem-level/etc/codex/requirements.toml
Data handling and compliance: - API inputs/outputs are not used for training under OpenAI’s Business/Enterprise/API terms - For data residency, OpenAI API traffic routes through US-based infrastructure by default; for EU data residency requirements, consult OpenAI’s Enterprise sales team - Session transcripts are stored locally; only API calls leave the machine - ChatGPT Enterprise supports compliance frameworks including SOC 2, GDPR, and CCPA
Rollout Strategy
Recommended phased rollout for organizations:
- Pilot (Week 1-2): Deploy to 3-5 senior engineers with
requirements.tomlenforcinguntrustedsandbox mode andcachedweb search. Collect feedback on AGENTS.md patterns and MCP server needs. - Team expansion (Week 3-4): Roll out to full team. Distribute team-standard
config.tomlvia MDM or repo. Enableworkspace-writesandbox for trusted repositories. - CI integration (Week 5-6): Add
codex-actionto CI/CD pipelines for automated PR review and test generation. Use--ephemeralto keep costs predictable. - Org-wide (Month 2+): Deploy via MDM with
requirements.tomlenforcing approved MCP servers, sandbox policies, and model allowlists.
Audit Patterns
Track Codex usage and enforce compliance:
- OpenTelemetry traces: Monitor API call volume, token usage, and latency per team
- Session persistence: Audit
~/.codex/sessions/for compliance review (disable with--ephemeralin sensitive contexts) - MCP identity enforcement:
requirements.tomllogs blocked server attempts — review for unauthorized tool usage - Git audit trail: All Codex file changes go through standard git — review via branch history and PR diffs
Best Practices & Anti-Patterns
Prompting Patterns
- Constraint-driven prompts: Lead with boundaries. “Do NOT change the API contracts. Only refactor internal implementation.”
- Structured reproduction steps: Numbered steps produce better bug fixes than vague descriptions
- Verification requests: End with “Run lint + the smallest relevant test suite. Report commands and results.”
- File references: Use
@filenameto attach specific files to context - Outcome-driven loops: “Implement, run tests, fix failures, stop only when all tests pass.” Codex iterates until done
Testing Philosophy
The community converges on test-driven AI collaboration:22
- Define tests upfront as completion signals
- Let Codex iterate until tests pass (red → green → refactor)
- Adopt Tiger Style programming patterns
- Provide exact file text when requesting patches. Codex uses strict matching, not fuzzy AST-based patching
Context Management Best Practices
- Provide high-quality local documentation rather than relying on web search
- Maintain structured markdown with tables of contents and progress files (“progressive disclosure”)
- Normalize line endings (LF vs CRLF) across tracked files to prevent patch failures
- Keep
AGENTS.mdconcise, since long instructions get pushed out of context
Git Workflow
- Always create a new branch before running Codex on unfamiliar repos
- Use patch-based workflows (
git diff/git apply) rather than direct edits - Review Codex suggestions like code review PRs
- Use
/diffto verify changes before committing
Community Skills and Prompts
The feiskyer/codex-settings repository provides community-maintained configurations:23
Reusable prompts (in ~/.codex/prompts/):
- deep-reflector: Extract learnings from development sessions
- github-issue-fixer [issue-number]: Systematic bug analysis and PR creation
- github-pr-reviewer [pr-number]: Code review workflows
- ui-engineer [requirements]: Production-grade frontend development
Community skills:
- claude-skill: Handoff tasks to Claude Code with permission modes
- autonomous-skill: Multi-session task automation with progress tracking
- deep-research: Parallel sub-task orchestration
- kiro-skill: Requirements → design → tasks → execution pipeline
Anti-Patterns
Common mistakes that waste tokens, produce poor results, or create frustrating workflows.
Cost Anti-Patterns
| Anti-Pattern | Why It Fails | Fix |
|---|---|---|
Using xhigh reasoning for everything |
3-5x token cost with diminishing returns on simple tasks | Use medium by default; reserve xhigh for multi-file architecture decisions |
Never using /compact |
Context fills to 272K, responses degrade | Compact after every major milestone or when /status shows >60% usage |
| Running flagship model in CI | Expensive for routine checks | Create a ci profile with gpt-5.1-codex-mini and low reasoning |
Context Anti-Patterns
| Anti-Pattern | Why It Fails | Fix |
|---|---|---|
| Open-ended “explore everything” prompts | Codex reads dozens of files, burning context on irrelevant code | Scope with specific files: “Review src/auth/login.py and tests/test_auth.py“ |
No AGENTS.md in the project |
Codex wastes turns discovering project structure | Add a 20-line AGENTS.md with key paths, conventions, and test commands |
| Attaching entire directories | Floods context with irrelevant files | Use @filename to attach only the files Codex needs |
Workflow Anti-Patterns
| Anti-Pattern | Why It Fails | Fix |
|---|---|---|
Working on main directly |
No safety net; risky edits are hard to revert | Always create a feature branch before starting Codex |
Skipping /diff before committing |
Codex may have made unintended changes | Review /diff after every task, before any commit |
| Ignoring test output | Codex iterates past failures if you don’t flag them | Use “run tests and stop only when all pass” in your prompt |
| Never forking conversations | One wrong turn pollutes the entire context | /fork before risky explorations; discard bad branches |
Prompt Anti-Patterns
| Anti-Pattern | Why It Fails | Fix |
|---|---|---|
| “Fix the bug” (no context) | Codex guesses which bug, reads everything | “Fix the TypeError in src/api/handler.py:42 — user.name is None when unauthenticated” |
| Multi-task prompts in one message | Codex conflates tasks, misses some | One task per message; use steer mode (Tab) to queue follow-ups |
| Repeating context every message | Wastes tokens on duplicate information | Use /m_update for persistent facts; reference earlier context |
Workflow Recipes
End-to-end patterns for common development scenarios.
Recipe 1: New Project Setup
mkdir my-app && cd my-app && git init
codex
> Create a FastAPI project with: main.py, requirements.txt, Dockerfile,
basic health endpoint, and a README. Use async throughout.
> /init
Review the generated AGENTS.md, edit to match your conventions, then:
> Run the health endpoint test and confirm it passes
Recipe 2: Daily Development Flow
cd ~/project && git checkout -b feature/user-auth
codex
> @src/models/user.py @src/api/auth.py
Add password reset functionality. Requirements:
1. POST /api/auth/reset-request (email → sends token)
2. POST /api/auth/reset-confirm (token + new password)
3. Tests for both endpoints
Run tests when done.
Review with /diff, then commit.
Recipe 3: Complex Refactor with Plan Mode
codex
> /plan Migrate the database layer from raw SQL to SQLAlchemy ORM.
Constraints: don't change any API contracts, keep all existing tests passing.
Review the plan. Approve or steer:
[Tab] Also add a migration script using Alembic
After Codex executes, verify:
> Run the full test suite and report results
> /diff
Recipe 4: PR Review with codex exec
codex exec --model gpt-5.1-codex-mini \
"Review the changes in this branch against main. \
Flag security issues, missed edge cases, and style violations. \
Format as a markdown checklist." \
-o review.md
Recipe 5: Debugging with Cloud Tasks [EXPERIMENTAL]
codex cloud exec --env my-env "Diagnose why the /api/orders endpoint returns 500 \
for orders with > 100 line items. Check the serializer, database query, \
and pagination logic. Propose a fix with tests."
Check progress later:
codex cloud status <TASK_ID>
codex cloud diff <TASK_ID>
Apply the fix locally when done:
codex apply <TASK_ID>
Migration Guide
From Claude Code
| Claude Code Concept | Codex Equivalent |
|---|---|
CLAUDE.md |
AGENTS.md (open standard) |
.claude/settings.json |
.codex/config.toml (TOML format) |
--print flag |
codex exec subcommand |
--dangerously-skip-permissions |
--dangerously-bypass-approvals-and-sandbox |
| Hooks (12+ events) | Hooks (SessionStart, Stop, UserPromptSubmit, AfterAgent, AfterToolUse; v0.99.0–v0.116.0) |
| Subagents (Task tool) | Sub-agents (internal, max 6; no user-facing Task tool equivalent) |
/compact |
/compact (identical) |
/cost |
/status (shows token usage) |
| Model: Opus/Sonnet/Haiku | Model: gpt-5.5 / gpt-5.4 / gpt-5.4-mini / legacy gpt-5.3-codex variants (Codex uses OpenAI’s GPT-5.x model family) |
claude --resume |
codex resume |
| Permission rules | Sandbox modes + approval policies |
| MCP config in settings.json | MCP config in config.toml |
Key differences to understand:
- Sandbox is OS-level: Codex uses Seatbelt/Landlock, not containers. Restrictions operate at the kernel level, below the application layer.
- Hooks are expanding: Codex now supports 5 hook events:
SessionStart,Stop, andUserPromptSubmit(v0.114.0–v0.116.0, experimental) plusAfterAgent(v0.99.0) andAfterToolUse(v0.100.0). The system covers session lifecycle, prompt interception, and tool-level automation, though Claude Code’s 12+ lifecycle events still offer broader coverage. For automation patterns not yet covered, use AGENTS.md instructions or skills. - Sub-agents v2 (v0.117.0): Sub-agents now use path-based addresses (e.g.,
/root/agent_a) with structured inter-agent messaging and agent listing.75 This extends the existing machinery (max 6 concurrent, reduced from 12 in v0.91.0). Multi-agent roles remain customizable via config (v0.104.0+).47 v0.105.0 addedspawn_agents_on_csvfor fanout across rows with progress tracking and ETA.61 Codex still lacks Claude Code’s explicit Task tool UX for user-directed delegation — use cloud tasks or SDK orchestration for delegation patterns. - AGENTS.md is cross-tool: Your AGENTS.md works in Cursor, Copilot, Amp, Jules, Gemini CLI, and 60,000+ open source projects. CLAUDE.md is Claude-only.
- Profiles replace manual switching: Instead of changing flags per-run, define profiles in config.toml.
From GitHub Copilot
| Copilot Concept | Codex Equivalent |
|---|---|
| Copilot CLI (agentic terminal) | Interactive CLI or desktop app |
| Specialized agents (Explore, Plan) | Skills + plan mode + steer mode |
copilot-instructions.md / AGENTS.md |
AGENTS.md (same standard) |
| MCP support | MCP support (STDIO + HTTP) |
| ACP (Agent Client Protocol) | Hooks (AfterAgent, AfterToolUse) |
| Copilot SDK | Codex SDK (TypeScript) |
| Coding agent workflows | Codex agent with sandbox/approval controls + cloud tasks |
What you gain:
- OS-level sandboxing (Seatbelt/Landlock — kernel-enforced vs container-based)
- Cloud task delegation with codex apply
- Config profiles for workflow switching
- Desktop app with worktree isolation
From Cursor
| Cursor Concept | Codex Equivalent |
|---|---|
Project rules (.cursor/rules) / AGENTS.md |
AGENTS.md + profiles/config |
| Agent chat/composer workflows | Interactive CLI or desktop app |
@ file references |
@ file references (identical) |
| Apply/edit + review | Built-in patching and diff review |
Quick Reference Card
╔═══════════════════════════════════════════════════════════════╗
║ CODEX CLI QUICK REFERENCE ║
╠═══════════════════════════════════════════════════════════════╣
║ ║
║ LAUNCH ║
║ codex Interactive TUI ║
║ codex "prompt" TUI with initial prompt ║
║ codex exec "prompt" Non-interactive mode ║
║ codex app Desktop app ║
║ codex resume Resume previous session ║
║ codex fork Fork a session ║
║ ║
║ FLAGS ║
║ -m, --model <model> Select model ║
║ -p, --profile <name> Load config profile ║
║ -s, --sandbox <mode> Sandbox mode ║
║ -C, --cd <dir> Working directory ║
║ -i, --image <file> Attach image(s) ║
║ -c, --config <key=value> Override config ║
║ --ask-for-approval <p> Approval policy ║
║ --oss Use local models (Ollama) ║
║ --search Enable live web search ║
║ ║
║ SLASH COMMANDS (in TUI) ║
║ /compact Free tokens /diff Git diff ║
║ /review Code review /plan Plan mode ║
║ /model Switch model /status Session info ║
║ /fork Fork thread /goal Persisted goal ║
║ /vim Modal Vim /hooks Browse/toggle hooks ║
║ /init AGENTS.md scaffold ║
║ /mcp MCP tools /skills Invoke skills ║
║ /ps Background /personality Style ║
║ /permissions Approval mode /statusline Footer config ║
║ /fast Toggle fast mode (default: on) ║
║ /copy Copy last response to clipboard ║
║ /clear Clear screen /theme Syntax highlighting ║
║ ║
║ TUI SHORTCUTS ║
║ @ Fuzzy file search ║
║ !command Run shell command ║
║ Ctrl+G External editor ║
║ Ctrl+L Clear screen ║
║ Enter Inject instructions (while running) ║
║ Esc Esc Edit previous messages ║
║ ║
║ EXEC MODE (CI/CD) ║
║ codex exec --sandbox workspace-write "task" Sandboxed auto ║
║ codex exec --json -o out.txt "task" JSON + file output ║
║ codex exec --output-schema s.json Structured output ║
║ codex exec resume --last "continue" Resume session ║
║ ║
║ MCP MANAGEMENT [EXPERIMENTAL] ║
║ codex mcp add <name> -- <cmd> Add STDIO server ║
║ codex mcp add <name> --url <u> Add HTTP server ║
║ codex mcp list List servers ║
║ codex mcp login <name> OAuth flow ║
║ codex mcp remove <name> Delete server ║
║ ║
║ PLUGINS ║
║ codex plugin marketplace add <src> Add marketplace ║
║ codex plugin marketplace upgrade Upgrade marketplaces ║
║ ║
║ CLOUD [EXPERIMENTAL] ║
║ codex cloud exec --env <ID> Start cloud task ║
║ codex cloud status <ID> Check task progress ║
║ codex cloud diff <ID> View task diff ║
║ codex cloud list List tasks ║
║ codex apply <TASK_ID> Apply cloud diff locally ║
║ ║
║ CONFIG FILES ║
║ ~/.codex/config.toml User config ║
║ .codex/config.toml Project config ║
║ ~/.codex/AGENTS.md Global instructions ║
║ AGENTS.md Project instructions ║
║ requirements.toml Enterprise policy constraints ║
║ ║
║ SANDBOX MODES ║
║ read-only Read files only, no mutations ║
║ workspace-write Read/write in workspace + /tmp ║
║ danger-full-access Full machine access ║
║ ║
║ APPROVAL POLICIES ║
║ untrusted Prompt for all mutations ║
║ on-request Prompt for boundary violations ║
║ never No prompts ║
║ ║
║ MODELS (April 2026) ║
║ gpt-5.5 Recommended default (400K in Codex) ║
║ gpt-5.5-pro Highest-effort GPT-5.5 tier ║
║ gpt-5.4 Prior flagship / fallback ║
║ gpt-5.4-mini Subagent work, 2x faster (400K) ║
║ gpt-5.3-codex Legacy coding specialist ║
║ ║
╚═══════════════════════════════════════════════════════════════╝
Changelog
| Date | Version | What Changed | Source |
|---|---|---|---|
| 2026-05-09 | Guide v2.25: CLI v0.130.0 stable (May 8, 2026, 23:09 UTC). Added codex remote-control top-level command for headless app-server control (#21424); plugin details show bundled hooks, plugin sharing exposes link metadata, discoverability controls, and updated share settings (#21447, #21495, #21637); app-server thread pagination with unloaded / summary / full turn views (#21566); Bedrock auth via AWS aws login console-login credentials (#21623); view_image resolves through the selected environment for multi-environment sessions (#21143); live app-server config refresh on running threads (#21187); removed “research preview” wording from the codex exec startup banner (#21683); configurable OpenTelemetry trace metadata + richer review/feedback analytics (#21556, #18747, #21434, #21498); Linux sandbox startup hardening, Windows sandbox grant for desktop runtime binary cache (#21564). v0.131.0 alpha line is in progress (alpha.1, alpha.2, alpha.4 on May 9). Footnote-only: GPT-5.5 Instant rolled out to free tier on May 5, 2026.92 |
91 | |
| 2026-05-08 | Guide v2.24: Codex for Chrome (May 7, 2026). Added the Chrome extension as the fifth Codex surface alongside CLI, desktop app, IDE extension, and cloud. The extension works in parallel across tabs in the background without taking over the browser, with per-site allow-listing for control. Updated Key Takeaways and Core Interaction Surfaces to reflect five surfaces instead of four. | 90 | |
| 2026-05-07 | Guide v2.23: CLI v0.129.0 stable (May 7, 2026, 17:02 UTC). Added modal Vim editing in composer (/vim + configurable default-mode), redesigned TUI workflow picker (easier resume/fork, raw scrollback mode), in-TUI /hooks browser, theme-aware status line with optional PR + branch-change summaries, plugin management upgrade (workspace sharing, share access controls, source filtering, marketplace operations), /goal lifecycle change (experimental goals stay paused across resume unless opted back in), Linux sandbox startup hardening, Windows sandbox reliability improvements, and Bubblewrap bump to 0.11.2 with upstream security patches. Also documented the May 2026 usage limit boost (Codex Plus 25× 5-hour limit + $100/month tier doubled, both through May 31, 2026). |
89 | |
| 2026-05-05 | Guide v2.22: Synced current guidance to CLI v0.128.0. Added persisted /goal workflows, codex update, configurable TUI keymaps, explicit permission-profile guidance, and current codex plugin marketplace command syntax. Corrected stale guidance by marking js_repl removed, replacing --full-auto examples with explicit sandbox/approval flags or permissions profiles, and flagging legacy GPT-5.2/5.1 Codex models against OpenAI’s July 23, 2026 deprecation table. |
86 87 88 | |
| 2026-04-24 | Guide v2.21: GPT-5.5 launch (April 23–24, 2026) + CLI v0.122.0–v0.125.0. GPT-5.5 is OpenAI’s new flagship — 400K context window in Codex (1M in the API), $5/$30 per MTok input/output (2× the GPT-5.4 rate, but ~20% effective increase after token-efficiency gains). Benchmarks: 82.7% Terminal-Bench 2.0 (SOTA), 84.9% GDPval, 78.7% OSWorld-Verified, 98.0% Tau2-bench Telecom. Available in Codex CLI/web/desktop and the API; recommended default for most Codex tasks. ChatGPT Plus/Pro/Business/Enterprise/Edu/Go rollout April 23; API April 24. 90+ new plugin partners including Atlassian Rovo, CircleCI, CodeRabbit, GitLab Issues, Microsoft Suite, Neon by Databricks, Remotion, Render, and Superpowers. CLI v0.122.0: filesystem deny-read glob policies + managed deny-read requirements + platform sandbox enforcement + isolated codex exec runs that ignore user config/rules; tool discovery and image generation enabled by default; higher-detail image handling with original-detail metadata for MCP and js_repl; app-server stale-prompt resolution across clients; resumed/forked threads replay token usage immediately; remote-control startup tolerates missing ChatGPT auth; MCP startup cancellation works again through app-server sessions; internal split into codex-core-plugins. CLI v0.123.0: built-in amazon-bedrock model provider with AWS profile support; /mcp verbose for full MCP diagnostics, resources, and resource templates (plain /mcp stays fast); plugin MCP loading accepts both mcpServers and top-level server maps in .mcp.json; realtime handoffs deliver transcript deltas to background agents (with explicit silent-stay option); host-specific remote_sandbox_config for remote environments; refreshed bundled model metadata (gpt-5.4 default at the time). Fixes: /copy after rollback, queued text while shell command running, VS Code WSL Unicode/dead-key input, stale proxy env restore, codex exec inheriting root-level shared flags, leaked review prompts in TUI. CLI v0.124.0: TUI quick reasoning controls (Alt+, lower / Alt+. raise); accepted model upgrades reset reasoning to new model’s default; app-server sessions manage multiple environments with per-turn environment + working-directory selection; first-class Amazon Bedrock support for OpenAI-compatible providers (AWS SigV4 signing, credential auth); remote plugin marketplaces with reliable detail lookups and larger result pages; hooks are now stable — configurable inline in config.toml and requirements.toml, observe MCP tools + apply_patch + long-running Bash sessions; eligible ChatGPT plans default to Fast service tier unless explicitly opted out. Fixes: Cloudflare cookies preserved across approved ChatGPT hosts, websocket reliability under load, permission-mode drift across side conversations, wait_agent mailbox-queue timing, local stdio MCP relative-command path resolution, startup managed-config edge cases. CLI v0.125.0 (April 24): app-server Unix socket transport, pagination-friendly resume/fork, sticky environments, remote thread config/store plumbing; app-server plugin management installs remote plugins and upgrades configured marketplaces; permission profiles round-trip across TUI sessions, user turns, MCP sandbox state, shell escalation, and app-server APIs; model providers own model discovery with AWS/Bedrock account state exposed to app clients; codex exec --json reports reasoning-token usage; rollout tracing records tool/code-mode/session/multi-agent relationships with a debug reducer command. Fixes: /review interrupt no longer wedges TUI, exec-server output/stream-closure handling, app-server respects explicitly untrusted project config, websocket disconnection during notification bursts, Windows sandbox startup and background process handling, config-schema validation for thread limits and agent paths. |
83 84 85 | |
| 2026-04-16 | Guide v2.20: CLI v0.121.0 (2026-04-15). Plugin Marketplace (codex marketplace add <source>) with GitHub, git URL, local-dir, and marketplace.json source types. TUI reverse history search (Ctrl+R) and slash-command recall. Memories menu in TUI with reset/deletion; memory reset now preserves past rollouts. Phase-2 memory consolidation model upgraded to GPT-5.4. Secure devcontainer profile with Bubblewrap sandboxing (WSL2 only; WSL1 rejected). macOS sandbox: Unix socket allowlists and private DNS unblocked. danger-full-access denylist-only mode removed — full-access is now binary. MCP tools registered with namespaces; supports_parallel_tool_calls flag plumbed through; sandbox-state metadata flows through MCP tool metadata. Guardian review sessions disable hooks. Context-percent indicator in status line; CLI update announcement surfaces new versions. Windows resume --last fixed for verbatim paths. codex-thread-store interface for local thread lookups. |
82 | |
| 2026-04-13 | Guide v2.19: CLI v0.119.0–v0.120.0. Realtime voice sessions (V2 WebRTC with configurable transport). MCP Apps with resource reads, elicitations, file uploads. codex exec-server experimental. /resume by ID or name. Ctrl+O copy latest response. Hook activity improvements in TUI. SessionStart hooks distinguish /clear. |
80 81 | |
| 2026-04-04 | Guide v2.18: Updated Business pricing ($25/mo → $20 annual). Added Codex-only pay-as-you-go seats for Business/Enterprise. | 79 | |
| 2026-04-01 | Guide v2.17 | Updated to CLI v0.118.0: Windows proxy-only sandbox networking (OS-level egress), ChatGPT device-code auth flow, codex exec prompt-plus-stdin, dynamic bearer token refresh for custom providers. .codex file protection on first creation. Linux bwrap PATH discovery fix. TUI app-server regressions fixed (hook replay, /copy, /resume <name>, /agent, skills picker scrolling). MCP startup robustness (longer startup window, warning display). Windows apply_patch ACL fix. Added GPT-5.4 mini to model table (400K context, 30% GPT-5.4 quota, 2x faster). Added Codex Security section (research preview, context-aware vulnerability detection). |
78 76 77 |
| 2026-03-31 | CLI 0.118.0 | Windows proxy-only sandbox networking via OS-level egress rules, ChatGPT device-code auth flow for app-server clients, codex exec prompt-plus-stdin workflow (piped input + separate prompt), dynamic bearer token fetch/refresh for custom model providers. Fixes: .codex file protection on first creation, Linux bwrap PATH discovery, TUI app-server regressions (hook notification replay, /copy, /resume <name>, /agent threads, skills picker scrolling), MCP startup robustness (longer startup window, failure warnings), Windows apply_patch redundant writable-root ACL churn. |
78 |
| 2026-03-17 | – | GPT-5.4 mini launch: 400K context, $0.75/$4.50 per MTok, 30% of GPT-5.4 quota, 2x faster. Available in Codex app, CLI, IDE extension, and web. Ideal for subagent/parallel subtask delegation. | 76 |
| 2026-03-06 | – | Codex Security research preview: context-aware application security review for Pro/Enterprise/Business/Edu via Codex web. Scanned 1.2M commits, 10,561 high-severity findings, 14 CVEs assigned in OpenSSH/GnuTLS/Chromium. | 77 |
| 2026-03-30 | Guide v2.16 | Updated to CLI v0.117.0: first-class plugins (product-scoped sync at startup, /plugins browser, install/remove), sub-agents v2 (path-based addresses, structured inter-agent messaging, agent listing), /title terminal-title picker, app-server TUI enabled by default (! shell commands, filesystem watch, remote WebSocket with bearer auth, prompt history recall across sessions), image workflow improvements (view_image returns URLs, generated images reopenable, history survives resume), legacy artifact tool removed (read_file and grep_files retired), Linux sandbox improvements for older distros, Windows restricted-token sandbox improvements. |
75 |
| 2026-03-28 | CLI 0.117.0 | First-class plugins with product-scoped sync at startup and /plugins TUI browser. Sub-agents v2: path-based addresses (/root/agent_a), structured inter-agent messaging, agent listing. /title terminal-title picker in TUI and app-server TUI. App-server clients: ! shell commands, filesystem watch, remote WebSocket with bearer auth. Image workflows: view_image returns URLs, generated images reopenable, history survives resume. Prompt history recall in app-server TUI across sessions. App-server TUI enabled by default. Legacy artifact tool removed; old read_file and grep_files retired. Linux sandbox improvements for older distros. Windows restricted-token sandbox improvements. |
75 |
| 2026-03-21 | Guide v2.15 | Updated to CLI v0.116.0: UserPromptSubmit hook event (5 total), ChatGPT device-code auth in app-server TUI, smoother plugin installation with suggestion allowlist and remote sync, realtime sessions start with recent thread context, reduced audio self-interruptions. Fixes: WebSocket first-turn delays, conversation history for remote resume/fork, Linux sandbox on symlinked checkouts/AppArmor, agent job finalization race condition. |
74 |
| 2026-03-19 | CLI 0.116.0 | UserPromptSubmit hook (block/augment prompts before execution), ChatGPT device-code auth in TUI, smoother plugin setup with allowlist/remote sync, realtime sessions with recent thread context, reduced audio self-interruptions. Fixes: WebSocket prewarm first-turn hangs, conversation history for remote resume/fork, Linux sandbox startup on symlinked checkouts/AppArmor, agent job finalization race. 77 PRs merged. |
74 |
| 2026-03-18 | Guide v2.14 | Updated to CLI v0.115.0: full-resolution image inspection via view_image and codex.emitImage, js_repl exposes codex.cwd/codex.homeDir, realtime WebSocket transcription mode, app-server v2 filesystem RPCs, Smart Approvals with guardian subagent (approvals_reviewer = "guardian_subagent"), Responses API tool-search. Bug fixes: subagent sandbox inheritance, js_repl U+2028/U+2029 hang, TUI exit stalls, profile settings preservation with codex exec --profile, MCP/elicitation improvements, HTTP/1 CONNECT proxy. |
73 |
| 2026-03-16 | CLI 0.115.0 | Full-resolution image inspection via view_image and codex.emitImage(..., detail: "original"), js_repl exposes codex.cwd and codex.homeDir with persistent tool references, realtime WebSocket sessions with transcription mode and v2 handoff, app-server v2 filesystem RPCs (reads/writes/copies/directory ops/path watching), Smart Approvals route through guardian subagent, app integrations use Responses API tool-search with fallback. Fixes: spawned subagents inherit sandbox/network rules more reliably, js_repl no longer hangs on U+2028/U+2029, TUI exit stalls resolved, profile settings preserved with codex exec --profile, MCP/elicitation flows improved, local network proxy serves CONNECT as HTTP/1. |
73 |
| 2026-03-13 | Guide v2.13 | App v26.312: customizable themes (color + font), revamped Automations with local/worktree execution and per-run reasoning levels. Added winget installation method. Added GPT-5.1 deprecation note (March 11 — removed from ChatGPT, auto-migrated to GPT-5.3/5.4). | 71 72 |
| 2026-03-12 | App v26.312 | Customizable themes with color controls and font selection in Settings, revamped Automations interface with local or worktree execution mode and custom reasoning levels, performance improvements. | 72 |
| 2026-03-11 | Guide v2.12 | Updated to CLI v0.114.0: experimental hooks engine (SessionStart, Stop events), experimental code mode, health check endpoints, disable system skills config, handoff transcript context, enhanced $ mention picker. Updated Hooks section with 4 events. Fixed Windows Desktop App section (now launched). Updated Quick Reference Card models to March 2026. | 70 |
| 2026-03-11 | CLI 0.114.0 | Experimental code mode for isolated coding workflows, experimental hooks engine with SessionStart and Stop events, WebSocket app-server health check endpoints (/readyz, /healthz), config switch to disable bundled system skills, handoffs carry realtime transcript context, enhanced $ mention picker with skill/app/plugin labels. Bug fixes: Linux tmux crash, reopened threads stuck mid-run, legacy permission handling, approval flow persistence. | 70 |
| 2026-03-10 | Guide v2.11 | Updated to CLI v0.113.0: @plugin mentions (v0.112.0), request_permissions tool, permission-profile config language, plugin marketplace expansion (v0.113.0). Added @plugin Mentions, Plugin Marketplace, Runtime Permission Requests, and Permission-Profile Config Language sections. | 68 69 |
| 2026-03-10 | CLI 0.113.0 | Built-in request_permissions tool for runtime permission requests, plugin marketplace discovery with richer metadata/install-time auth checks/uninstall endpoint, app-server streaming stdin/stdout/stderr with TTY/PTY support, permission-profile config language with split filesystem/network sandbox policies, image generation saves to CWD, web search settings with full tool config, hardened network proxy policy rejecting global wildcard domains | 69 |
| 2026-03-08 | CLI 0.112.0 | @plugin mentions to reference plugins in chat with auto-included context, new model-selection surface for TUI picker, executable permission profiles merged into per-turn sandbox policy for zsh-fork skill execution, JS REPL state handling fix (bindings persist after failed cells), SIGTERM treated like Ctrl-C for app-server websocket shutdown, Linux bubblewrap always unshares user namespace, macOS sandbox network/unix-socket handling improvements | 68 |
| 2026-03-06 | Guide v2.10 | Updated to CLI v0.111.0: GPT-5.4 as recommended model (1M context), fast mode default, plugin system (v0.110.0), js_repl dynamic imports, persistent /fast toggle, Windows installer. Codex App for Windows (v26.304). GPT-5.3-Codex-Spark via Cerebras partnership. Updated model table, flowchart, profiles. Added Plugins section. | 64 65 66 67 |
| 2026-03-05 | CLI 0.111.0 | Fast mode default, js_repl dynamic imports for local files, plugin discovery at session start, image workflow support, thread resumption preserves git context | 65 |
| 2026-03-05 | – | GPT-5.4 launch: flagship frontier model, 1M context, native computer use, available across all Codex surfaces | 64 |
| 2026-03-05 | CLI 0.110.0 | Plugin system for skills/MCP/app connectors, multi-agent approval prompts, persistent /fast toggle, workspace-scoped memory writes, Windows installer script | 65 |
| 2026-03-04 | App v26.304 | Codex App for Windows: native PowerShell support, native sandbox, skills/automations/worktrees without WSL | 66 |
| 2026-03-03 | App v26.303 | Worktree auto-cleanup toggle, Local-to-Worktree handoff support, explicit English language option | 66 |
| 2026-03-02 | Guide v2.9 | Updated to CLI v0.107.0: thread forking into sub-agents, realtime voice device selection, configurable memories with codex debug clear-memories, multimodal custom tool output. Added App v26.226: MCP shortcuts in composer, @mentions in review comments. |
62 63 |
| 2026-03-02 | CLI 0.107.0 | Thread forking into sub-agents, realtime voice sessions with microphone/speaker device selection, custom tools multimodal output, configurable memories + codex debug clear-memories, bug fixes |
62 |
| 2026-02-28 | Guide v2.8 | Updated to CLI v0.106.0: added direct install script, zsh-fork sandbox bypass fix, ~1M char input cap, Linux /dev filesystem, flexible approval controls, JS REPL promoted to /experimental (Node 22.22.0+), diff-based memory forgetting, TUI syntax highlighting + /theme, /copy, /clear, Ctrl-L, voice transcription, spawn_agents_on_csv, request_user_input in Default mode. Added v0.105.0 and v0.106.0 changelog entries. | 60 61 |
| 2026-02-26 | CLI 0.106.0 | Direct install script, js_repl promoted to /experimental with Node 22.22.0 min, request_user_input in Default mode, 5.3-codex visible in CLI model list for API users, diff-based memory forgetting with usage-aware selection, zsh-fork sandbox bypass fix, ~1M char input cap, improved TUI file-link rendering, Ctrl-C handling fix for sub-agents | 60 |
| 2026-02-25 | CLI 0.105.0 | TUI syntax-highlights fenced code blocks and diffs with /theme picker, voice transcription (spacebar dictation, experimental), spawn_agents_on_csv for multi-agent fanout with progress/ETA, /copy /clear Ctrl-L commands, flexible approval controls (extra sandbox permissions, granular rejection), clickable wrapped links, Linux /dev filesystem for sandboxed commands, js_repl error reporting improvements | 61 |
| 2026-02-24 | Guide v2.7 | Expanded Access/Pricing section: added Free/Go promotional tier, 2x rate limits for paid plans, per-plan usage limits (5-hour window), credit costs table. Added allow_login_shell config key. |
51 |
| 2026-02-22 | Guide v2.6 | Added missing config keys: features.multi_agent, features.apply_patch_freeform, features.search_tool, agents.* (multi-agent roles), model_context_window, model_auto_compact_token_limit, mcp_oauth_callback_port, mcp_oauth_credentials_store, notify. Added App v26.217 changelog entry. |
50 |
| 2026-02-19 | Guide v2.5 | Updated version references to CLI 0.104.0, added v0.103.0 and v0.104.0 changelog entries, added WS_PROXY/WSS_PROXY proxy support, distinct approval IDs, commit co-author attribution, replaced removed remote_models feature flag with command_attribution. |
— |
| 2026-02-18 | CLI 0.104.0 | WS_PROXY/WSS_PROXY WebSocket proxy support, distinct approval IDs for multi-step commands, thread archive/unarchive notifications | 49 |
| 2026-02-17 | App v26.217 | Drag-and-drop to reorder queued messages, model downgrade warning, improved fuzzy file search with attachment recovery after restart | 50 |
| 2026-02-17 | CLI 0.103.0 | Commit co-author attribution via prepare-commit-msg hook (configurable via command_attribution), richer app listing metadata/branding, removed remote_models feature flag |
48 |
| 2026-02-17 | Guide v2.4 | Updated all version references for CLI 0.102.0, added v0.102.0 changelog entry and footnote, updated sub-agents note with configurable multi-agent roles. | — |
| 2026-02-17 | CLI 0.102.0 | Unified permissions flow, structured network approvals, customizable multi-agent roles, model reroute notifications, js_repl stability fixes | 47 |
| 2026-02-16 | Guide v2.3 | Fixed migration table: hooks now exist (v0.99.0+), subagents acknowledged (max 6), model list complete. Added dedicated Hooks section (AfterAgent, AfterToolUse, migration patterns). Fixed Recipe 5 phantom commands (cloud start→cloud exec, cloud pull→apply). Fixed codex auth→codex login. Windows sandbox promoted from Experimental. Linux Bubblewrap now vendored/built-in. Added minimal reasoning effort level. Expanded memory section (v0.101.0 refinements, memory vs AGENTS.md). Updated AGENTS.md adopter list (60,000+ projects, Linux Foundation governance). Updated Copilot migration table. Fixed [EXPERIMENTAL] case consistency. Added ReadOnlyAccess policy documentation, JS REPL Runtime section, production Deploy skill example, expanded cost section (hidden token overhead, team cost management). Tagged 20 untagged code blocks. Verified all 30 ToC anchors. Post-evaluation fixes: /permissions terminology corrected (approval mode→approval policy), duplicate “Project Trust” header renamed, chat/completions deprecation language hedged, OpenTelemetry section expanded with config example, migration “harder to escape” language made precise. |
Deliberation audit |
| 2026-02-16 | Guide v2.2 | Added 19 historical CLI milestone releases (v0.2.0–v0.91.0) to changelog. Replaced bulk 24 citation with 20 individual release footnotes (35–59). Added 59 Apache 2.0 license citation. Added 5 citation to codex-linux-sandbox reference. Added 21 citation to MDM preference domain. Updated 6 Seatbelt note re: bot-blocking. Added note on unverifiable OpenAI blog URLs. Total footnotes: 56 (was 36). | Deliberation audit |
| 2026-02-15 | Guide v2.1 | Enterprise section corrected (managed-admin-config.toml → requirements.toml with verified TOML keys), 272K context qualified as input window with citation, 6 Seatbelt citation URL added, Key Takeaways block added, style violations fixed, meta description trimmed, AGENTS.md adopter list expanded. | Blog evaluator audit |
| 2026-02-14 | Guide v2 | Major revision: Codex-verified corrections to models (272K context), config keys, feature flags, pricing, enterprise config, CI/CD action, SDK API, MCP options, codex exec flags, desktop app features, migration comparisons. Removed unverifiable claims. | Self-review |
| 2026-02-12 | CLI 0.101.0 | Model resolution improvements, memory refinements, stability | 35 |
| 2026-02-12 | CLI 0.100.0 | Experimental JS REPL, multiple rate limits, WebSocket transport, memory commands, enhanced sandbox | 36 |
| 2026-02-12 | App v260212 | Conversation forking, floating pop-out window, Windows alpha | 17 |
| 2026-02-12 | – | GPT-5.3-Codex-Spark launch (lower-latency interactive variant) | 25 |
| 2026-02-11 | CLI 0.99.0 | Concurrent shell commands, /statusline, sortable resume picker, GIF/WebP support, shell snapshotting |
37 |
| 2026-02-06 | CLI 0.98.0 | GPT-5.3-Codex support, steer mode stable and default, model switching fixes | 38 |
| 2026-02-06 | CLI 0.97.0 | “Allow and remember” MCP approvals, live skill detection, /config diagnostics, memory plumbing |
39 |
| 2026-02-06 | CLI 0.96.0 | Async thread/compact v2, WebSocket rate limits, unified_exec non-Windows, config provenance | 40 |
| 2026-02-06 | CLI 0.95.0 | codex app command, personal skills, parallel shell tools, git hardening |
41 |
| 2026-02-05 | – | GPT-5.3-Codex launch — unified model, 25% faster, end-to-end computer operation | 26 |
| 2026-02-02 | – | Codex Desktop App launch (macOS) — multi-tasking, worktrees, automations | 16 |
| 2026-01-30 | CLI 0.94.0 | Plan mode default, personality stable, skills from .agents/skills, runtime metrics |
42 |
| 2026-01-29 | CLI 0.93.0 | SOCKS5 proxy, plan mode streaming, /apps, smart approvals default, SQLite logs |
43 |
| 2026-01-29 | CLI 0.92.0 | API v2 threads, thread filtering, MCP OAuth scopes, multi-agent collaboration | 44 |
| 2026-01-25 | CLI 0.91.0 | Reduced max sub-agents from 12 to 6 for tighter resource guardrails | 45 |
| 2026-01-21 | CLI 0.88.0 | Device-code auth fallback, collaboration modes, /fork, remote models, model_personality config |
46 |
| 2026-01-06 | CLI 0.78.0 | Ctrl+G external editor, project-aware config layering, macOS MDM config, TUI2 transcript nav, .dmg installers |
52 |
| 2025-12-18 | – | GPT-5.2-Codex launch — context compaction, refactors/migrations, cybersecurity | 27 |
| 2025-12-09 | CLI 0.66.0 | Exec policy system (TUI whitelisting, sandbox denial amendments), CRLF preservation, Linux Sigstore signing | 53 |
| 2025-11-19 | – | GPT-5.1-Codex-Max — multi-window compaction, Windows training, 30% fewer thinking tokens | 28 |
| 2025-11-19 | CLI 0.59.0 | Native compaction, tool output limit raised to 10K tokens, Windows Agent mode sandbox, credits in /status |
54 |
| 2025-10-25 | CLI 0.50.0 | /feedback diagnostics, sandbox violation risk assessment, MCP startup improvements, env var redaction |
55 |
| 2025-10-06 | – | Codex GA at DevDay — Slack integration, SDK, admin tools | 29 |
| 2025-10-06 | CLI 0.45.0 | Breaking: codex login --api-key → --with-api-key (stdin). OAuth MCP auth, parallel tool calls, pulsing dot UI |
56 |
| 2025-09-23 | – | GPT-5-Codex + IDE extension + CLI revamp — images, web search, code review | 30 |
| 2025-09-23 | CLI 0.40.0 | Default model → gpt-5-codex, auto-compaction at 220K tokens, /review commands, git undo, Windows binary support |
57 |
| 2025-06-30 | CLI 0.2.0 | First Rust binary release — pre-built binaries for macOS (aarch64/x86_64) and Linux (gnu/musl), codex-exec and codex-linux-sandbox tools |
58 |
| 2025-06 | – | Rust rewrite announced (“Codex CLI is Going Native”) | 31 |
| 2025-06-03 | – | Plus user expansion, internet access for cloud, PR updates, voice dictation | 32 |
| 2025-05-16 | – | Codex Cloud launch — cloud agent with codex-1 model, GitHub PR creation | 33 |
| 2025-04-16 | – | Codex CLI open-source launch (Apache 2.0, TypeScript, codex-mini-latest)59 | 1 |
References
Note on OpenAI blog URLs: References 16, 25–30, 33, 64, 66, 67, 76, and 77 link to
openai.com/index/blog posts which return HTTP 403 to automated access due to Cloudflare bot protection. These URLs are valid when accessed via a standard web browser.
-
GitHub — openai/codex — Open-source repository, releases, and discussions. ↩↩↩
-
Codex CLI Windows Support — Windows installation and WSL guidance. ↩
-
Codex IDE Extension — VS Code, Cursor, and Windsurf integration. ↩
-
Codex Cloud — Cloud task documentation and internet access controls. ↩↩
-
Codex Security — Sandbox architecture and security model. ↩↩↩
-
macOS Seatbelt Sandbox — Community documentation for Apple’s sandbox-exec framework (no official Apple developer docs published). Note: this wiki may block automated access (HTTP 403); see also
man sandbox-execon macOS. ↩↩↩ -
Linux Landlock LSM — Kernel filesystem access control. ↩
-
Breaking Out of the Sandbox — Community sandbox configuration patterns. ↩
-
AGENTS.md Open Standard — Cross-tool instruction standard under the Linux Foundation. ↩
-
Custom Instructions with AGENTS.md — Official guide. ↩
-
Codex MCP Integration — MCP server configuration and management. ↩
-
Building Workflows with Agents SDK — Codex as MCP server for multi-agent orchestration. ↩
-
Agent Skills — Skills system documentation. ↩
-
Codex CLI Features — Plan mode, steer mode, and collaboration features. ↩↩
-
Non-Interactive Mode —
codex execdocumentation. ↩ -
Introducing the Codex App — Desktop app launch announcement. ↩↩↩↩
-
Codex App Documentation — Desktop app features and troubleshooting. ↩
-
Codex GitHub Action — CI/CD integration. ↩
-
Codex Pricing — Subscription and API pricing. ↩
-
Codex Configuration Reference — Enterprise requirements.toml schema and MDM distribution. ↩↩↩
-
Best Practices for Using Codex — Community forum thread. ↩
-
feiskyer/codex-settings — Community-maintained configurations, skills, and prompts. ↩
-
Codex CLI Releases — GitHub release notes. ↩↩
-
Introducing GPT-5.3-Codex-Spark — Cerebras partnership, 1000+ tok/s. ↩↩
-
Introducing GPT-5.3-Codex — Unified model launch. ↩
-
Introducing GPT-5.2-Codex — Context compaction and large-scale changes. ↩
-
Building More with GPT-5.1-Codex-Max — Multi-window compaction. ↩
-
Codex is Now Generally Available — DevDay 2025 announcement. ↩
-
Introducing Upgrades to Codex — GPT-5-Codex + IDE extension. ↩↩
-
Codex CLI is Going Native — Rust rewrite discussion. ↩
-
Codex Updates: Internet Access and Plus Rollout — June 2025 expansion. ↩
-
Introducing Codex — Cloud agent launch. ↩↩
-
Deprecating chat/completions support in Codex — OpenAI announced chat/completions API removal for Codex, completed February 2026. ↩
-
Codex CLI v0.101.0 — Model resolution improvements, memory refinements, stability. February 12, 2026. ↩↩
-
Codex CLI v0.100.0 — Experimental JS REPL, multiple rate limits, WebSocket transport, memory commands, enhanced sandbox. February 12, 2026. ↩
-
Codex CLI v0.99.0 — Concurrent shell commands,
/statusline, sortable resume picker, GIF/WebP support, shell snapshotting. February 11, 2026. ↩ -
Codex CLI v0.98.0 — GPT-5.3-Codex support, steer mode stable and default, model switching fixes. February 6, 2026. ↩
-
Codex CLI v0.97.0 — “Allow and remember” MCP approvals, live skill detection,
/configdiagnostics, memory plumbing. February 6, 2026. ↩ -
Codex CLI v0.96.0 — Async thread/compact v2, WebSocket rate limits, unified_exec non-Windows, config provenance. February 6, 2026. ↩
-
Codex CLI v0.95.0 —
codex appcommand, personal skills, parallel shell tools, git hardening. February 6, 2026. ↩ -
Codex CLI v0.94.0 — Plan mode default, personality stable, skills from
.agents/skills, runtime metrics. January 30, 2026. ↩ -
Codex CLI v0.93.0 — SOCKS5 proxy, plan mode streaming,
/apps, smart approvals default, SQLite logs. January 29, 2026. ↩ -
Codex CLI v0.92.0 — API v2 threads, thread filtering, MCP OAuth scopes, multi-agent collaboration. January 29, 2026. ↩
-
Codex CLI v0.91.0 — Reduced max sub-agents from 12 to 6 for tighter resource guardrails. January 25, 2026. ↩
-
Codex CLI v0.88.0 — Device-code auth fallback, collaboration modes,
/fork, remote models,model_personalityconfig. January 21, 2026. ↩ -
Codex CLI v0.102.0 — Unified permissions flow, structured network approvals, customizable multi-agent roles, model reroute notifications. February 17, 2026. ↩↩
-
Codex CLI v0.103.0 — Commit co-author attribution via prepare-commit-msg hook, richer app listing metadata/branding, removed
remote_modelsfeature flag. February 17, 2026. ↩ -
Codex CLI v0.104.0 — WS_PROXY/WSS_PROXY WebSocket proxy support, distinct approval IDs for commands, thread archive/unarchive notifications. February 18, 2026. ↩↩↩
-
Codex Changelog — Codex App v26.217: drag-and-drop reorder, model downgrade warning, fuzzy file search improvements. Codex Config Reference — Complete configuration key reference. February 2026. ↩↩
-
Codex Pricing — Plan tiers, usage limits per 5-hour window, credit costs, and Free/Go promotional access. February 2026. ↩↩
-
Codex CLI v0.78.0 —
Ctrl+Gexternal editor, project-aware config layering, macOS MDM config, TUI2 transcript nav,.dmginstallers. January 6, 2026. ↩ -
Codex CLI v0.66.0 — Exec policy system, CRLF preservation on Windows, cloud exec
--branch, Linux Sigstore signing. December 9, 2025. ↩ -
Codex CLI v0.59.0 — Native compaction, tool output limit raised to 10K tokens, Windows Agent mode sandbox, credits in
/status. November 19, 2025. ↩ -
Codex CLI v0.50.0 —
/feedbackdiagnostics, sandbox violation risk assessment, MCP startup improvements, env var redaction. October 25, 2025. ↩ -
Codex CLI v0.45.0 — Breaking:
codex login --api-key→--with-api-key(stdin). OAuth MCP auth, parallel tool calls. October 6, 2025. ↩ -
Codex CLI v0.40.0 — Default model →
gpt-5-codex, auto-compaction at 220K tokens,/reviewcommands, git undo, Windows binary. September 23, 2025. ↩ -
Codex CLI v0.2.0 — First Rust binary release. Pre-built binaries for macOS (aarch64/x86_64) and Linux (gnu/musl),
codex-execandcodex-linux-sandboxtools. June 30, 2025. ↩ -
GitHub — openai/codex LICENSE — Apache License 2.0. Original open-source launch April 2025. ↩↩↩
-
Codex CLI v0.106.0 — Direct install script, js_repl promoted to /experimental (Node 22.22.0+), request_user_input in Default mode, diff-based memory forgetting, zsh-fork sandbox bypass fix, ~1M char input cap, Ctrl-C sub-agent fix. February 26, 2026. ↩↩↩↩↩↩↩↩↩↩
-
Codex CLI v0.105.0 — TUI syntax highlighting with /theme, voice transcription, spawn_agents_on_csv, /copy /clear Ctrl-L, flexible approval controls, Linux /dev filesystem, js_repl error recovery. February 25, 2026. ↩↩↩↩↩↩↩↩↩
-
Codex CLI v0.107.0 — Thread forking into sub-agents, realtime voice device selection, custom tools multimodal output, configurable memories with
codex debug clear-memories. March 2, 2026. ↩↩↩↩↩↩ -
Codex Changelog — App v26.226 — MCP shortcuts in composer, @mentions in review comments, Mermaid diagram error handling. February 26, 2026. ↩↩↩
-
Introducing GPT-5.4 — Flagship frontier model combining GPT-5.3-Codex coding with stronger reasoning, native computer use, and 1M context windows. March 5, 2026. ↩↩↩↩↩
-
Codex CLI v0.110.0–v0.111.0 — Plugin system for skills/MCP/app connectors (v0.110.0), fast mode default, js_repl dynamic imports, plugin discovery at session start (v0.111.0). March 5, 2026. ↩↩↩↩↩
-
Codex App for Windows — Native Windows app with PowerShell support, native sandbox, skills/automations/worktrees. App v26.304 (March 4, 2026), v26.303 (March 3, 2026). ↩↩↩↩↩↩
-
Introducing GPT-5.2-Codex — GPT-5.3-Codex-Spark: text-only research preview model optimized for near-instant coding iteration. Available for ChatGPT Pro users via Cerebras partnership. 128K context. ↩↩↩
-
Codex CLI v0.112.0 — @plugin mentions with auto-included context, TUI model-selection surface, executable permission profiles in per-turn sandbox policy, JS REPL state fix, SIGTERM handling, Linux bubblewrap user namespace, macOS sandbox improvements. March 8, 2026. ↩↩↩
-
Codex CLI v0.113.0 — Built-in request_permissions tool, plugin marketplace expansion (metadata, auth checks, uninstall), app-server streaming with TTY/PTY, permission-profile config language, image generation saves to CWD, web search tool settings, hardened network proxy policy. March 10, 2026. ↩↩↩↩
-
Codex CLI v0.114.0 — Experimental code mode, experimental hooks engine (SessionStart, Stop events), WebSocket health check endpoints, disable system skills config, handoff transcript context, enhanced $ mention picker. March 11, 2026. ↩↩↩↩
-
OpenAI Developer Changelog — March 11, 2026 — GPT-5.1 models removed from ChatGPT; existing conversations auto-continue on GPT-5.3 Instant, GPT-5.4 Thinking, or GPT-5.4 Pro. ↩↩
-
Codex Changelog — App v26.312 — Customizable themes with color controls and font selection, revamped Automations interface with local/worktree execution and custom reasoning levels, performance improvements. March 12, 2026. ↩↩↩↩
-
Codex CLI v0.115.0 — Full-resolution image inspection via
view_imageandcodex.emitImage,js_replexposescodex.cwd/codex.homeDir, realtime WebSocket transcription mode, app-server v2 filesystem RPCs, Smart Approvals with guardian subagent, Responses API tool-search. Fixes: subagent sandbox inheritance, js_repl U+2028/U+2029 hang, TUI exit stalls, profile settings preservation, MCP/elicitation improvements. March 16, 2026. ↩↩↩ -
Codex CLI v0.116.0 —
UserPromptSubmithook event, ChatGPT device-code auth in app-server TUI, smoother plugin installation with suggestion allowlist and remote sync, realtime sessions with recent thread context, reduced audio self-interruptions. Fixes: WebSocket prewarm first-turn hangs, conversation history for remote resume/fork, Linux sandbox on symlinked checkouts/AppArmor, agent job finalization race. 77 PRs merged. March 19, 2026. ↩↩ -
Codex CLI v0.117.0 — First-class plugins (product-scoped sync,
/pluginsbrowser, install/remove), sub-agents v2 (path-based addresses, structured messaging, agent listing),/titleterminal-title picker, app-server TUI enabled by default with!shell commands/filesystem watch/remote WebSocket bearer auth/prompt history recall, image workflows (view_imageURLs, reopenable generated images, resume-surviving history), legacy artifact/read_file/grep_files tools removed, Linux sandbox improvements for older distros, Windows restricted-token sandbox improvements. March 28, 2026. ↩↩↩↩↩↩↩↩↩↩↩↩↩ -
Introducing GPT-5.4 mini and nano — GPT-5.4 mini: 400K context, $0.75/$4.50 per MTok, 30% of GPT-5.4 quota, 2x faster. Available in Codex app, CLI, IDE extension, and web. March 17, 2026. ↩↩↩↩↩
-
Codex Security: now in research preview — Context-aware application security review. Pro/Enterprise/Business/Edu via Codex web. Scanned 1.2M commits, 10,561 high-severity findings, 14 CVEs assigned. March 6, 2026. ↩↩↩↩↩
-
Codex CLI v0.118.0 — Windows proxy-only sandbox networking, ChatGPT device-code auth,
codex execprompt-plus-stdin, dynamic bearer tokens, .codex file protection, Linux bwrap fix, TUI app-server regressions, MCP startup robustness, Windows apply_patch fix. March 31, 2026. ↩↩ -
Codex now offers pay-as-you-go pricing for teams. OpenAI, April 2, 2026. Business annual pricing reduced to $20/seat/mo. Codex-only seats available for Business and Enterprise with token-based billing, no fixed seat fee, no rate limits. ↩↩
-
Codex CLI v0.119.0. “v0.119.0: Realtime voice V2 (WebRTC, configurable transport, voice selection, native TUI media), MCP Apps (resource reads, tool-call metadata, elicitations, file uploads), remote workflows (egress websocket,
--cdforwarding,codex exec-server),Ctrl+Ocopy response,/resumeby ID/name, Warp OSC 9 notifications.” April 10, 2026. ↩ -
Codex CLI v0.120.0. “v0.120.0: Realtime V2 streams background agent progress, hook activity UI improvements, SessionStart hooks distinguish
/clear, MCPoutputSchemain code mode, Windows sandbox symlink handling, tool search ordering fix.” April 11, 2026. ↩ -
Codex CLI v0.121.0. April 15, 2026. Plugin Marketplace (
codex marketplace addfor GitHub, git URL, local dir,marketplace.jsonURL) + app-server counterpart (#17087, #17717, #17756). TUI reverse history searchCtrl+Rwith slash-command recall (#17550, #17336). TUI memories menu with reset button and per-memory deletion (#17632, #17626, #17913, #17937, #17844). Phase-2 memory consolidation model upgraded to GPT-5.4 (#17384). Memory reset preserves past rollouts (#17919). Secure devcontainer profile using Bubblewrap (WSL2 only; WSL1 rejected) (#10431, #17547, #17559). macOS sandbox: Unix socket allowlists (#17654), private DNS unblocked (#17370).danger-full-accessdenylist-only mode removed (#17732). MCP Apps tool-call support (#17364), MCP tool namespaces (#17404),supports_parallel_tool_callsflag plumbing (#17667), sandbox-state metadata via MCP tool metadata (#17763, #17957), flattened deferred tool calls (#17556). Guardian review disables hooks (#17872). Context-percent indicator in status line (#17637, #17420). CLI update announcement (#17942).codex-thread-storeinterface (#17659, #17824). Windowsresume --lastverbatim-path fix (#17414). 180+ commits total. See alsorust-v0.120.0...rust-v0.121.0compare URL for full PR list. ↩↩↩↩↩↩↩↩↩↩↩↩ -
Introducing GPT-5.5. OpenAI announcement, April 23, 2026. Context window: 400K in Codex, 1M in the API (per OpenAI’s GPT-5.5-in-Codex availability page and the GPT-5.5 API model docs respectively). Pricing (API): $5 input / $30 output per MTok (2× the GPT-5.4 rate; OpenAI states ~20% effective increase after token-efficiency improvements). Benchmarks: 82.7% Terminal-Bench 2.0 (current SOTA across publicly available models), 84.9% GDPval (44 occupations), 78.7% OSWorld-Verified (real-computer operation), 98.0% Tau2-bench Telecom (no prompt tuning). Available in Codex CLI/web/desktop on April 23 for ChatGPT Plus/Pro/Business/Enterprise/Edu/Go; available in the OpenAI API on April 24. OpenAI’s stated guidance: “GPT-5.5 is now available in Codex as OpenAI’s newest frontier model for complex coding, computer use, knowledge work, and research workflows, and is the recommended choice for most Codex tasks.” See also: Introducing upgrades to Codex (April 17, 2026 — background computer use, 90+ new plugin partners including Atlassian Rovo, CircleCI, CodeRabbit, GitLab Issues, Microsoft Suite, Neon by Databricks, Remotion, Render, and Superpowers); NVIDIA blog: GPT-5.5 Powers Codex on NVIDIA Infrastructure; TechCrunch: OpenAI releases GPT-5.5. ↩↩↩↩↩↩
-
Codex CLI v0.122.0 and v0.123.0. v0.122.0: filesystem deny-read glob policies + managed deny-read requirements + platform sandbox enforcement + isolated
codex execruns that ignore user config or rules; tool discovery and image generation enabled by default; higher-detail image handling and original-detail metadata for MCP andjs_repl; app-server stale-prompt resolution across clients; resumed/forked threads replay token usage immediately; remote-control startup tolerates missing ChatGPT auth; MCP startup cancellation works again through app-server sessions; internal split intocodex-core-pluginsand connector reorg. v0.123.0 (April 23, 2026): built-inamazon-bedrockmodel provider with configurable AWS profile support;/mcp verbosefor full MCP server diagnostics, resources, and resource templates while keeping plain/mcpfast; plugin MCP loading accepts bothmcpServersand top-level server maps in.mcp.json; realtime handoffs deliver transcript deltas to background agents and allow explicit silent-stay; host-specificremote_sandbox_configrequirements for remote environments; refreshed bundled model metadata. Fixes:/copyafter rollback copies latest visible assistant response (not pre-rollback), follow-up text submitted while a manual shell command runs is queued (no more stuckWorkingstates), Unicode/dead-key input in VS Code WSL terminals (enhanced keyboard mode disabled there), stale proxy env vars not restored from shell snapshots,codex execinherits root-level shared flags such as sandbox and model options, leaked review prompts removed from TUI transcripts. ↩↩↩ -
Codex CLI v0.124.0 and v0.125.0. v0.124.0 (April 23, 2026): TUI quick reasoning controls (
Alt+,lower,Alt+.raise) with model-upgrade reasoning resets to new model’s defaults; app-server sessions manage multiple environments with per-turn environment + working-directory selection for remote setups; first-class Amazon Bedrock support for OpenAI-compatible providers (AWS SigV4 signing, AWS credential auth); remote plugin marketplaces with reliable detail lookups and larger result pages; hooks now stable — configurable inline inconfig.tomlandrequirements.toml, observe MCP tools plusapply_patchand long-running Bash sessions; eligible ChatGPT plans default to the Fast service tier unless explicitly opted out. Fixes: Cloudflare cookies preserved across approved ChatGPT hosts (auth-failure reduction), websocket event draining under load + cleaner shutdown, permission-mode drift survives side conversations,wait_agentreturns promptly when mailbox work is queued, local stdio MCP launches for relative commands without explicitcwduse correct path resolution, startup managed-config edge cases (unknown feature requirements warn instead of abort, cloud-requirement errors are clearer). v0.125.0 (April 24, 2026): app-server integrations support Unix socket transport, pagination-friendly resume/fork, sticky environments, remote thread config/store plumbing; app-server plugin management installs remote plugins and upgrades configured marketplaces; permission profiles round-trip across TUI sessions, user turns, MCP sandbox state, shell escalation, and app-server APIs; model providers own model discovery with AWS/Bedrock account state exposed to app clients;codex exec --jsonreports reasoning-token usage for programmatic consumers; rollout tracing records tool, code-mode, session, and multi-agent relationships, with a debug reducer command. Fixes:/reviewinterrupt no longer wedges the TUI, exec-server output handling and stream closure improved, app-server respects explicitly untrusted project config, websocket client disconnection issues during notification bursts, Windows sandbox startup and background process handling, config-schema validation strengthened for thread limits, agent paths, and MIME types. ↩↩↩ -
Codex CLI v0.128.0. Released April 30, 2026. Adds persisted
/goalworkflows,codex update, configurable TUI keymaps, expanded permission profiles, plugin marketplace improvements, external agent session import, and MultiAgentV2 configuration updates; fixes resume/interruption, TUI, network, Windows sandbox, Bedrock, MCP, and plugin edge cases; deprecates--full-auto; removesjs_repl. ↩↩↩↩↩↩↩ -
OpenAI Codex configuration reference and Codex sandbox configure defaults. Accessed May 5, 2026. Documents
approval_policy,sandbox_mode,default_permissions,[permissions.<name>.filesystem],[permissions.<name>.network], built-in permission profiles, andon-failuredeprecation. ↩↩↩↩↩↩ -
OpenAI API deprecations: 2026-04-22 legacy GPT model snapshots. Accessed May 5, 2026. Lists July 23, 2026 shutdowns for legacy Codex-related model snapshots including
gpt-5.2-codexandgpt-5.1-codex-mini, withgpt-5.4andgpt-5.4-minisubstitutes. ↩↩↩ -
Codex CLI v0.129.0. Released May 7, 2026, 17:02 UTC. Adds modal Vim editing in the composer (
/vimcommand, configurable default-mode), redesigned TUI workflow picker (easier resume/fork, raw scrollback mode), in-TUI/hooksbrowser for discovery and toggle of lifecycle hooks, theme-aware status line with optional PR + branch-change summaries, plugin management upgrade (workspace sharing, share access controls, source filtering, marketplace operations from/plugins),/goallifecycle change (experimental goals stay paused across resume unless opted back in — changes prior v0.128.0 default behavior), Linux sandbox startup hardening, Windows sandbox reliability improvements, and a vendored Bubblewrap bump to 0.11.2 with upstream security patches. See also: Codex Changelog and Codex CLI page — the latter documents the May 2026 usage limit boost (Codex Plus 25× 5-hour limit and $100/month tier doubled, both through May 31, 2026). ↩↩↩↩↩↩↩↩↩↩↩↩↩ -
Codex for Chrome and the May 7, 2026 entry on the Codex Changelog. Per the announcement: “With the new extension for Chrome, Codex is even better at working with apps and websites in your browser. It works in parallel across tabs in the background without taking over your browser, and you stay in control of which websites Codex can use.” ↩↩↩↩↩
-
Codex CLI v0.130.0. Released May 8, 2026, 23:09 UTC. New features:
codex remote-controltop-level command for headless app-server entrypoint (#21424); plugin details show bundled hooks, plugin sharing exposes link metadata + discoverability controls + share settings updates (#21447, #21495, #21637); app-server thread pagination with unloaded / summary / full turn item views (#21566); Bedrock auth via AWSaws loginconsole-login credentials (#21623);view_imageresolves through the selected environment for multi-environment sessions (#21143). Bug fixes: live app-server threads pick up config changes without restart (#21187); turn diffs stay accurate acrossapply_patchoperations including partial failures (#21180, #21518); thread summaries / renames / resume / fork viaThreadStore, including pathless threads (#21264, #21265, #21266); remote compaction emitsresponse.processedfor v2 streams + omitsservice_tieron API-key compact requests (#21642, #21676); Windows sandbox setup grants sandbox users access to the desktop runtime binary cache (#21564);codex execstartup banner no longer prints “research preview” wording (#21683). Chores: configurable OpenTelemetry trace metadata + richer review/feedback analytics (#21556, #18747, #21434, #21498); Cargo profiling build profile, Dependabot cooldown,cargo-shearupgrade, fully qualified GitHub Action pins (#21436, #21547, #21574, #21584, #21599); removed unused device-key APIs / extra skills roots / remote thread-store impl / string-keyed MCP tool maps (#21487, #21485, #21596, #21454). Compare URL:rust-v0.129.0...rust-v0.130.0. See also: Codex Changelog. ↩↩↩↩↩↩↩↩↩↩↩↩ -
Codex Changelog. May 5, 2026 entry — GPT-5.5 Instant rolled out to free tier; v0.131.0 alpha line in progress (alpha.1, alpha.2, alpha.4) on May 9, 2026 — pre-release builds, not yet promoted to stable. ↩↩