Skip to content
zero2vibecodelearn vibe coding
Level 0 · Install and first run 7 min Reviewed by the author · Oct 22, 2026 Verified against Codex CLI v0.163.0 · Oct 22, 2026Official docs: Codex: CLI, Developer commands, Agent approvals security

Your first Codex session

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.

Level 0 · 0 / 4 lessons0%
In this lesson

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:

cd todo-app
git status

If there are uncommitted changes, 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:

codex

On launch, Codex checks whether the folder is under version control. In a Git 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

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.

Quick check

Codex is in Auto in your repository and you ask it to fix one line. Where does the change appear?

Review what it actually did

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

/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.

Check your understanding

Answered 0/3
Mode:

You start Codex in a folder that is a Git repository. What does it recommend?

Codex finished a task. What shows you every change it made, including brand-new files?

Why commit before the task, not only after it?

Finish the task in the terminal and answer the questions to complete the lesson.

📝 My notes

Saved automatically in this browser · shows up on the Notes page.

Task

Move into the project and make a Git checkpoint, the way the Codex docs recommend before a task.

Tab complete · ↑ history · Ctrl+L clear · help commands

  • Not done: Stand inside the project folder
  • Not done: Make the folder a Git repository
  • Not done: Commit everything as a checkpoint
  • Not done: Confirm the tree is clean before Codex starts

Lesson Q&A

You start Codex in a folder that is a Git repository. What does it recommend?

The Auto preset — it can edit files and run commands inside that folder without asking — On launch Codex checks whether the folder is under version control. In a Git repository it recommends Auto; in a folder without version control it recommends read-only.

Codex finished a task. What shows you every change it made, including brand-new files?

The /diff command — /diff shows the Git diff, untracked files included. The conversation shows what it said it did; the diff shows what it did.

Why commit before the task, not only after it?

So the agent's changes are the only difference, and you can throw them away in one step — A clean starting point turns review into one question — is this diff right? — and a bad result into one restore.

Codex is in Auto in your repository and you ask it to fix one line. Where does the change appear?

Inside the workspace, Auto lets Codex edit without asking. You review the result with /diff, not before it happens.

Commands in this lesson

Terms in this lesson

Move between lessons with ← → · search with ⌘K

Written and reviewed by Mikhail Kuzmitskii