Ninja Builder Sign in Get started

How to Use Grok Build for Coding (Terminal, Desktop and Plans)

Install Grok Build, pick a plan, sign in and run your first task, then use plan mode, AGENTS.md, MCP and headless mode.

By Ninja Builder team5 min read
Title card reading How to use Grok Build for coding

Key takeaways

  • Grok Build runs as a desktop app (the former Cursor), as the grok command in a terminal, and on the web.
  • Free plans get limited agent requests; Plus includes the agent with Grok Build models; third-party models need Premium or higher and are billed separately.
  • Install with one official command, run grok in your project, and start with "Explain this repo."
  • Use /plan for bigger changes and keep an AGENTS.md with your build and test commands.
  • grok -p runs headless for scripts and CI; commit first, because /rewind does not undo file changes.

Grok Build is the coding agent from the company behind Grok. You can use it in three places: the Grok Build desktop app (the former Cursor editor), the grok command in your terminal, and the web. To start, you need a Grok plan or an xAI API key, one install command, and a project folder. This guide covers the terminal version step by step, then plan mode, project rules, extensions and scripting.

What Grok Build is

Grok Build launched as a terminal agent in May 2026. Its harness went open source on GitHub in July. On 30 November, Cursor was renamed Grok Build: the editor became the desktop app, and the terminal agent now runs Cursor's agent harness underneath. Like other coding agents, it reads your files, proposes changes, edits code and runs commands in a loop until the task is done.

The desktop app is for people who want an editor and a window full of agents. The terminal version, called the TUI, suits people who already work in a shell, run agents over SSH or want to script them. Both share one subscription.

Which plan you need

Grok Build is part of the plans on grok.com/pricing: Free, Plus, Premium, Super and Ultra. The pricing page lists Grok Build agent requests as limited on Free and included on every paid plan. According to the models and pricing docs:

PlanWhat you get in Grok Build
FreeAgent with limited usage
PlusAgent with Grok Build's own models (Grok 4.7, 4.6, 4.5 and Composer 2.5) at fixed settings
Premium4x Plus usage, cloud agents and automations, code review, third-party models from prepaid credit
Super and Ultra15x and 50x Plus usage, earlier access to new features

Usage comes from one weekly pool shared with Grok chat. If you want Claude, Gemini or GPT models inside Grok Build, you need Premium or higher, and those are billed separately at API list price. Prices change, so check the pricing page before you subscribe. For scripts and CI you can also use an xAI API key instead of a plan.

Install Grok Build on Mac, Linux or Windows

The official getting started page gives one command per system. It downloads the latest stable release and adds grok to your PATH.

macOS, Linux or WSL:

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

Windows PowerShell:

irm https://x.ai/cli/unified/install.ps1 | iex

It runs on macOS (Apple silicon or Intel) and on Linux (x86_64 or arm64) with glibc 2.28 or later; Alpine and other musl systems are not supported. If your shell can't find grok afterwards, open a new terminal. grok update keeps it current.

Sign in and run your first task

Five steps to a first Grok Build task: install with one command, sign in with the browser or an API key, run grok in the project, ask it to explain the repo, then plan
The short path from install to real work.
  1. Open a terminal in your project: cd your-project, then type grok.
  2. On first launch your browser opens to sign in. Over SSH, use grok login --device-auth. In CI, set XAI_API_KEY.
  3. Type Explain this repo. Grok reads the files it needs and summarizes the codebase. If that works, install, sign-in and project are all fine.
  4. Point it at a file with @, for example @src/main.rs Walk me through this file.
  5. Type /usage at any time to see how much of your allowance you have used.

Use plan mode for bigger changes

For anything with more than one sensible approach, start in plan mode. Type /plan followed by the task, or press Shift+Tab to cycle modes. Grok explores the code and drafts a plan, then opens a preview. Press a to approve and start building, s to request changes, c to comment on a line, or q to leave plan mode.

Diagram of the Grok Build TUI mode cycle: Agent, Plan, Ask, Auto and Always-approve, switched with Shift+Tab
Plan for design questions, Ask for read-only questions, Auto for routine work.

One caveat from the plan mode docs: while planning, only Markdown files can be edited, but the shell still follows your permission mode, so a command could still write files. Ask mode is stricter: edits and shell commands are refused.

Project rules, skills and MCP

  • AGENTS.md. Put build commands, conventions and architecture notes in an AGENTS.md at the repo root. Grok also reads CLAUDE.md, and plain .md files in .grok/rules/, but not Cursor's .mdc files. grok inspect lists every rules file it found. See how to write CLAUDE.md and AGENTS.md.
  • Skills and plugins. Skills are folders with a SKILL.md in .grok/skills/ or ~/.grok/skills/, and appear as slash commands. /plugins, /skills, /hooks and /mcps open one extensions screen.
  • MCP servers. Add one with grok mcp add, for example a remote server with --transport http. grok mcp doctor checks the connection. New to MCP? Read what MCP is.
  • From Claude Code. /import-claude brings over your Claude Code permissions, environment variables, MCP servers and hooks. /resume-claude and /resume-codex pick up an earlier Claude Code or Codex session.

Run it in scripts (headless mode)

Headless mode sends one prompt and exits, which is what you want in a script or a CI job:

grok -p "List TODO comments" --output-format json

Output can be plain text, one JSON object, or streaming JSON. Add --no-auto-update in automated environments. Be careful with --always-approve: it skips permission prompts for every tool call. To embed Grok in another app or editor, grok agent stdio runs it over the Agent Client Protocol.

Tips that save trouble

  • Commit before a big task. /rewind rolls back the conversation but leaves file changes on disk, so Git is your undo.
  • Try the sandbox. It is off by default; grok --sandbox workspace limits writes to the project, ~/.grok/ and temp folders.
  • Check before cloud send. Handing a session to a cloud agent pushes your local changes, uncommitted files included, to a new branch. Make sure none of them hold secrets.
  • Keep rules short. The docs note that short, specific instructions are followed more reliably than long ones.

Use your Grok plan without the terminal

If you'd rather chat than type commands, Ninja Builder can run Grok Build for you. Its Grok plan chats use xAI's own Grok Build app on your computer, signed in with your Grok account, and show each step in the chat.

  1. Open Settings › Accounts, click Add account, then Grok.
  2. Stay on the Grok plan (Grok Build) tab and click Install if Grok Build isn't on your computer yet. You don't need Terminal.
  3. Click Sign in with Grok and sign in in your browser.
  4. Pick the Grok plan account in the top-bar account menu and send a message.
Ninja Builder chat window with a finished reply, a file card for index.html and a collapsed line listing one edited file and one command run
A chat in Ninja Builder: the reply, the files it changed and each step in one window.

The chat's Autonomy setting picks Grok's own mode: "Plan first" uses plan mode, and "Just build it" lets Grok change files and run commands. Nothing is billed per message; your plan's limits apply. Prefer to pay per use? Add an xAI API key on the API key tab instead.

Ninja Builder: AI Agent Desktop App for Claude Code, ChatGPT and Gemini

Ninja Builder has a 14-day free trial, then $4.99 a month. Download Ninja Builder for Mac, Windows or Linux.

Frequently asked questions

Is Grok Build free?

The Free plan includes limited Grok Build agent requests. Paid plans on grok.com/pricing include the agent with more usage, and you can also use an xAI API key billed per use.

How do I install Grok Build on Windows?

Open PowerShell and run irm https://x.ai/cli/unified/install.ps1 | iex, or install inside WSL with the macOS and Linux command. Then open a new terminal and type grok in your project folder.

Does Grok Build read CLAUDE.md?

Yes. Grok Build reads AGENTS.md, CLAUDE.md and plain Markdown files in .grok/rules/. It does not load Cursor .mdc rule files, so copy those into .grok/rules/ as .md files.

Can I move my Claude Code setup to Grok Build?

Run /import-claude in the Grok Build TUI to bring over permissions, environment variables, MCP servers and hooks. /resume-claude continues an earlier Claude Code session.

Can I use Claude models in Grok Build?

Yes, on Premium and higher plans. Third-party models are not part of the included usage pool and are billed at API list price from prepaid credit.

Keep reading