Grok Build Is Fully Open Source: ~840k Lines of Rust
A local-first AI coding terminal
On 2026-07-15 xAI open-sourced its terminal coding agent Grok Build under Apache 2.0. Here is what shipped, what did not (model weights), how to compile it against your own inference endpoint, and the privacy timeline behind the move.
What the Grok Build release actually is
The release is Grok Build itself — xAI's terminal AI coding agent (TUI): the full agent shell that reads, edits, searches and runs code, including its extension system (skills, plugins, hooks, MCP servers, subagents), roughly 840,000 lines of Rust on GitHub. What it is not: open model weights. Inference still comes from an endpoint you choose — xAI's API, another cloud provider, or a model you host yourself.
Key facts of the release
Based on the official xAI announcement and major tech coverage, mid-July 2026.
Apache 2.0 license
A permissive license allowing commercial use, modification and redistribution. The entire codebase shipped at once — not a trimmed-down mirror.
~840k lines of Rust
Agent engine, terminal UI, tool layer and extension system are all public, so every file access and network call the agent makes can be audited.
Local-first operation
Compile it yourself and point config.toml at any endpoint: xAI's API, an API-compatible relay, or local inference such as vLLM or llama.cpp.
The privacy incident and the fix
Before the release, researchers found earlier versions syncing entire repositories — including sensitive files — to cloud storage without clear consent. xAI says all uploaded data was permanently deleted, retention is now off by default, and usage limits were reset for all users.
Compiling and running it yourself
The typical path: clone the GitHub repo, build with the Rust toolchain, configure model endpoints and keys in config.toml, run it in your terminal. The shell itself is light; real compute lives at whatever model endpoint you attach.
# example self-build flow (illustrative)
git clone https://github.com/xai-org/grok-build
cd grok-build && cargo build --release
# edit config.toml: model endpoint, keys, hooks
# then run the built binary per the repo README
For sensitive codebases, audit hooks and network egress settings before choosing an endpoint, and check the data-retention policy of any third-party endpoint you attach.
The privacy timeline
The incident is the direct backdrop of the release: researchers demonstrated that earlier Grok Build versions uploaded user directories — repos, key files and more — to cloud storage without explicit consent. xAI responded publicly: deleting all uploaded data, disabling retention by default, and opening the full source for audit. Whether to trust the hosted path again is your call; self-compiling with an endpoint you control is the conservative answer.
Local + cloud: the practical 2026 pattern
A common setup: run your own Grok Build build against a local model for privacy-sensitive or offline work, and switch the endpoint to hosted frontier models when a task needs more capability. One terminal workflow, two data boundaries.
Where QCode fits in a hybrid setup
QCode gives you one key for the Claude, GPT/Codex and Gemini families with China-optimized routing. Since the open-source Grok Build lets you choose endpoints freely, it doubles as a unified front end: local models for the privacy baseline, QCode for frontier capability and quota headroom.
Grok Build open source FAQ
Is Grok Build free now that it is open source?
The code is free under Apache 2.0. Hosted Grok model inference still bills through xAI subscriptions or API pricing; a self-compiled build pointed at your own or a third-party endpoint does not need an xAI subscription.
Why did xAI open-source it?
The trigger was the privacy incident: earlier versions were caught uploading user repositories without clear consent. xAI answered with three moves — delete the uploaded data, disable retention, open the full source — and reset usage limits for all users.
What do I need to self-host it?
A Rust build environment plus one model endpoint. The shell itself barely needs hardware. Fully offline use means hosting an open model yourself (GPU memory depends on the model); pointing at a cloud endpoint runs fine on an ordinary dev machine.
How does a self-built Grok Build complement QCode?
Grok Build is the shell; QCode supplies the model legs. Your build keeps the tool layer auditable, while one QCode key covers Claude / GPT / Gemini for frontier capability and quota flexibility — data boundary on one side, model capability on the other.
Set up the hybrid workflow today
Own the shell, rent the frontier: one QCode key covers Claude / GPT / Gemini with quota flexibility.