So far, you’ve learned how to use Codex to edit existing files, refactor code, and even generate new ones. Now it’s time to take control of how Codex behaves during your session.
Codex isn’t just a code assistant — it’s also a configurable tool that adapts to your workflow. Through a set of session commands (each starting with a /), you can adjust its model, manage approvals, start new conversations, review your code, and even set project-wide behavior rules.
In this unit, you’ll learn how to use these commands to make your sessions smoother, more organized, and tailored to your development style.
Use the /model command to select which model Codex should use and how much reasoning effort it should apply.
This command is useful when you want Codex to perform differently depending on the complexity of your task. For quick edits or formatting, you might stick with a lighter model. For deeper reasoning — like designing a new architecture or debugging complex logic — you can switch to a more capable one.
After running /model, Codex will display available options so you can choose what best fits your current task.
The /approvals command allows you to decide what Codex can do automatically and what requires your confirmation.
By default, Codex asks before applying any change. But if you trust it with certain repetitive tasks — such as fixing imports, formatting code, or updating docstrings — you can approve those automatically.
This keeps your workflow moving faster, while still letting you review more significant changes before they’re applied.
Use the /review command to ask Codex to analyze your current code changes and provide feedback.
This command is especially useful after several edits. Codex will review the updated files, detect potential issues, and suggest improvements. It can point out things like:
- Unused or shadowed variables
- Missing test coverage
- Inefficient logic or redundant code
Think of it as having an instant AI code reviewer available any time you need a second opinion.
When your conversation grows too long or shifts to a completely new topic, you can start clean using the /new command.
This command clears your current chat history but keeps your Codex session active. You’ll start with a blank conversational context while maintaining access to your current files and environment.
It’s the easiest way to reset Codex’s focus without restarting the CLI or losing your progress.
The /init command helps Codex understand the rules and preferences specific to your project by creating an AGENTS.md file.
When you run this command, Codex generates an AGENTS.md file that stores persistent instructions — guiding how it should behave whenever you work in that project.
This file acts as your project-level configuration for Codex’s behavior.
For example, you might define:
Once created, Codex will automatically read and follow these rules each time you start a new session in the same directory.
This is especially powerful for teams — everyone using Codex in the same repo gets a consistent assistant that follows the same conventions and coding standards.
If you ever need to adjust behavior (for example, switching to unittest instead of pytest), you can simply update the AGENTS.md file.
Imagine you’re improving a large project. You might start by switching to a high-reasoning model with /model, configure approvals for small changes using /approvals, have Codex review your work with /review, and then start a new chat with /new when moving on to a different module. Finally, you could define project-wide coding rules with /init to ensure consistency in future sessions.
Each command gives you more control over how Codex assists you, helping you stay efficient, organized, and in charge of your workflow.
In this unit, you learned how to manage your Codex session using dedicated commands. You explored how to switch models, adjust approvals, review your code, reset your context, and define project-level behavior using AGENTS.md. These tools transform Codex from a reactive assistant into a configurable partner that adapts to your way of working.
Next, you’ll put these commands into practice and see how they fit naturally into a real Codex session.
