All tutorials/3 min/Beginner

Codex CLI tutorial

How to Run Codex CLI YOLO Mode

Run Codex with fewer prompts by starting in the right folder and using YOLO mode or the dangerous bypass flag when you accept the risk.

Codex CLIYOLO modeSkip approvals
quick-start

Quick command sequence

$ cd /path/to/your/project && codex --yolo

/en/tutorials/how-to-run-codex-cli-yolo-mode-skip-approvals

Interactive command lab

1/3

Step 1

Go to the project folder

Codex works from the current directory, so this folder is the boundary for the session.

Checkpoint

Do not start in your home folder unless that is intentional.

zsh — tutorial-lab

Command tray

$ cd /path/to/your/project

/path/to/your/project

Steps

  1. 1

    Step

    Go to the project folder

    Codex works from the current directory, so this folder is the boundary for the session.

    cd /path/to/your/project
  2. 2

    Step

    Run Codex YOLO

    In recent Codex CLI builds, YOLO is the fast path people use when they want fewer approval prompts. If your CLI does not expose --yolo, use the explicit dangerous bypass flag shown below.

    codex --yolo
  3. 3

    Step

    Use the explicit bypass if needed

    The current help text describes this as skipping confirmation prompts and executing without sandboxing. It is extremely dangerous unless the environment is already externally sandboxed.

    codex --dangerously-bypass-approvals-and-sandbox

Why this matters

Codex YOLO mode is useful when you want speed and fewer prompts, but the tradeoff is safety. The right folder, a clean Git state, and final diff review are what keep the workflow useful instead of risky.

Troubleshooting

  • If codex --yolo is not recognized, run codex --help and look for --dangerously-bypass-approvals-and-sandbox.
  • If Codex edits the wrong files, stop the session and restart from the correct project folder.
  • If you are unsure, do not use YOLO; run Codex normally first and keep approvals on.

FAQ

What is Codex YOLO mode?

It is the low-friction way people refer to running Codex with approvals reduced or skipped so the agent can work faster.

What command should I run?

Use cd /path/to/your/project && codex --yolo when your CLI supports it.

What if codex --yolo is not available?

Use codex --help. Current Codex CLI help exposes --dangerously-bypass-approvals-and-sandbox as the explicit dangerous bypass option.

Is YOLO mode safe?

It is faster but riskier. Use it only in a folder you trust, ideally with Git clean and a rollback path.

How do I verify the result?

Run git status, git diff --stat, git diff --check, tests or lint, then keep only the changes you understand.

Related tutorials