
OpenAI Codex CLI 2026: What apply_patch Actually Does, and Why the Tool Description Matters
OpenAI Codex CLI is a terminal-based AI coding agent that reads your codebase, writes and edits files, runs tests, and commits changes — all from your command line. Unlike web-based AI tools, Codex CLI runs locally against your actual repository, understanding real project context rather than a pasted snippet. Revised 18 November 2026. This revision adds a mechanics section on the apply_patch tool — the envelope it emits, the grammar the parser enforces and the sandbox check that decides whether you are asked — and withdraws several usage figures that earlier revisions repeated without a primary source: weekly active users, npm download totals, GitHub stars, the share of the codebase written in Rust, and the claimed start-up and memory deltas. Those numbers could not be re-verified from source during this revision, so they are removed rather than restated. A correction pass the same day narrowed two statements to what the pinned source actually says: the slash-command table is a selection from a 66-variant enum rather than the enum itself, and patch auto-approval covers the profiles that apply no outer sandbox as well as the sandboxed branch. ...