Coding agents have moved from autocomplete to something closer to a junior colleague with a terminal. They read a repository, plan a change, edit files, run commands and tests, and open a pull request. That shift changes the engineering question. It is no longer whether a model can write a function, but whether the system around it lets you trust the change it produces.
This article compares three agents using their official documentation: Anthropic’s Claude Code, OpenAI’s Codex, and xAI’s Grok Build. Product details change quickly, so check the linked documentation for current behavior. There are no benchmark numbers and no winner. The tools are converging on similar ideas, and the more useful comparison is how each one exposes the controls an engineering team needs.
A note on naming: xAI also offers Grok Bot, introduced in beta in August 2026 as “your team of always-on agents” that work across tools and apps. It is a general agent product rather than a coding agent. xAI’s terminal coding agent is Grok Build, which is the one compared here.
The common workflow
Despite different interfaces, all three follow the same loop:
- Load repository context: instruction files, project structure, and relevant code.
- Plan: propose an approach, often in a mode that cannot edit files.
- Implement: edit files and run commands inside some boundary.
- Verify: run tests, linters, and type checks, and react to failures.
- Hand off: a diff, a commit, or a pull request for human review.
The differences are in how much of this happens locally or in the cloud, how commands are contained, and when a person is asked to approve.
Repository context
Every agent needs to learn a project’s conventions, commands, and constraints. The tools have settled on plain Markdown files for this.
- Claude Code reads
CLAUDE.mdfiles at several scopes, from organization-wide to a single project, and they can import other files. Its memory documentation also coversAGENTS.md. - Codex uses
AGENTS.md, concatenating files from the repository root down so that guidance closer to the working directory takes precedence. - Grok Build states in its announcement that existing
AGENTS.mdfiles, plugins, hooks, skills, and MCP servers “work out of the box”.
The practical lesson is the same for all three: the instruction file is part of the codebase. It should state how to build, test, and format, what not to touch, and which commands are destructive, and it should be reviewed like code.
Containment and approvals
This is where design choices matter most, because an agent that can run commands can also run the wrong ones.
| Control | Claude Code | Codex | Grok Build |
|---|---|---|---|
| Approval model | Permission modes, including plan, accept-edits, and auto modes | Approval policies and permission presets | Ask (default), Auto, and Always-approve modes |
| Command sandbox | OS-level sandbox for shell commands, enabled by the user | Sandbox modes from read-only to workspace-write and full access | Landlock or Seatbelt sandbox, off by default |
| Fine-grained rules | Allow and deny rules, plus hooks that can block tool calls | Configurable sandbox and approval settings | Allow and deny rules; deny wins |
Sources: Claude Code permission modes and sandboxing; Codex sandboxing; Grok Build permissions and sandbox.
Two observations follow from the documentation. First, permissions and sandboxes are different layers: permissions decide whether an action runs, while a sandbox limits what an approved command can reach. Grok Build’s documentation states this distinction directly. Second, the safest defaults are not always on. Claude Code and Grok Build both document their command sandboxes as something you turn on, so teams should configure them deliberately rather than assume them.
Automation, CI, and long-running work
Each agent can run without an interactive session, which is what makes CI integration possible.
- Claude Code runs non-interactively with
claude -pand has an official GitHub Actions integration that responds to@claudementions. Cloud sessions run on Anthropic-managed VMs. - Codex provides
codex execfor scripts and CI, which runs in a read-only sandbox by default. In Codex cloud, each task has its own workspace and can keep working while your computer is asleep. - Grok Build offers headless mode through
grok -p. Its documentation does not describe an official CI integration or cloud task runner as of this writing, and the product was announced in early beta in May 2026.
Background and cloud execution are convenient, but they remove the natural checkpoint of a person watching a terminal. The checkpoint has to move to the pull request.
Code review
Both Anthropic and OpenAI now offer agent-based pull request review. Anthropic’s Code Review posts findings and a check run, and the documentation states that a review never approves or blocks a pull request, so the merge decision stays with the team. OpenAI’s Codex code review is triggered with @codex review and is generally available on GitHub, with GitLab support in preview, and a deeper security review offered as a research preview. Grok Build’s documentation does not describe a review product.
Automated review is useful as a second reader. It is not a substitute for an accountable human reviewer, especially for changes the agent itself wrote.
Principles for trustworthy agent-written code
The tools differ in detail, but the engineering practices that make them safe are the same.
Make tests the definition of done. An agent that can run the test suite can check its own work against something external. Without tests, it is grading itself.
Grant the least authority that works. Start in read-only or plan modes, allow edits inside the workspace, and treat network access, credentials, and destructive commands as explicit exceptions.
Put rules in configuration, not only in prompts. Instruction files guide behavior; deny rules, sandboxes, and branch protection enforce it.
Keep humans on irreversible actions. Merges, deployments, migrations, and anything touching production should require a person, regardless of how confident the agent sounds.
Review the diff, not the narrative. Agents summarize their own work persuasively. The changed files, the test results, and the CI logs are the evidence.
Scope long-running tasks. Give background agents a clear objective, a branch, and a budget. Unbounded tasks drift.
Coding agents are already capable enough to change how software gets built. Whether that change is an improvement depends far less on which agent a team picks than on the boundaries, tests, and review practices it puts around them.
