Preface

In mid-July 2026, xAI (also referred to as SpaceXAI in official announcements) released the xai-org/grok-build repository on GitHub, open-sourcing the full Harness and TUI source code for the Grok Build terminal programming Agent under the Apache 2.0 license. Immediately after the repository was created, it topped the GitHub Trending list and was included by multiple tech media outlets among the most watched AI open-source projects of July 2026.

Grok Build is not another “chat-only” web interface. Instead, it is a full-screen TUI programming Agent that can directly drive codebases in the terminal: it can read files, modify code, run Shell commands, search the web, manage long-running tasks, and supports extension mechanisms such as MCP, Skills, and Plugins. For developers, the significance of this open-source release lies in the fact that AI coding tools are shifting from closed-source IDE plugins to auditable, privately deployable terminal Agent architectures. This article is based on xAI’s official announcements, the GitHub repository, and public documentation, outlining what Grok Build is, why it has garnered attention, and how to run it locally or on Ollama.

What is Grok Build

According to the xAI official announcement (July 15, 2026) and the repository README, Grok Build is xAI’s terminal AI coding Agent, with the CLI command grok, running as a full-screen, mouse-interactive TUI (Text User Interface). It targets three main usage scenarios:
1. Interactive development: Chat with the Agent in the terminal, review plans, and view inline diffs;
2. Headless mode: For scripting or CI pipelines;
3. Editor embedding: Integrate with external editors via the Agent Client Protocol (ACP).

The main repository is implemented in Rust, with the toolchain version pinned in rust-toolchain.toml, which rustup will automatically install during the first build. Official support is provided for source builds on macOS and Linux, with Windows source builds marked as best-effort. The repository is synced regularly from xAI’s internal monorepo, and first-party code is licensed under Apache 2.0; vendored code in the third_party/ directory retains its original licenses.

An important distinction: the open-sourced components are the Agent Harness, TUI, and tooling layer, while the Grok large model itself remains xAI’s proprietary service. You can continue to call the xAI API, or you can point base_url in config.toml to any OpenAI-compatible endpoint or local inference service – the Harness and the model are decoupled.

Why It Quickly Trended After Open-Sourcing

Analytics Vidhya listed xai-org/grok-build as one of the top 10 AI repositories of July 2026 in its July 2026 GitHub Trending roundup, praising it for providing “full source code transparency for a production-grade coding-agent harness”. Combining public information, this surge in popularity stems from several key factors:

First, Frontier Labs has rarely open-sourced a complete Harness. Unlike closed-source solutions such as Claude Code, Grok Build makes the Agent loop, tool scheduling, TUI rendering, and extension loading mechanisms fully visible. For teams looking to build their own Agents or conduct security audits, this offers far more reference value than black-box plugins.

Second, local-first deployment has become a practical option. The official documentation clearly states that by compiling the binary yourself and configuring the local inference endpoint in config.toml, you can run the Agent shell without relying on xAI’s infrastructure. This is far more appealing for scenarios like data compliance, internal network development, and custom model selection than solutions that “only work with official models”.

Third, the extension ecosystem and MCP are now standard features. The open-source code covers the loading and invocation logic for Skills, Plugins, Hooks, MCP Servers, and Subagents. By 2026, MCP had become the de facto standard for connecting external tools, and Grok Build natively supports [mcp_servers] configuration, placing it in the same extension ecosystem as tools like Claude Code and Cursor.

Fourth, privacy policies have been updated synchronously. According to整理 by Appwrite and other sources, xAI disabled data retention by default for Grok Build on July 12, 2026, and promised to delete previously retained coding data; when it open-sourced on July 15, usage limits were also reset. The combination of privacy and transparency further boosted developers’ willingness to try the tool.

As of late July 2026, the repository’s star count had quickly climbed from a few thousand at launch to over 20,000 (per real-time GitHub statistics), and its momentum remained visible on the Trending list.

Repository Structure: What’s Inside the Harness

xAI listed four core modules in its announcement, which directly correspond to the crates/ directory in the repository:

Path Content
crates/codegen/xai-grok-pager-bin Composite root package that builds the xai-grok-pager binary
crates/codegen/xai-grok-pager TUI: scroll areas, input boxes, modals, rendering
crates/codegen/xai-grok-shell Agent runtime, including leader/stdio/headless entry points
crates/codegen/xai-grok-tools Tool implementations: terminal, file editing, search, etc.
crates/codegen/xai-grok-workspace Host file system, VCS, execution environment, and checkpoints

The Agent loop is responsible for context assembly, model response parsing, and tool call distribution; the Tools layer encapsulates reading/writing/searching code and executing commands; the TUI layer handles rendering, input, plan review, and diff display; and the extension system uniformly manages the discovery and activation of Skills, Plugins, Hooks, MCP, and Subagents.

For engineers looking to “understand how a production-grade Agent is built”, xai-grok-tools and xai-grok-shell are the most worthwhile crates to start with – the former tells you what the Agent can do, while the latter shows you how these capabilities are scheduled into the loop.

Installation and Local Operation

Method 1: Official Installation Script

xAI provides a one-click installation:

curl -fsSL https://x.ai/cli/install.sh | bash

After installation, run grok in the terminal to enter the TUI.

Method 2: Build from Source

After cloning the repository, in an environment with the Rust toolchain ready:

git clone https://github.com/xai-org/grok-build.git
cd grok-build
cargo run -p xai-grok-pager-bin

The first build will pull the specified Rust version according to rust-toolchain.toml, and the time required depends on your machine’s performance.

Configuration Check

The user-level configuration file is located at ~/.grok/config.toml (Windows: %USERPROFILE%\.grok\config.toml), and you can override the default path via the GROK_HOME environment variable. The project-level .grok/config.toml only contributes the [mcp_servers], [plugins], and [permission] sections, while other configuration sections only take effect at the user level.

Before or after startup, you can verify loaded components with the following command:

grok inspect

This command will display the configuration sources, instruction files, Skills, Plugins, Hooks, and MCP Servers discovered in the current directory, and is the preferred tool for troubleshooting configuration issues.

Connecting to Ollama and MCP

Pointing to Local Ollama

If you want to run the Grok Build Harness on a completely offline model, you can add a custom model section in ~/.grok/config.toml. Below is a common Ollama configuration example from community documentation (requires Ollama to be running locally and the corresponding model to have been pulled):

[models]
default = "local-coder"

[model.local-coder]
model = "qwen2.5-coder:14b"
base_url = "http://localhost:11434/v1"
name = "Local Qwen Coder"
env_key = "OLLAMA_API_KEY"
api_backend = "chat_completions"
context_window = 32768
export OLLAMA_API_KEY=local
grok inspect

The environment variable pointed to by env_key must be non-empty; api_backend = "chat_completions" indicates using the OpenAI-compatible Chat Completions protocol. After the configuration takes effect, the local-coder model entry should appear in the output of grok inspect.

It is important to note that: the capability ceiling of the Harness depends on the coding capabilities of the underlying model. Community feedback generally recommends using code-specialized fine-tuned models; general-purpose conversational models will perform significantly worse than frontier models like Grok 4 on tasks such as complex refactoring and multi-file collaboration.

Mounting MCP Servers

MCP (Model Context Protocol) allows the Agent to call external tools. A user-level configuration example:

[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/your/project"]
startup_timeout_sec = 30
tool_timeout_sec = 600

You can also quickly add an MCP server via the CLI and write it to the project-level configuration for team sharing:

grok mcp add --scope project filesystem -- npx -y @modelcontextprotocol/server-filesystem .

After adding, run grok mcp list to view registered services, and grok mcp doctor <name> to check connectivity. When there is a conflict between project-level and user-level MCP definitions with the same name, the project-level definition takes precedence.

Horizontal Comparison with Claude Code and Codex CLI

A third-party open-source Agent comparison table整理 by MarkTechPost and other outlets helps clarify Grok Build’s position in the ecosystem:

Agent First-Party License Forkable and Modifiable Model Selection External PRs
Grok Build Apache 2.0 Allowed Customizable via config.toml Not accepted
Codex CLI (OpenAI) Apache 2.0 Allowed OpenAI models Open PRs
OpenCode MIT Allowed 75+ Providers Community-driven
Claude Code Proprietary Closed-Source Not allowed Anthropic models

The core difference between Grok Build and Claude Code is the divide between closed-source IDE/terminal plugins vs. open-source auditable Harnesses. Claude Code still holds an advantage in deep integration with Anthropic’s models and product polish; Grok Build offers an alternative with source code transparency, local deployment, model decoupling, and MCP extensions.

It is also important to note: xAI’s contribution guidelines explicitly state that external Pull Requests are not currently accepted. You can fork, modify, and distribute the code internally, but do not expect upstream merging of community patches – this differs from community-driven projects like Codex CLI and OpenCode.

Who Should Pay Attention to Grok Build

Based on the above facts, the following groups of readers are most worth following:
1. Agent architecture researchers: Want to compare against a production-grade Harness to understand context assembly, tool dispatch, and TUI state machines;
2. Compliance/security teams: Need to audit tool implementations before allowing the Agent to execute Shell commands (focus on reading xai-grok-tools);
3. Internal network developers: Compile local binaries and point base_url to an internal network inference gateway to enable air-gapped coding assistance;
4. CI engineers: Use headless mode to integrate Agent output into pipeline steps.

Conclusion

xAI launched Grok Build in beta form around May 2026, and fully open-sourced its Harness in July 2026. This is not simply “another CLI tool”, but the first time a frontier lab has made the core runtime of a terminal programming Agent available under the Apache 2.0 license. Behind the surge in star counts lies developers’ real demand for auditable, privately deployable, and extensible coding Agents.

If you already use Claude Code or Cursor, consider installing Grok Build in parallel: comparing the context strategies and tool permission models of different Harnesses in the same repository will be more rewarding than reading ten review articles. If you care about MCP and local models, it is worth spending half an hour configuring config.toml and grok inspect, and personally verifying whether the “open-source Harness + custom model” path meets your team’s constraints.

Official repository: https://github.com/xai-org/grok-build
Configuration reference: https://docs.x.ai/build/settings/reference