# Your first Codex session

Course: Codex from Zero — https://zero2vibecode.com/learn/codex
Canonical URL: https://zero2vibecode.com/learn/codex/0-2-first-codex-session
Verified against: Codex CLI v0.163.0 (2026-10-22)
Last updated: 2026-10-22

Start Codex inside the project, from a clean Git checkpoint, and make the first request a question. Then review what it changed with /diff before you commit, because in its default mode it edits files without asking first.

The folder you start Codex in is the one it works on. Start it in your home folder and it is looking at everything you own; start it in the project and it is looking at the project.

## Start in the project, from a checkpoint

Move into the project, then make sure Git has a snapshot of how things are right now:

```bash
cd todo-app
git status
```

If there are uncommitted changes, commit them first. The Codex CLI docs say it directly: create Git checkpoints before and after a task, so you can revert. Then start the agent:

```bash
codex
```

On launch, Codex checks whether the folder is under version control. In a Git repository it recommends its **Auto** preset: it can read files, edit them and run commands inside the folder without asking you each time. In a folder with no version control it recommends **read-only** instead. Depending on your setup it may also start read-only until you say you trust the folder.

That default deserves a moment. In Auto, an edit is written to your file the moment Codex makes it. There is no accept button. Your review happens afterwards — which is why the checkpoint comes first.

Practise the checkpoint in the terminal below: move into the project, turn it into a repository, commit everything, and confirm the tree is clean.

## Make the first request a question

```text
Tell me about this project
```

That is the example the official getting-started guide uses, and it is a good one. It costs nothing, changes nothing, and tells you straight away whether Codex understood what it is looking at. If the summary is wrong, a change request would have been wrong too.

When you do ask for a change, name the file and the scope. Type `@` in the prompt to search for a file and drop its path in, so there is no guessing which one you meant.

## Review what it actually did

The conversation tells you what Codex says it did. The diff tells you what it did. Type:

```text
/diff
```

It shows the Git diff, including files Git is not tracking yet — the new file nobody mentioned shows up here. If something is off, ask for a fix, or throw the change away with Git and ask again, more narrowly.

Two more commands earn a place on day one:

- `/review` asks Codex to review your working tree and report what it finds, without changing anything.
- `/status` shows the session's settings: the model, the approval policy and which folders it may write to.

When you are done, press Ctrl+C or type `/exit`. The chat is saved: `codex resume` opens a recent one from the same repository, so tomorrow does not have to start from zero.

## Try it yourself

The same todo app, the same temptation to ask for everything at once.

**Do I have to use Git with Codex?**

No, but it changes how Codex starts. In a folder without version control it recommends read-only rather than Auto, and without commits you have no easy way to undo an edit. The docs recommend a checkpoint before and after each task.

**Can I stop Codex in the middle of a task?**

Yes. Pressing Enter while it is working sends new instructions into the current turn, so you can steer it. Ctrl+C or /exit closes the session.
