You install Codex CLI. You launch it with excitement and tell it to “Fix the broken tests in this repo,” and then the nightmare begins:
Codex: I want to run pytest
Allow? (y/n)
You press y. Immediately, this pops up:
Codex: I want to modify test_user.py
Allow? (y/n)
So, you press y. Again, and again, and again. Every file it wants to read, every command it wants to run, every line it wants to modify. Confirm, confirm, confirm. It’s like working with an intern that asks permission for everything.
Meanwhile, tools like Claude Code or Cursor Agent handle the same tasks silently. What gives?
The issue is that Codex is configured by default to run in an overly cautious approval mode. It makes sense — it’s the safest route for a new product. But when you know what you’re doing, this conservative setup can quickly become a major bottleneck.
The good news? There’s an easy fix.
The Permission System: Approval Mode
Codex uses a system called approval mode to determine when it needs your permission to act. By default, it asks for confirmation for everything:
- Executing commands
- Editing files
- Modifying code
- Creating new files
- Running tests
In practice, this means Codex can’t lift a finger without your approval. It’s like forcing you to confirm each and every action as though you’re running sudo on every command.
The result? Instead of working as an autonomous agent, it turns into an endless back-and-forth where you’re the bottleneck slowing down every task.
The Fix: One Flag for Full Autonomy
codex --full-auto
As of version 0.1.2, --full-auto is the official shortcut that combines --approval-mode never and --sandbox workspace-write into one simple flag. Using an older version? No problem — the longer form still works:
codex --approval-mode never
Either way, Codex stops asking for permission. It will run commands, modify files, create new ones, and do what it needs to do without interruption. In other words, it will finally behave like a real agent.
Want to make this change permanent? You have two options:
# Option 1: Use the config command
codex config set approval_mode never
# Option 2: Edit the configuration file directly
# ~/.codex/config.toml
approval_mode = "never"
From now on, every time you start Codex, it will operate without interruptions.
The Second Issue: The Sandbox
There’s another reason Codex often gets stuck. Even after disabling all the approval prompts, the default sandbox configuration can be too restrictive to perform meaningful tasks, such as writing to the repository.
For development work, you’ll want to set the sandbox mode to workspace-write:
- Full read access to the repository
- Write access to existing files
- Ability to create new files
- Authorization to execute commands within the project
The full setup for a truly functional Codex looks like this:
# For version 0.1.2 or later
codex --full-auto
# Equivalent explicit version
codex --approval-mode never --sandbox workspace-write
Two flags — or just one with --full-auto — transform Codex from an overly cautious assistant into a fully autonomous agent.
Create an Alias to Save Time
If you work in the terminal (and if you’re using Codex CLI, that’s almost guaranteed), you can simplify this even further by creating an alias:
# Fish shell (modern version)
alias codex-agent "codex --full-auto"
# Fish shell (explicit version)
# alias codex-agent "codex --approval-mode never --sandbox workspace-write"
# Bash/Zsh
alias codex-agent="codex --full-auto"
From now on:
codex-agent
No redundant prompts. Just Codex doing what it’s supposed to do.
One-Shot Mode: Fire and Forget
Where this setup truly shines is with command-line tasks as direct arguments:
codex-agent "Run the test suite, identify failing tests, \
fix the code and repeat until everything passes."
No interactive session. No interruptions. Codex analyzes the project, runs the tests, identifies failures, fixes the code, reruns the tests, and repeats until everything passes. You can step away and come back to a job well done.
This iterative workflow — the agentic loop — is the core of how modern coding agents work internally. They repeat the cycle until a task is completed. The difference is that Codex’s default configuration unnecessarily puts you in the middle of this loop. These two flags remove you as a roadblock, letting the agent work autonomously.
The Claude Code Comparison
Here’s the part OpenAI wouldn’t love to hear: tools like Claude Code come pre-configured to work this way.
| Feature | Codex CLI (default) | Codex CLI (tuned) | Claude Code |
|---|---|---|---|
| Permissions | Approval for every action | Fully autonomous | Only prompts for potentially destructive actions |
| Sandbox | Restrictive | workspace-write | Flexible with selective confirmation |
| CLI Mode | Yes | Yes | Native, CLI-first |
| One-Shot Mode | codex "prompt" | codex-agent "prompt" | claude --print "prompt" |
| Required Setup | 0 flags | 2 flags | 0 flags |
Claude Code strikes a better balance: it runs freely for the vast majority of operations but still asks for confirmation for potentially destructive actions (deleting files, system commands, etc.). It’s the default behavior that Codex probably should have adopted from the start.
The practical result? With Claude Code, you’re productive from minute one. With Codex, you first need to tweak its configuration. It’s a quick fix — just two flags — but still an unnecessary hurdle that risks frustrating new users.
The Prompt Makes All the Difference
Once you’ve removed approval prompts, the quality of Codex’s output depends entirely on your prompt. A vague instruction leads to mediocre results.
# Poor
Fix the tests.
# Better
Fix the failing tests in this repository.
Work autonomously:
- Inspect the repo structure
- Run tests
- Modify code to fix failures
- Rerun tests
- Repeat until all tests pass
Do not ask for confirmation.
The difference is significant. The first prompt might result in Codex fixing a single test and stopping. The second sets clear expectations and ensures Codex continues iterating until the job is done. It’s the difference between telling a plumber to “fix this” and providing a detailed checklist of problems to tackle.
This principle applies universally to other agents like Claude Code or Cursor. Disabling approval prompts removes interruptions, but crafting a good prompt ensures that uninterrupted work yields meaningful results.
When NOT to Disable Approvals
It would be reckless to recommend using --approval-mode never under all circumstances without a cautionary note:
Avoid using this configuration in production environments without review. An autonomous agent committing directly to main without oversight can be risky. The autonomous mode is ideal for:
- Development branches where you review the outputs
- Interactive sessions where you monitor its actions
- Well-defined tasks: “fix the tests,” “format this module,” “update dependencies”
For anything touching production, Claude Code’s selective approval mode is safer. It stays autonomous for most tasks but prompts when there’s high risk, like deleting files or running system-changing commands.
The 30-Second Summary
If Codex CLI is driving you crazy with endless confirmation prompts:
# The quick fix (0.1.2+)
codex --full-auto
# The longer form (equivalent)
codex --approval-mode never --sandbox workspace-write
# Make it permanent
codex config set approval_mode full-auto
With a single flag, you can transform an overly cautious assistant into a productive, autonomous agent. Codex’s default settings favor caution over efficiency, but now you know how to flip the switch.
This article was originally published in Spanish and translated with the help of AI.