Your First Session with Codex CLI

Start Codex in a project folder, type a first request, choose how much it may do without asking, and learn how to interrupt it and how to quit the session.

Checked against official docs on 12 Oct 2026

On this page

This guide shows you what to do after you install Codex. A session is one conversation with Codex. It starts when you type codex and ends when you quit.

Go to your project folder

Codex works on the files in the folder where you start it. Use a test folder first. Folders in the terminal shows how to make a folder and go into it with cd.

OpenAI suggests that you save a checkpoint of your work before and after a task, so that you can undo changes. If you use Git (a tool that saves versions of your files), make a commit first.

Start Codex

codex

Type your first request

Describe what you want in plain words and press Enter. OpenAI's first example:

text
Tell me about this project

Understand what Codex may do

Codex has two safety layers:

  • The sandbox decides what Codex can touch. By default it can write only inside the folder where you started it, and it has no internet access.
  • The approval policy decides when Codex must stop and ask you. By default it asks before it edits files outside the folder or runs commands that need the internet.

When Codex asks, read the action and the command before you approve. If you are not sure, refuse and ask Codex to explain.

Change the permissions

Type /permissions and press Enter. Pick a preset:

  • Read Only lets you chat and plan. Codex makes no changes without your approval.
  • Auto lets Codex read, edit and run commands inside the folder without asking.

Codex confirms the new setting. It stays until you change it again. To see the current settings, type /status.

Interrupt Codex

While Codex works, the screen shows esc to interrupt. Press Esc to stop the current task. Then type a new instruction.

Quit the session

Type /quit or /exit and press Enter. Codex closes at once, so save important work first.

Useful commands inside a session

CommandWhat it does
/permissionsChanges what Codex may do without asking
/statusShows the model, the permissions and the usage of this session
/newStarts a new chat
/initMakes a starting AGENTS.md note file for the project
/quitQuits Codex

To go back to an earlier chat in this folder, start Codex with codex resume.

Next, give Codex a superpower: install a skill.

Sources