Codex commands worth knowing in November 2026 - a cheat sheet by work situation
A Codex CLI cheat sheet for testers: plan, AGENTS.md, reviewing changes, long sessions, codex exec and the Claude Code equivalents. Syntax checked on codex-cli 0.164.0.
In Codex, the most important instruction is still written as a plain sentence: what the problem is, what the result should be and how to check it. Commands will not replace that. They organise the work around it: they show the state of the session, switch the conversation into planning, show the changes and let you return to an interrupted task.
Three days ago the blog published a Claude Code command cheat sheet. This is its counterpart for Codex CLI. It is not an alphabetical list, but commands arranged by the situations in which a tester needs them. I believe that is the way to learn them: in the order of your own work, not in the order of the documentation.
The post describes the state as of 11 November 2026 and is mainly about Codex CLI, the program you run in a terminal. The list of commands comes from the official documentation, and the syntax of commands and flags was checked locally in the help of codex-cli 0.164.0. That is a verification of version and syntax. The example tasks in this post are illustrations and were not run as tests of the tool.
Two places where you type commands
The first is the system terminal. There, commands start with the word codex. The second is the interactive session you land in after starting the program. That is where slash commands such as /plan or /status work.
The terminal first:
codex --version
codex --help
codex
codex -C ./project
codex resume --last
The first two commands show the version and the help. Plain codex starts a session. The -C flag (long form --cd) points to the working directory; ./project is an illustrative name, substitute your own. codex resume --last resumes the last session, and plain codex resume opens a list of conversations to choose from.
The help in this version also lists, among others, exec, review, fork, mcp, plugin, login, logout, apply, doctor, update and the experimental cloud. I will come back to exec, review and fork below. I do not describe the rest here.
Before you delegate anything, make sure you are in the right directory. A model can do a task well in the wrong place. A good problem description and the right directory matter more than a long list of extra settings.
A cheat sheet by work situation
All the items in the table are in the Codex CLI command catalogue. Typing / in an active session opens the menu available in your installation. Some capabilities depend on the environment, the configuration and the access on your account.
| Situation | Command in the session | What it does |
|---|---|---|
| Start of a session, before the task | /status |
Shows the configuration and context usage. |
| The task needs a different model | /model |
Lets you choose a model and the available reasoning settings. |
| A new repository | /init |
Prepares an initial AGENTS.md file. |
| A larger change | /plan |
Switches the conversation into planning. |
| Checking what actually changed | /diff |
Shows the changes in Git files. |
| Looking for problems in the changes | /review |
Runs a review of the changes. |
| The conversation has grown | /compact |
Shortens the conversation context by summarising it. |
| A break and a return to the task | /rename, /resume |
Help you name and find a conversation. |
| A new task or an alternative idea | /new, /fork |
Create a new conversation or a branch of the current one. |
| The task needs a different scope of access | /permissions |
Lets you view and change the access settings. |
| The question of what the agent can use | /mcp, /skills |
Show the available tools and skills. |
| Tests are running in the background | /ps, /stop |
Show and stop terminals running in the background. |
The official list is longer. It also includes /goal, /hooks, /memories, /clear, /copy, /export, /usage, /statusline, /theme, /quit and /exit. They are deliberately missing from the table: a cheat sheet that lists everything stops being a cheat sheet.
A new project: /init and a useful AGENTS.md
Project instructions save you from repeating the same agreements in every conversation. /init prepares a starting point in the AGENTS.md file. The result has to be read and corrected. The tool can read the structure of the repository, but it does not know the team’s agreements.
For a tester, specifics are what counts: which command runs the tests, where the data comes from, which services must be running and where the expected behaviour is written down. On top of that, one sentence about what “done” means. A bare “take care of quality” leaves too much room for interpretation.
An illustrative example: a project has fast unit tests and a separate integration suite that requires a running API. If the instructions distinguish between them, a missing connection to the service has a chance of being described as a limitation of the environment, not as a bug in the code.
How Codex loads instructions from different directory levels is described in the AGENTS.md documentation. How to lay out such a file in a repository with automated tests is shown in the post How to write AGENTS.md for a test automation repo.
A larger change: /plan and asking for evidence
With a change that spans many files, first establish the problem and the success criterion. /plan switches the session into planning. According to the documentation, the task can be given in the same message. You do not need to know the solution in advance.
An illustrative example:
/plan Analyse the causes of flakiness in the login tests.
Point out the confirmed observations and separate them from hypotheses.
Propose the smallest experiment, the files to check
and the way to assess the result.
This instruction has one job: to stop hasty changes. If logs or data about the environment are missing, the plan should show that gap before anyone starts rebuilding the framework.
Once the approach is agreed, execution follows, and after it a separate step: checking the result. A plan organises the work, but it proves nothing. A list of ticked-off items does not confirm that the right cause was found.
Review: /diff shows the change, /review looks for problems
/diff shows the changes in the repository, including new files. /review runs an analysis that looks for problems in those changes. One does not replace the other. When reading the result of a review, go back to the specific piece of code and check the scenario described.
For a test fix I would ask three questions:
- Does the assertion still check the behaviour that matters?
- Did “removing the flakiness” not consist of removing the check?
- How will the test behave after a bug is introduced on purpose?
The third question is the most important. A test that also passes on broken code guards nothing, and a green result alone will not show that.
A review can also be run from the terminal, without entering a session:
codex review --uncommitted
According to the documentation, this option covers changes added to the Git index, the remaining modifications and new files. The command also accepts the flags --base <BRANCH> and --commit <SHA>. The full syntax is shown by codex review --help.
I would treat the result of an AI review as a proposed assessment, not as a verdict. Independent evidence comes only from concrete runs and the product requirements.
A long session: /compact, /rename and /resume
After many attempts the conversation is full of logs, rejected hypotheses and successive versions of the solution. /status shows context usage, and /compact shortens the conversation by summarising it.
I would not assume that the summary keeps every detail. Write down important decisions and paths to the evidence beforehand, in a file in the project.
A recognisable name helps too. After /rename login-analysis (an illustrative name) it is easier to find the conversation in the list of sessions. Just remember that /resume resumes the conversation history, not the earlier state of the files. The repository may have changed since the last attempt, so when you come back, start by checking what is actually on disk.
/new starts a fresh conversation, and /fork creates a branch of the existing history. A branch of the conversation is not a copy of the repository. If the experiment is meant to change code independently, split the work on the files as well, for example with a separate Git working tree (worktree).
The terminal equivalents are codex resume and codex fork: the first resumes an earlier session, the second branches it.
Long runs and scope of action
When working with tests, /ps comes in handy: it shows terminals running in the background and the last fragment of their output. /stop stops the background terminals that belong to the current session. An empty list may result from the way the command was executed.
Stopping a process does not tell you whether the tests passed. In the summary of the work, three things have to be told apart: a completed check, an interrupted attempt and a missing required service. The same applies to tasks that completed only some of the steps before an error.
Before a larger change, look into /permissions. Reading files, modifying the project and calling services are three different needs. The settings should match the task and the rules of the environment, not convenience. /model shows the models made available to your account, and after a change /status lets you confirm the configuration.
Repeatable analysis from a script: codex exec
When a task has a fixed scope, it can be run without an interactive conversation. That is what codex exec is for. An illustrative example, an analysis of the documentation in a repository directory:
codex exec --sandbox read-only --json "Analyse the requirements in docs. Point out contradictions and cite the sources."
The --sandbox flag accepts three values: read-only, workspace-write and danger-full-access. For an analysis that is not supposed to change anything, I would choose the first. The third has a warning in its name, and it is worth taking seriously.
--json sends a stream of events in JSONL format to the output. It is a format convenient for processing successive events, not a promise of a single JSON report with an arbitrarily chosen structure. Your own response format has to be defined and checked separately.
Before you automate anything, establish the input conditions, the way the result is assessed and the reaction to missing data. If after every run you have to guess what the tool meant, a script will not bring any order. Non-interactive mode is described in the codex exec section of the documentation.
If you know Claude Code
Many habits carry over directly. The table shows the closest equivalents. These are pairs “for the same purpose”, not a promise of identical behaviour. Check the details in the documentation of the tool you are switching to.
| What for | Codex | Claude Code |
|---|---|---|
| Project instruction file | AGENTS.md (created by /init) |
CLAUDE.md (created by /init) |
| Planning | /plan |
/plan |
| Reviewing changes | /diff and /review |
/diff and /code-review (alias /review) |
| Shortening the context | /compact |
/compact |
| Session goal | /goal |
/goal |
| Resuming | /resume, in the terminal codex resume --last |
/resume, in the terminal claude -c |
| Running without a conversation | codex exec |
claude -p |
| Permissions | /permissions |
/permissions |
The Claude Code column is expanded in the cheat sheet from three days ago, so I do not repeat it here. There is a separate post about /goal in Claude Code. Do not carry the mechanics from that text over to Codex without checking: a shared command name is not yet shared behaviour.
How the instruction files themselves differ is shown in the comparison of AGENTS.md, CLAUDE.md and .cursorrules. That post is from May 2026, so it still refers to the older Holak Scale 0-11.
The CLI and the app have different menus
The desktop app also has commands typed into the conversation field, but its menu has its own scope. The app command documentation lists, among others, /plan, /review, /status, /compact, /reasoning, /goal, /fork, /model and /mcp. The reasoning level is chosen there with /reasoning.
Do not carry the terminal cheat sheet over to the app without looking at its menu. The table in this post describes the CLI.
Additional skills may appear in both environments. In the CLI, /skills shows them. In the app, according to the documentation, you select them after typing $, and enabled skills may also end up on the command list. A name visible in one project does not have to belong to the standard set of every installation.
Which work is easier to ship where - in the terminal, in the app or in the browser - is a separate topic: Claude and Codex: CLI vs desktop vs web.
With Codex I myself use the desktop app more often, and with Claude Code the terminal. There is no advantage of one over the other behind this: that is how I learned it, and it could just as well be the other way round.
Summary
To start with, I would pick three habits: /status before the task, /plan before a larger change and /diff after every one. Thanks to them you know what you are working in, what is supposed to be created and what was actually created.
Pick up the rest of the commands when a specific problem appears: a long session, tests in the background, a repeatable analysis. A cheat sheet is not for learning by heart, but for coming back to while you work.
Commands change between versions. This post describes the state as of 11 November 2026 and codex-cli 0.164.0. If you are reading it later, start with codex --version and typing / in a session.
Sources and further reading
- OpenAI - Codex CLI commands and in-session commands - the official list of commands, read on 11.11.2026. The older address
developers.openai.com/codex/cli/slash-commandsredirects right there. - OpenAI - slash commands in the desktop app - the app’s separate menu,
/reasoningand skill selection. - OpenAI - project instructions in the AGENTS.md file - where Codex loads instructions from and what scope they have.
This post was co-created with the help of AI.