Grok Build tutorial series

Finish your first reviewable Grok Build task

Plan first, edit a small surface, then read the diff. No MCP and no production config in this chapter.

What to prepare

Use a practice repo or a small project you know. Confirm git status is clean or that you can revert.

Start grok in the project directory. If you are still stuck on login or PATH, return to install or troubleshooting.

Name one ban for this round: no commit, no push, no secret files.

  1. Pick a practice repo and enter it.
  2. Confirm you can revert.
  3. Write down what this round must not do.

Put the plan latch on first

In the TUI, /plan enters plan mode. Public docs describe a file-edit gate: other files stay blocked until you approve; only the session plan file may change.

That gate is independent of permission mode (ask, auto, always-approve). Auto-approve does not secretly edit during plan mode.

Shift+Tab may cycle modes on your build; trust local shortcuts. Reopen a plan with the client’s view command.

Keep the first plan short: files, verification, and what you will not do.

  • Scope the work with /plan.
  • Do not expect the worktree to change before approval.
  • Write verification as a command you can actually run.
Diagram of the plan, approve, small edit, review, revert loop.
Plan before files change. Until you approve, the worktree should stay as quiet as you expect.

How to write the first prompt

A good prompt names directories, a verify command, and bans. A bad prompt is “clean up the repo while you are here”.

Public docs have suggested read-only openings such as explain this repo. Read first, then approve writes.

Point at paths the client understands instead of pasting the whole tree.

  • Name paths and a verify command.
  • Name paths that must not move.
  • Explain, then edit.

A few TUI commands are enough

Besides /plan you will meet /model. /skillify belongs in the skills chapter.

Session and context commands live under /help. Do not memorize the full table before doing work.

  • /plan for the plan.
  • /model only when you intend to switch.
  • /help for commands that exist on your build.

How to read the diff and revert

After you approve the plan, still read file by file. Confidence is not a test run.

Use your usual git diff. Do not trust the TUI summary alone.

If you dislike the result, revert. Do not stack “try again” on a dirty tree.

  1. Plan, then diff.
  2. Run the verify command you named.
  3. Revert and narrow the prompt on failure.

Can the same task run headless?

Yes: pass the same sentence to grok -p. Week one is still easier in the TUI where you can see the plan.

Scripts need a working directory and a failure exit. Leave streaming-json until you will parse it.

  • Headless fits a stable read-only task.
  • Do not give CI write access on day one.

How to recover

Drift is usually a wide scope, not a missing “please be careful”. Narrow the file list.

A plan that names a test command you never ran will waste a whole turn.

If login drops, go to troubleshooting instead of switching repos.

  • Narrow paths.
  • Run the verify command yourself.
  • Do not retry three times on a dirty tree.

First-task mistakes

Skipping plan mode and asking it to “fix every warning”.

Handing the agent production secrets or an env file as a sample.

  • Demanding a commit on round one.
  • A plan with no verify command.
  • Practicing force-push on the main repo.

What done means

Done means you read the plan, read the diff, ran verify, and know how to revert.

  1. Opened a plan-mode turn.
  2. Can explain the worktree change.
  3. Ran the verify command.
  4. Committed no secrets.
  5. Ready to write one AGENTS.md ban.

Next: write the habit into config

The config chapter reads config.toml, runs grok inspect, and writes a short instruction file.

If the plan latch disagrees with docs, trust your machine and official text.

FAQ

Is plan mode required?

Strongly recommended in week one. It blocks edits until you agree on scope.

Does plan mode fight auto-approve?

Public docs treat the file gate as independent of permission mode.

Can I write files headlessly from the start?

You can. You should not. Watch one TUI turn first.

How long should the first prompt be?

Half a screen: paths, verify, bans.

The agent changed too much. Now what?

Revert, shorten the file list, start a new turn.

Should I switch /model on day one?

No, if the default finishes a small task.

Two repos at once?

Possible, but finish one loop in one practice repo first.

All chapters in this series

  1. 1. What Grok Build is: TUI, headless, and ACP
  2. 2. How to install Grok Build (CLI, login, headless)
  3. 3. Finish your first reviewable Grok Build task
  4. 4. Grok Build config, inspect, and AGENTS.md
  5. 5. Grok Build skills, /skillify, and plugins
  6. 6. Wire MCP into Grok Build
  7. 7. Grok Build versus Codex: how to choose
  8. 8. Grok Build troubleshooting: login, inspect, MCP, plan latch