DEV Community

Jamse Bao
Jamse Bao

Posted on

A Coding Break With Codex: The Sandbox Flag I Needed Before It Felt Fast

I installed openai/codex during a short coding break because I wanted a terminal-native coding agent, not another browser tab. The first impression was pleasantly surprising: it starts quickly, understands a small repository without much ceremony, and feels closer to pairing with a focused CLI tool than operating a heavyweight automation framework.

The rough edge appeared when I launched it from the root of a large monorepo. Codex immediately had access to a lot of irrelevant material: generated files, dependency trees, build output, and unrelated packages. The responses became less focused, and I initially blamed the model. The actual problem was my working directory and sandbox configuration.

There is also a flag distinction worth understanding. “Full auto” is convenient, but I prefer making the approval and filesystem boundaries explicit while testing a new agent. This one-line setup gave me a much more predictable session:

npm install -g @openai/codex && cd path/to/project && codex --sandbox workspace-write --ask-for-approval on-request
Enter fullscreen mode Exit fullscreen mode

workspace-write allows edits inside the project while blocking unrestricted filesystem access. on-request keeps the agent from silently approving commands that deserve a review. For a first run, that balance is much better than treating the terminal agent like an unrestricted shell script.

My other practical fix was simple: start Codex inside the smallest useful repository or package directory. I also removed generated artifacts from the working tree before asking it to inspect a bug. That reduced noise immediately and made its file suggestions more actionable.

The takeaway is not “let an agent run everything.” It is that Codex becomes substantially more useful when its operating boundary is deliberate. Developers working in monorepos, repositories with large generated directories, or projects containing sensitive configuration should check the sandbox and approval flags before evaluating its coding quality. Once those edges were handled, the workflow felt clean, fast, and genuinely useful for small fixes, test exploration, and command-line debugging.

Top comments (0)