Open sourceRustApache-2.0CLI / TUI / ACP

Grok Build Open Source:Source Code, Setup, and How It Works

A source-backed field guide to the public Grok Build coding-agent harness—what is open, how to build it, where models fit, and what developers should verify before adopting it.

Read the guide
grok-build / source
$
git clone https://github.com/xai-org/grok-build
$
cd grok-build
$
cargo run -p xai-grok-pager-bin# build
agent harness readylocal source
RustApache-2.0Public source

Live model console

xAI models via OpenRouter

Interactive workspace

Ask Grok. Know the model, limit, and cost before you send.

Ask coding questions with three free guest questions on Grok Build 0.1. Your remaining questions and credit balance stay visible while you work.

Provider

OpenRouter

Default

Grok Build 0.1

Guest access

3 questions

Usage

Credits + free access

Grok PlaygroundxAI models via OpenRouter
Cached catalog
Context

256K

Input / 1M

2,000 cr

Output / 1M

4,000 cr

Free questions3 / 3
Credit balance0 cr
View pricing

Grok Build 0.1 ready

Ask about code, architecture, debugging, or the Grok Build source.

Ask three questions free as a guest. Sign in to keep your account balance, then add credits when advanced models become available.

Enter to sendShift + Enter for line0/12000
Conversations stay private to this browser until you clear them.Three free questions. Credits unlock advanced models.

Model selection

Choose by task, not by the largest model number.

Start with Grok Build 0.1 for ordinary coding work. Move to a broader or stronger model when the task actually needs more context or reasoning. The selector above is the source of truth for current context length and token prices.

01

Grok Build 0.1

Focused coding option with the lowest current xAI input and output rates in the live catalog.

Start here for code generation, debugging, repository planning, and questions about agent workflows.

02

Grok 4.5

Higher current output cost than Grok Build 0.1; keep the prompt focused.

Use for difficult architecture decisions, deeper reasoning, or code review where answer quality matters more than price.

03

Grok 4.3

A larger context window does not remove the need to trim irrelevant logs and generated files.

Useful for long specifications, broad repository context, and comparisons that need more source material in one request.

04

Grok 4.20 / Multi-Agent

Long-context requests can still become expensive; confirm the live model price before sending.

Evaluate for very long inputs, decomposed analysis, and tasks that benefit from exploring several solution paths.

Prompt recipe

Give the model a testable target.

“Fix this” forces the model to guess. A useful coding prompt names the finish line, the relevant environment, constraints, observable evidence, and the output you expect. Paste only the smallest code or log excerpt needed to make the problem concrete.

reusable / task brief
Goal: [what must be true when the task is finished]
Context: [language, framework, relevant files, current behavior]
Constraints: [what must not change, security, performance, compatibility]
Evidence: [error message, code excerpt, logs, or reproduction steps]
Output: [patch, explanation, test plan, or decision memo]
01Overview

What is Grok Build?

An agent harness and terminal interface—not just a model name.

Grok Build coordinates repository context, tools, model reasoning, edits, review, and approval. Its public source covers the coding-agent harness and CLI surface.

Open-source layer

Grok Build

The public Rust repository contains the agent runtime, CLI, and full-screen terminal UI. This is the code you can inspect and build locally.

Browse the repository
Hosted model layer

Grok Build 0.1

A separately listed hosted model. Model access and pricing are provider concerns; they are not the same as the open-source CLI repository or its license.

Live provider: OpenRouter xAI

Model requests use a server-side OpenRouter proxy. The provider key never ships to the browser. Supabase handles email sessions, free-question limits, and the credit ledger; payment checkout is intentionally not enabled yet.

What you can inspect

The public repository lets you examine how the terminal, agent runtime, configuration, tools, and extension surfaces are implemented. You can compile that code locally, review dependency choices, and compare a release with your own fork.

What remains hosted

Model inference still runs on a provider’s infrastructure. Model weights, provider retention, availability, latency, and token charges are separate from the CLI’s source license. Open-source client code does not make hosted inference free.

What OpenRouter adds

OpenRouter provides one normalized API and a live model directory. This site uses it as a gateway, while restricting requests to xAI model IDs and keeping the credential on the server. Switching models changes inference, not the harness.

02Why open source

Why it matters

Source turns agent behavior into something developers can examine.

The practical value is not a slogan. It is the ability to trace code paths, reproduce builds, understand extension points, and evaluate the project’s actual boundaries.

Inspectable

Read the agent harness instead of inferring behavior from a closed interface.

Buildable

Compile and validate the first-party Rust source in your own environment.

Extensible

Trace where skills, hooks, MCP servers, tools, and model configuration connect.

Bounded

Review the license and contribution policy before treating public source as a community project.

Adoption checklist

Inspect the operational boundary before giving an agent access.

Reading source is the beginning of due diligence, not the end. Your deployment policy must also cover data, command execution, provider spend, updates, and any external tool the agent can call.

  1. 01

    Confirm which source files, network calls, and telemetry paths exist in the version you plan to deploy.

  2. 02

    Define whether the agent may edit files, execute commands, access secrets, or call external MCP servers.

  3. 03

    Set provider credit limits and rate limits before exposing a shared chat or automated workflow.

  4. 04

    Review the Apache-2.0 scope, third-party dependencies, and the repository’s closed contribution policy.

  5. 05

    Choose an update process because the public repository is periodically synced from an internal monorepo.

03How it works

System map

Five layers connect source code to an approved change.

The harness loads repository context, coordinates an agent runtime, invokes tools, calls a configured model, and returns control to the developer through the terminal.

01

Repository

Source + AGENTS.md

02

Agent runtime

Plan + execute

03

Tools / MCP

Inspect + change

04

Model

Reasoning engine

05

Terminal

Review + approve

01

Load repository instructions

The harness begins with repository context such as AGENTS.md, working-tree state, and the developer’s request. Good instructions define scope, commands, and files that must not change.

02

Plan the task

The agent converts the request into a sequence of inspect, edit, and verification steps. A useful plan names the acceptance criteria instead of only describing the desired appearance.

03

Invoke tools and MCP

File reads, shell commands, external tools, and MCP servers provide evidence or perform bounded actions. Permissions should match the task and high-impact actions should remain reviewable.

04

Ask the configured model

The model receives selected context and tool results, then proposes the next action or response. Changing the model affects reasoning, context capacity, latency, and cost—not the repository license.

05

Review and approve

The terminal, headless runner, or ACP client returns changes and results to the developer. Treat tests, diffs, and command output as the final evidence, not the model’s confidence.

Capabilities

Built for programmable coding workflows.

Official materials describe repository instructions, extension surfaces, parallel work, and several ways to run the agent.

/01
AGENTS.mdContext

Repository context

Use AGENTS.md files to carry project-specific instructions through a coding session.

/02
SkillsHooksMCP

Extensible workflows

Add skills, plugins, hooks, and MCP servers without replacing the core terminal workflow.

/03
SubagentsWorktrees

Parallel execution

Delegate independent work to subagents and isolate changes with Git worktrees.

/04
TUIHeadlessACP

Multiple surfaces

Run interactively in the TUI, automate headlessly, or connect through ACP.

04Build from source

Local setup

Clone the repository. Build the Rust workspace. Verify before use.

These commands follow the public xAI open-source page. Check the repository README for prerequisites and changes before running them.

01

Toolchain

Install Git plus a Rust toolchain that provides cargo, rustc, Clippy, and rustfmt. Follow the repository when it pins a specific version.

02

Workspace

Use a clean local directory and inspect the README, license, workspace manifest, and build scripts before executing project commands.

03

Credentials

Keep provider keys in local environment files or a secret manager. Never commit them to a fork, example config, terminal transcript, or issue.

00 / clone
$git clone https://github.com/xai-org/grok-build
$cd grok-build
01 / Build
cargo run -p xai-grok-pager-bin# build
02 / Validate
cargo check -p xai-grok-pager-bin# validate

Verification

A successful compile is not the whole acceptance test.

cargo check exits successfully for the documented workspace target.

Clippy findings are reviewed rather than suppressed without explanation.

cargo fmt --all produces no unexpected source changes.

The launched TUI can load a test repository without receiving production secrets.

Prefer a prebuilt release? Use xAI’s installer. Building from source is useful when you need to inspect the implementation or validate a local toolchain.

Official installer
05Who it’s for

Audience

Useful when you care about the harness—not only the output.

Grok Build’s public source is most relevant to people evaluating terminal workflows, extension architecture, and operational control.

01

CLI-first developers

Keep planning, edits, review, and approval inside a keyboard-driven workflow.

02

AI tool builders

Inspect a real agent harness and study how tools, context, and models connect.

03

Platform teams

Evaluate extension points before standardizing an agent workflow across repositories.

04

Source auditors

Build first-party code locally and examine the public Rust implementation.

05

Open-source researchers

Track the public sync, license boundary, and architecture without relying on a black box.

Strong fit

You want inspectable automation with a developer in control.

Grok Build is worth evaluating when your team already uses Git, terminal tooling, automated checks, and explicit approval boundaries. It is especially relevant when the ability to inspect or fork the harness matters to procurement or security.

Reconsider

You need a managed, no-code product with formal support.

The public repository currently does not accept contributions. Teams that require an upstream customization path, guaranteed support, centrally managed user accounts, or a zero-terminal workflow should verify those needs before standardizing on it.

06Boundaries

Read before adopting

Public source does not automatically mean a community-governed project.

The repository is useful for transparency and local builds, but its license, sync model, and contribution policy should be read together.

License

Apache-2.0

The repository identifies first-party source as Apache-2.0 licensed. Review dependency licenses and notices separately before redistribution.

Contribution

External PRs closed

The current guide says unsolicited patches and pull requests are not accepted. A fork can diverge without an upstream merge path.

Source flow

Public mirror

The public repository says it is periodically synced from an internal monorepo. Public commit timing may not match internal development.

Read the official contribution policy

Practical boundary

Audit the version you deploy, not the project’s reputation.

An open repository answers “what code was published?” It does not automatically answer which binary a hosted service runs, how model providers retain prompts, which optional integrations are enabled, or how quickly a security fix reaches your environment. Pin a reviewed commit, record configuration, protect credentials, and repeat verification when you update.

07Sources
08Q&A

Detailed Q&A

Questions to answer before you build, pay, or paste code.

These answers connect the open-source repository, hosted xAI models, OpenRouter billing, this site’s security boundary, and the operational choices a real user must make.