OpenAI Codex: Features and Practical Usage Guide

Official documentation refresh — August 19, 2026. This guide includes the material ChatGPT and Codex updates published in the official August 10–18, 2026 update window. The canonical pages now resolve under learn.chatgpt.com/docs/codex; the developers.openai.com/codex/... links in this guide remain supported entry points. Product availability, entitlement, pricing, and the model selector vary by account and surface, so verify them in your current Codex UI before relying on them.

Current official updates (August 10-18, 2026)

The official Codex manual and ChatGPT & Codex changelog record the following recent changes. Treat these as dated product notes, not permanent guarantees:

1. What Codex Is

Codex is OpenAI's coding agent for software development. It can read a codebase, edit files, run commands, inspect tool output, review diffs, debug failures, and call configured tools when needed.

Think of Codex as a development teammate that works best when the task is scoped and verifiable. Give it the goal, context, constraints, and done criteria; then ask it to implement, test, and summarize what changed.

2. What Codex Can Help With

Codex is useful for:

Best results usually come from tasks that can be checked with a command, test, screenshot, or review step.

3. Choose the Right Surface

SurfaceBest forStrengthsNotes
Codex desktop appDesktop work, multiple threads, visual review, worktrees, and automationsRich UI, Git tools, terminal, browser preview, and artifact viewerThe current official docs describe the ChatGPT desktop app as Codex; feature access varies by platform and account
CLITerminal-first work, remote machines, scripts, CI-like workflowsFast, composable, supports codex execMention paths explicitly
IDE ExtensionEditor-attached workOpen files and selected code become contextGreat for short feedback loops
CloudParallel or async hosted tasksOffloads long workRequires GitHub and a cloud environment
GitHubPull request review and fixes@codex review, @codex fix...Requires Codex cloud and review setup
Slack / LinearDelegating from collaboration toolsStarts cloud tasks from existing contextRequires connectors and environments

Quick rule:

4. Interface Tour

Codex App

Codex App review pane

The Codex desktop app is the local workspace for threads, diffs, reviews, Git actions, local terminals, worktrees, automations, browser preview, and artifacts. Treat individual capabilities as version- and account-dependent; verify them in the app before making them part of a team workflow.

Codex CLI

Codex CLI splash

The CLI runs Codex in the terminal. Use it interactively with codex or non-interactively with codex exec.

IDE Extension

Codex IDE extension

The IDE Extension brings Codex into VS Code-compatible editors. It can use open files, selected code, and editor context.

In-app Browser

Codex in-app browser

The in-app browser previews local development servers, file-backed previews, and public pages that do not require sign-in.

Browser Comments

Codex browser annotations

Browser comments let you mark a page region and ask Codex to address that exact visual feedback.

Artifact Viewer

Codex artifact viewer

The Codex App can preview non-code artifacts such as documents, spreadsheets, presentations, and PDFs.

Automations

Codex automations

Automations can run scheduled checks, reminders, monitors, or recurring follow-up tasks.

Floating Pop-out

Codex floating pop-out

The floating pop-out keeps an active thread visible next to your browser, editor, or preview window.

Browser Developer Mode

Codex browser developer mode

Browser Developer Mode can enable deeper Chrome DevTools Protocol access for profiling and debugging, subject to workspace policy.

5. First-Run Workflow

1. Start at the repository root:

```bash

codex

```

2. Ask Codex to inspect the project before editing:

```text

Read this repository structure. Identify the build, test, lint commands, main source folders, and project conventions. Do not edit files yet.

```

3. Create or improve AGENTS.md:

```text

Generate an AGENTS.md for this repository. Include setup commands, tests, linting, coding conventions, review expectations, and done criteria.

```

4. Start with a small, verifiable task:

```text

Fix this failing test without changing the public API. After the fix, run the smallest relevant test and report the command and result.

```

5. Review the diff:

```text

/review

```

6. Prompting That Works

A strong Codex prompt usually includes four things:

Template:


Goal:
<What you want changed>

Context:
- Files: @src/foo.ts @src/foo.test.ts
- Current behavior: ...
- Related example: ...

Constraints:
- Do not change the public API
- Reuse existing helpers
- Do not add dependencies unless you explain why first

Done when:
- Add or update tests
- Run <specific command>
- Summarize changes and verification

For complex work, start with Plan mode:


/plan Investigate the authentication flow and propose a migration plan. Do not edit files yet.

When the requirement is fuzzy, ask Codex to interview you first:


I have a vague idea for improving dashboard performance. Ask me the key questions needed to define scope, metrics, and acceptance criteria before writing code.

7. Threads, Context, Plan Mode, and Goal Mode

A thread is one continuous Codex session: prompts, model output, file reads, edits, commands, approvals, and follow-ups. Keep related work in one thread, but avoid running two threads that edit the same files at the same time.

Local threads run on your machine. Cloud threads run in isolated cloud environments and are useful for async or parallel work.

Codex manages a model context window. Long tasks may be compacted automatically, and you can use /compact to summarize old context.

Use Plan mode when the task is ambiguous or high risk:


/plan Propose the implementation steps and verification strategy. Do not modify files yet.

Use Goal mode for longer work:


/goal Migrate this project to TypeScript. The app should compile in strict mode without explicit any types.

Good goals are specific and measurable.

8. Approvals, Sandboxing, and Security

Codex safety is controlled by two layers:

Common sandbox modes:

ModeBehaviorUse case
read-onlyInspect files without automatic editsResearch and review
workspace-writeRead and edit inside the workspaceDefault local development
danger-full-accessNo sandbox boundaryOnly in externally isolated trusted environments

Common approval policies:

PolicyBehaviorUse case
untrustedAsk before commands outside the trusted setMore cautious runs
on-requestWork inside sandbox, ask when crossing boundariesInteractive development
neverDo not ask for approvalsNon-interactive automation with safe constraints

Recommended local default:


codex --sandbox workspace-write --ask-for-approval on-request

Read-only investigation:


codex --sandbox read-only --ask-for-approval on-request

Network access for commands is normally separate from web search. Enable command network access only when needed:


[sandbox_workspace_write]
network_access = true

9. Configuration

User configuration lives at:


~/.codex/config.toml

Project configuration can live at:


.codex/config.toml

Project config loads only for trusted projects. Precedence is:

1. CLI flags and --config.

2. Project .codex/config.toml, closest wins.

3. Selected profile file.

4. User ~/.codex/config.toml.

5. System config.

6. Built-in defaults.

Common settings:


model = "gpt-5.6"
model_reasoning_effort = "high"
approval_policy = "on-request"
sandbox_mode = "workspace-write"
web_search = "cached"

[sandbox_workspace_write]
network_access = false

[features]
multi_agent = true
hooks = true
fast_mode = true

One-off overrides:


codex --model gpt-5.6
codex -c model='"gpt-5.6"'
codex -c sandbox_workspace_write.network_access=true

10. Models and Reasoning

The current Codex configuration documentation uses gpt-5.6 in its example. OpenAI's current platform latest-model resolver returns gpt-5.6-sol, but that does not mean every Codex surface or account can select that exact platform model. Use the model picker or /model to confirm the models available to your account before setting a persistent configuration. The August 31, 2026 retirement notice applies to gpt-5.4 and gpt-5.4-mini for ChatGPT-authenticated Codex users; migrate saved settings to gpt-5.6-terra and gpt-5.6-luna respectively, then verify workspace availability.

General guidance:

TaskSuggested setup
Complex debugging, review, or migrationUse the strongest coding model available in your Codex selector with high reasoning
Normal implementation and testsStart with gpt-5.6 where it is available; use medium or high reasoning as task complexity requires
Fast exploration or supporting subagentsChoose an account-available lower-latency model and keep the task narrow
Time-sensitive model choiceRecheck the live model selector and official model guidance; names and entitlements change

Fast mode can increase speed at higher credit consumption:


/fast on
/fast off
/fast status

11. Codex App Tips

Use Codex App when you want visual workflows:

For front-end work, keep a floating Codex thread next to the browser or preview window and iterate with visual feedback.

12. Codex CLI Tips

Start interactive mode:


codex
codex "Explain this codebase to me"

Resume work:


codex resume
codex resume --last
codex resume --all
codex resume <SESSION_ID>

Run a one-shot task:


codex exec "fix the CI failure"

Attach images:


codex -i screenshot.png "Explain this error"
codex --image img1.png,img2.jpg "Summarize these diagrams"

Useful slash commands:

CommandPurpose
/permissionsChange permission mode
/modelChange model and reasoning
/planPlan before editing
/goalSet or manage a long-running goal
/reviewReview the current diff
/diffShow Git diff
/mentionAttach files or folders
/mcpList MCP tools
/skillsUse a skill
/compactSummarize context
/statusInspect session state

13. IDE Extension Tips

The IDE Extension works well when your editor context matters. It can use open files, selected ranges, and @file references.

Example:


Use @example.tsx as a reference to add a new page named Resources.

If Codex seems to miss the current file, check IDE context or explicitly mention the file.

14. Cloud, GitHub, Slack, and Linear

Codex Cloud is useful for long-running or parallel tasks. It requires a configured cloud environment and a GitHub repository.

CLI:


codex cloud
codex cloud exec --env ENV_ID "Summarize open bugs"

GitHub PR review:


@codex review

Ask Codex to fix a finding:


@codex fix the P1 issue

Slack and Linear can start cloud tasks from comments or threads when their connectors are configured.

15. AGENTS.md

AGENTS.md is durable guidance for Codex. Use it for repository-specific commands, conventions, review expectations, and verification steps.

Good contents:

Example:


# AGENTS.md

## Repository expectations

- Use pnpm, not npm.
- Run `pnpm typecheck` after TypeScript changes.
- Do not change public APIs unless explicitly requested.
- Explain before adding production dependencies.

## Review guidelines

- Prioritize correctness, security, regressions, and missing tests.
- Do not raise style-only comments as high-priority findings.

When Codex repeats the same mistake, ask for a retrospective and update AGENTS.md.

16. Skills, Plugins, MCP, Hooks, and Rules

Skills package reusable task workflows:


$skill-creator

Use Skills for repeated workflows such as document generation, security scanning, framework migrations, or release checks.

Plugins are installable bundles that can include skills, MCP configuration, hooks, app mappings, and assets:


$plugin-creator

MCP connects Codex to external tools and private context:


[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]

HTTP MCP server:


[mcp_servers.figma]
url = "https://mcp.figma.com/mcp"
bearer_token_env_var = "FIGMA_OAUTH_TOKEN"

Hooks run lifecycle checks around tool use. Rules can allow, prompt, or forbid command prefixes outside the sandbox. Use them for repeatable safety and team policy.

17. Automations and Subagents

Automations are scheduled checks, reminders, monitors, or recurring follow-ups. Use thread automations when future runs depend on the same conversation context.

Subagents help parallelize read-heavy work:


Review this branch with parallel subagents. Spawn one agent for security risks, one for correctness regressions, and one for test gaps. Wait for all three, then summarize findings with file references.

Subagents use more tokens. They are best for exploration, triage, review, and summarization. Be careful with parallel write-heavy workflows.

18. Windows Notes

Codex supports Windows through the native Codex App, CLI, IDE Extension, and WSL2.

Recommended native Windows sandbox:


[windows]
sandbox = "elevated"

Fallback:


[windows]
sandbox = "unelevated"

Use WSL2 when your toolchain is Linux-native. Keep repositories under the WSL home directory for better performance:


mkdir -p ~/code
cd ~/code

If the Windows sandbox cannot read a directory:


/sandbox-add-read-dir C:\absolute\directory\path

19. Prompt Templates

Feature work:


Goal:
Implement <feature>.

Context:
- Entry files: @...
- Similar implementation: @...
- Requirements: ...

Constraints:
- Reuse existing components and helpers
- Do not change public APIs
- Do not add dependencies unless you explain why first

Done when:
- Add or update tests
- Run <command>
- Summarize changes and verification

Debugging:


Problem:
<behavior>

Reproduction:
1. ...
2. ...

Error/log:

<paste error>



Constraints:
- ...

Find the root cause first, then make the smallest safe fix and rerun the relevant check.

Review:


Review the current diff. Prioritize correctness, security, regressions, and missing tests. Report findings by severity with file and line references. If there are no issues, say that clearly and list any remaining test gaps.

20. Troubleshooting

Codex missed the right files:

Codex is going in the wrong direction:

Commands fail:

MCP tools are unavailable:

21. Official Sources

Refresh scope: checked August 5, 2026, including the July 27-31 update window. The examples in this guide use current documented configuration names, but live availability, limits, pricing, previews, and model choices must be confirmed in the official product surface for the relevant account.