GROK BUILD

An agent is a model, tools, and a loop

What Grok Build is actually doing when you type a sentence: a model decides, tools act, and the result comes back until the job is done or the run gets stuck.

Figure 1: Your request goes to the model, the model calls a tool, and the tool result comes back into the loop.

1. Three pieces, and that is the whole machine

Grok Build is a coding assistant that runs in your terminal. You start it with the grok command, inside the project you want it to work on. Install it from the current Grok Build instructions. The install line changes, and this page will not pretend a copied command stays right.

Once it is open, the work has three pieces:

  • A model reads your request and decides the next step.
  • Tools let it act: read a file, edit a file, search the project, run a command, or look something up on the web.
  • A loop feeds each result back to the model, which decides again, until the job is done or the run gets stuck.

That is an agent. The chat window is only how you see the loop. A chatbot that answers one question and stops is a different thing. Grok Build keeps going, and you can watch each step in the scrollback.

2. The harness is everything around the model

The model is not the product. The harness is the rest: which tools exist, when Grok must ask you first, the project rules, the skills, and the saved session. Two people can use the same model and get different work, because the harness is different.

A practical way to hold this: the model is a new teammate who is fast and literal. The harness is the office around them. Keys, the handbook, and the rule that they ask before they change a file. Later pages in this series are about that office. This page is only the shape of the machine.

3. When a run fails, read the step that failed

A bad result is usually one bad step, not a bad personality. Open the scrollback and find the turn where it went wrong. A command that failed. A file it misread. An assumption it wrote down and then treated as fact.

Example. You asked it to fix a failing test. It edited the wrong file, ran the test, and the same failure came back. The useful next sentence is about that step: “The failure is in invoice_test, and you edited export.py. Look at invoice_test again.” Rewriting the whole request in fancier words hides the step you already found.

Read that scrollback as a list. The test command, the failure text, the file it opened, the edit it made, the test command again. The first false line in this example is the file name. Everything after it was spent on the wrong page. Pointing at that line is faster than starting the brief over.

Layman rule: Name the step that broke. Do not start over with a longer adjective.

4. The conversation is a budget

The model can hold only so much text at once. Some of that space is already used before you type, by the tools, the project rules, and the skills. A huge log, a whole folder dumped into the chat, or a long argument about a dead end all spend the rest.

When the window fills, later answers get worse. Grok can compress the history. That is a later page. For now, the habit is smaller inputs: the file that matters, the error that matters, the decision you already made. Point at those. Do not paste the world.

5. What to try on the next real task

Pick a small job you already understand. A broken test, a label, a script you can run. Tell Grok what finished looks like. Let it work. When it stops, read the tool calls, not only the last paragraph.

If the result is wrong, point at the step. If the result is right, you still read the change before you keep it. The next page is about that job, which is yours: you manage, and Grok builds.

Commands and shortcuts in this series match Grok Build’s own behavior, and they do change. If a slash command here does not exist in your session, the list inside the product is the current one.