Full-Code · Coding Agentsactive

Codex CLI

Type: full-code  ·  Vendor: OpenAI  ·  Language: Rust, TypeScript  ·  License: Apache-2.0  ·  Status: active  ·  Status in practice: mature  ·  First released: 2025-04-13

Links: homepage docs repo

OpenAI's first-party terminal coding agent: a lightweight Rust CLI that runs models from OpenAI inside a sandbox with a configurable approval policy, AGENTS.md project memory, MCP, and an apply_patch primitive for safe diff application.

Description. Codex CLI is the terminal version of OpenAI's Codex agent. It runs locally, signs in via ChatGPT subscription or API key, and operates inside a layered sandbox where the user picks both a sandbox mode (read-only / workspace-write / danger-full-access) and an approval policy (untrusted / on-request / never). The agent reads AGENTS.md files for project conventions, calls MCP servers in both the CLI and IDE extension, and applies edits via the apply_patch tool. A /plan slash command proposes an execution plan before implementation, and /resume continues prior sessions.

Agent loop shape. ReAct-style tool-use loop running entirely inside a sandbox. Each turn: model proposes an action; the sandbox+approval policy decides whether to execute, ask, or refuse; the action runs; output goes back to the model; repeat. AGENTS.md files are read at startup to assemble a layered instruction chain. apply_patch is the diff-editing primitive; /plan switches into a planning mode; /resume picks up a saved conversation.

Primary use cases

  • terminal-native coding agent with sandboxed execution
  • approval-gated automation across sandbox modes
  • MCP-tool integration in the CLI and IDE extension
  • shared AGENTS.md project conventions across editors
  • plan-then-execute and session resume workflows

Key concepts

  • Sandbox modes sandbox-isolation (docs)read-only / workspace-write / danger-full-access selectors gate filesystem and network reach.
  • Approval policies approval-queue (docs)untrusted / on-request / never decide when the user is asked.
  • AGENTS.md cross-session-memoryLayered project instructions read at startup.
  • MCP mcp (docs)First-class MCP client; shared config between CLI and IDE.
  • apply_patch code-as-action (docs)Structured-diff tool for create/update/delete file operations.
  • Slash commands/permissions, /mcp, /plan, /resume in the TUI.

Patterns this full-code implements

Neighbourhood

Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.