TL;DR
Grok Build (the grok command) is xAI’s terminal-based AI coding agent, and as of mid-July 2026 its Rust source is open on GitHub under xai-org/grok-build — roughly 4,500 stars in its first weeks. It’s a full-screen TUI that reads your codebase, edits files, runs shell commands, searches the web, and manages long-running tasks. You can drive it interactively, run it headlessly for CI, or embed it in your editor through the Agent Client Protocol (ACP).
If you already live in Claude Code, Codex CLI, or OpenCode, the shape here is familiar — a fast native binary, an agent loop, a tool suite. What’s new is that it’s first-party xAI, powered by Grok 4.5, with a fullscreen mouse-interactive interface and a genuinely open (if unusual) release.
Here’s the honest version of what it is, how to run it, what it costs, and the caveats worth knowing before you curl | bash it.
Quick Reference
| Field | Value |
|---|---|
| Repo | xai-org/grok-build |
| Stars | ~4,500 (first weeks) |
| License | Apache 2.0 (first-party code) |
| Language | Rust |
| Binary | xai-grok-pager (shipped as grok) |
| Model | Grok 4.5 (via xAI API) |
| Interfaces | Interactive TUI, headless/CI, ACP (editors) |
| Platforms | macOS, Linux, Windows (best-effort) |
| Contributions | ❌ No external PRs accepted |
| Docs | docs.x.ai/build/overview |
What Grok Build Actually Does
Grok Build is not a chat window with a code theme. It’s an agent harness: a loop that plans, calls tools, reads results, and iterates until a task is done. The pieces that matter:
- Codebase-aware editing. It reads files, greps, lists directories, and applies patches — the standard read/search/edit toolchain, ported and refined (more on that below).
- Shell execution. It runs commands in your workspace with a checkpoint layer so you can review and roll back what the agent did.
- Web search built in. Because it’s an xAI product, the agent can pull real-time information mid-task instead of relying only on training-cut knowledge.
- Three run modes. Interactive TUI for hands-on work; headless mode for scripting and CI pipelines; and ACP so editors like Zed (or anything speaking the Agent Client Protocol) can embed it as the backing agent.
- Fullscreen, mouse-interactive TUI. Scrollback, a prompt box, modals, a native subagent view, and Plan Mode — this is a more polished terminal UI than most agents ship with.
- MCP servers, skills, plugins, hooks, sandboxing. The user guide documents an extension surface comparable to the mature CLIs it competes with.
The architecture is split into clean Rust crates — a TUI crate (xai-grok-pager), an agent runtime/shell crate (xai-grok-shell), a tools crate (xai-grok-tools), and a workspace crate that owns the filesystem, VCS, execution, and checkpoints. That separation is what lets the same agent run as a TUI, a headless process, or an ACP backend without three different codebases.
Installing Grok Build
The released binary is the fast path. Prebuilt binaries exist for macOS, Linux, and Windows:
# macOS / Linux / Git Bash
curl -fsSL https://x.ai/cli/install.sh | bash
# Windows PowerShell
irm https://x.ai/cli/install.ps1 | iex
grok --version
On first launch it opens your browser to authenticate against your xAI account — no manual API-key juggling for the default path.
A note on
curl | bash: piping an install script straight into a shell is convenient but runs remote code with your user’s permissions. If that makes you uneasy (it should, at least a little), download the script first, read it, then run it. This is standard hygiene for any one-line installer, not a Grok-specific worry.
Building from source
If you’d rather compile it — and given it’s Rust, that’s very doable — the repo builds with Cargo, but there’s a hermetic-tooling wrinkle. You need DotSlash on your PATH so the vendored protoc can be resolved:
# Rust toolchain is pinned by rust-toolchain.toml (rustup auto-installs it)
cargo install dotslash
/usr/bin/env dotslash --help # sanity check
# build + launch the TUI
cargo run -p xai-grok-pager-bin
# release binary → target/release/xai-grok-pager
cargo build -p xai-grok-pager-bin --release
# fast validation without a full build
cargo check -p xai-grok-pager-bin
macOS and Linux are supported build hosts. Windows builds are best-effort and, per the maintainers, not currently tested from this tree.
One thing to know if you plan to hack on it: the root Cargo.toml is generated and marked read-only — you edit per-crate Cargo.toml files instead. There’s a SOURCE_REV file recording the exact monorepo commit the public tree was synced from, because this repo is a periodic export from SpaceXAI’s internal monorepo, not a live-developed project.
A Realistic First Session
Once installed and authenticated, the loop looks like every good agentic CLI:
cd my-project
grok
That drops you into the fullscreen TUI. From there you describe a task in plain language:
> Add a --json flag to the export command that prints results as
newline-delimited JSON, and add a test for it.
Grok Build will plan the change (Plan Mode shows you the steps before it touches anything), read the relevant files, apply patches, run your test command, and report back — with the workspace checkpoint layer letting you review each file it changed. For headless use, the same agent runs non-interactively so you can wire it into a CI job:
# conceptual headless shape — see the user guide for exact flags
grok --headless "run the linter, fix any autofixable issues, and open a summary"
And because it speaks ACP, an editor that supports the protocol can use grok as its backing agent, so you get the same runtime inside your editor’s UI instead of a separate terminal.
What It Costs
Grok Build the tool is free and open source (Apache 2.0). What you pay for is the model — it runs on Grok 4.5 through xAI’s API. As of this writing, Grok 4.5 is priced at roughly $2 per million input tokens and $6 per million output tokens.
To make that concrete, a moderately chunky agent turn — say 30K tokens of context in, 5K tokens of edits/output — costs about:
(30 × $2 / 1000) + (5 × $6 / 1000) ≈ $0.06 + $0.03 = $0.09 per task
So under a dime for a real editing task, before you factor in the multi-turn nature of agent loops (a genuine feature build with tests and iterations can easily be several such turns). That lands Grok 4.5 in the cheap-and-fast tier — comparable to running Gemini Flash-class models, and notably cheaper per token than Claude Opus-class agents for the same workload. If you’re cost-sensitive and running an agent all day, that math matters.
Authentication is tied to your xAI account, so metering flows through xAI billing rather than a raw key you paste in.
Community Reaction
The open-sourcing landed with more scrutiny than fanfare, which is fair for a first-party agent from a large lab.
The most-cited technical read came from Simon Willison, who dug into the tools crate and noted something the repo itself documents: several tool implementations are ported from other open agents. The xai-grok-tools THIRD_PARTY_NOTICES.md credits OpenAI Codex (the apply_patch, grep_files, list_dir, and read_dir handlers) and OpenCode (bash, edit, glob, grep, read, skill, todowrite, and write). Willison’s assessment: the ports look compliant with the Apache and MIT licenses those projects use, with proper change notices under Apache §4(b).
That framing matters. It doesn’t mean Grok Build is a “wholesale Codex fork” — the TUI, agent loop, workspace/checkpoint layer, and xAI-specific integrations are first-party Rust. It does mean xAI did the pragmatic thing and reused battle-tested tool handlers rather than reinventing file editing from scratch. Reasonable people read that as either “standard open-source reuse” or “borrowing the hard-won parts,” and both takes showed up in the discussion.
Two other recurring observations:
- No history, no PRs. The public repo is a periodic export — a large tree of readable code with no commit history and an explicit “external contributions not accepted” policy. That’s a very different artifact from a project with years of reviewable commits and a contribution path. It’s open source, not open development.
- A self-referential subagent prompt. Willison also flagged that the subagent system prompt instructs the model not to reveal its own contents — a small but telling detail people enjoyed poking at.
The overall tone: cautious respect. It’s a competent, fast, genuinely open-source agent from xAI, released in a way that’s transparent about what it borrowed and honest that it isn’t seeking outside contributors.
How It Compares
| Grok Build | Codex CLI | OpenCode | Claude Code | |
|---|---|---|---|---|
| Vendor | xAI (first-party) | OpenAI | Community (sst) | Anthropic |
| Language | Rust | Rust | TypeScript | — |
| Default model | Grok 4.5 | GPT-5.x | Any (BYO) | Claude Opus/Sonnet |
| Model lock-in | xAI models | OpenAI models | Model-agnostic | Anthropic models |
| Editor via ACP | ✅ | Varies | ✅ | ✅ |
| External PRs | ❌ | ✅ | ✅ | n/a |
| Cost/M (in/out) | ~$2 / $6 | Higher | Depends on model | Higher |
The honest positioning: if you’re already in the xAI ecosystem and want an official, fast, cheap agent with a polished TUI, Grok Build is a strong default. If you value model choice, OpenCode remains the pick because it’s model-agnostic by design — and, amusingly, Grok Build ports several of OpenCode’s tools anyway. If you want an active open contribution community, Codex or OpenCode beat a no-PRs monorepo export.
Honest Limitations
- Model lock-in. Grok Build runs Grok 4.5 via xAI. There’s no built-in “swap to Claude or Gemini” story like OpenCode offers. You’re buying into xAI’s model line.
- Open source, closed development. No commit history, no external PRs. You can read and fork it, but you can’t meaningfully contribute upstream, and you’re trusting a periodic export rather than watching development happen.
- Windows is best-effort. Prebuilt Windows binaries exist, but source builds on Windows are untested from the public tree. Linux/macOS are the first-class targets.
- Build friction. The DotSlash + hermetic
protocrequirement is an extra step versus a plaincargo build, and the generated read-only rootCargo.tomlwill surprise anyone expecting a normal workspace. - Ported tools, new packaging. A meaningful chunk of the file-editing toolchain is ported from Codex and OpenCode. That’s license-compliant and pragmatic, but if you were hoping for a from-scratch novel approach to code editing, this isn’t it.
- You still pay per token. The tool is free; the agent is only as cheap as your usage. Multi-turn feature builds add up, and web-search-heavy tasks pull more context.
FAQ
Is Grok Build free? The tool is free and open source (Apache 2.0). You pay for the underlying Grok 4.5 API usage through your xAI account — roughly $2 per million input tokens and $6 per million output tokens as of July 2026.
What language is Grok Build written in?
Rust. The compiled binary is named xai-grok-pager and is officially distributed as the grok command.
Can I use Grok Build with Claude or GPT instead of Grok? No. Unlike model-agnostic agents such as OpenCode, Grok Build is wired to xAI’s models (Grok 4.5). If model choice is a hard requirement, use OpenCode instead.
Can I contribute to Grok Build? No. The public repo is a periodic export from xAI’s internal monorepo, has no commit history, and explicitly does not accept external pull requests. You can fork and modify it under Apache 2.0, but not upstream changes.
Is Grok Build just a Codex fork?
No. Several tool handlers are ported from OpenAI Codex and OpenCode (documented in THIRD_PARTY_NOTICES.md, license-compliant), but the TUI, agent loop, workspace/checkpoint layer, and xAI integrations are first-party Rust.
Does it work inside my editor?
Yes, via the Agent Client Protocol (ACP). Any editor that speaks ACP (e.g. Zed) can use grok as its backing coding agent, in addition to the standalone TUI and headless modes.
Bottom Line
Grok Build is xAI’s real, fast, Rust-native answer to Claude Code and Codex CLI — and open-sourcing it (Apache 2.0, tools honestly credited to Codex and OpenCode) was a smart trust move. The TUI is polished, Grok 4.5 is cheap per token, and the ACP + headless story means it slots into editors and CI, not just a terminal.
The catches are real: it’s model-locked to xAI, it’s open source but closed to contribution, and a good chunk of its editing toolchain is borrowed rather than novel. If you’re already on xAI’s models and want an official agent that’s fast and inexpensive to run, it’s an easy install. If you want model freedom or an active contributor community, OpenCode and Codex still have the edge.
Either way, it’s a strong signal: every major lab now ships a first-party terminal coding agent, and the competition is getting good for the rest of us.
Sources: xai-org/grok-build README, Simon Willison’s analysis (Jul 15, 2026), xAI documentation at docs.x.ai/build, and public pricing for Grok 4.5.