When prompting stops being the point

The vocabulary of agentic engineering moves fast. Context Engineering begat Harness Engineering, which begat Loop Engineering, which has now begat Goal Engineering. Each layer answers a different question. Context Engineering asks: what does the model see? Harness Engineering asks: how does a single run execute safely? Loop Engineering asks: what keeps prompting on a cadence? Goal Engineering asks the most consequential question of all: how do we run until verifiably done?

Cobus Greyling, Chief Evangelist at Kore.ai, coined the term in a Medium essay and Substack post published June 23–24, 2026. The concept is built on top of xAI's /goal feature, introduced in Grok Build on June 22, 2026. Greyling's GitHub repository, created June 23, serves as the canonical reference — patterns, verifier skills, audit tooling, and the operating playbook.

The thesis is simple: stop designing prompts. Start designing verifiable goals that agents pursue until completion is confirmed by something other than the agent that did the work.


What /goal Actually Does

Grok Build is xAI's terminal-based coding agent CLI. Before /goal, the workflow was turn-by-turn: write a prompt, read the output, write the next prompt. That still works. But for bounded implementation work, you can now hand off the entire objective in one line:

/goal Migrate the auth module to the new API

Grok plans an approach, breaks the work into a visible checklist, fans out subagents where needed, and keeps executing across turns until the task is completed and verified. The agent reviews code, runs tests, inspects pages, and fixes what breaks — repeating until the done condition holds.

Steering commands keep you in control without micromanaging:

Command Purpose
/goal status Live progress panel
/goal pause Stop work, keep the objective
/goal resume Pick back up
/goal clear Drop the goal entirely

When the goal finishes, the panel flips to Complete with every checklist item checked.

Access requires a SuperGrok or X Premium Plus subscription. You install the CLI with:

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

The API Surface: Not a Longer Prompt, a Lifecycle

Under the hood, /goal is not a bigger prompt. It is a lifecycle with explicit telemetry. The update_goal tool is the quiet workhorse. The agent calls it at meaningful milestones instead of flooding the chat:

{ "message": "Migrated token refresh; 12/18 auth tests passing" }

Completion is explicit and must be earned:

{ "completed": true, "message": "All auth tests pass; legacy imports removed" }

When genuinely stuck after repeated failed attempts, the agent can pause with a blocker:

{ "blocked_reason": "OAuth sandbox credentials expired; need human to rotate secrets" }

/goal appears when the goal feature is enabled and updategoal is in the session toolset. Humans check /goal status; the agent logs via updategoal. Clean separation.


The Four Primitives

Greyling's repo identifies four primitives every reliable goal run needs. These are not optional. Skip any one and the goal degrades into a chat session with extra steps.

1. Objective

One bounded sentence plus a verifiable done condition. Not "make auth better." Something like:

Migrate to lib/auth/v2; done when all tests/auth/ pass, zero legacy/auth imports remain, and GOAL.md checklist is complete.

The done condition is the contract. Without it, the agent has no termination criterion and will either declare victory early or run forever.

2. Verifier

The agent that wrote the code is a poor judge of its own work. This is structural, not a model limitation. The verifier can be:

  • A test suite (pytest, npm test, CI)
  • A goal-verifier skill — a separate agent that checks the implementer's output
  • A reviewer sub-agent spawned to audit the diff
  • A CI pipeline that must pass before completed: true is sent

The rule is absolute: the implementer must never grade its own homework. This is the single most important design constraint in goal engineering. Every failure mode where an agent marks done too early traces back to a weak or missing verifier.

3. State — GOAL.md

GOAL.md is the external memory file for goal mode. Grok's context can compact or reset between turns. GOAL.md lives in the repo and does not. It holds:

  • The objective and definition of "done"
  • Guardrails (what not to touch, deny lists)
  • A running log of what was tried

Without external state, three things break:

  1. Progress gets lost after compaction
  2. The agent re-scopes or declares victory early
  3. You cannot audit what was tried or why it stalled

/goal persists an objective across turns, but the chat context does not. GOAL.md bridges that gap.

4. Budget

Goals can run many turns. A goal that spawns implementer + verifier subagents across dozens of turns will burn through a plan faster than a single chat session. Budget deliberately:

  • Document turn caps and token guidance in goal-budget.md
  • Maintain deny lists for high-risk paths
  • Keep kill switches accessible (/goal pause)

Unbounded autonomy is exciting in research. In production, it is a liability.


The Stack: Where Goal Engineering Sits

Greyling maps agentic engineering as layers, each answering a different question:

Layer Unit Question
Context Engineering One inference What does the model see?
Harness Engineering One agent run How does a single run execute safely?
Goal Engineering One bounded objective How do we run until verifiably done?
Loop Engineering Autonomous system over time What keeps prompting on a cadence?
Fleet Engineering Agent populations How do many agents coordinate at scale?

Each layer is a prerequisite for the one above it. You cannot engineer goals without a harness that executes safely. You cannot engineer loops without goals that terminate. The stack is cumulative, not competitive.


Goal vs. Loop: Complementary, Not Interchangeable

Greyling wrote about loops extensively in his Loop Engineering repository. Goals and loops solve different problems:

Dimension Goal Loop
Trigger You set an objective Schedule or automation
Duration Until done, blocked, or cleared Recurring forever (or until cancelled)
Best for Finish a bounded task Discover and triage ongoing work
State file GOAL.md STATE.md, LOOP.md
Grok command /goal /loop + scheduler

Production setups combine both. A daily loop triages CI failures and writes priorities to STATE.md. When it surfaces a fixable item, you hand off to /goal for run-until-done execution. The decision tree is straightforward:

Do you know what "done" looks like?
├─ No  → Plan mode or exploratory session first
└─ Yes → Is the work recurring on a schedule?
         ├─ Yes → Loop
         └─ No  → Goal

As Greyling puts it: loops discover work. Goals finish it.


Cross-Tool Primitives: The Capability Matters, Not the Product

The primitives matrix in Greyling's repo maps goal concepts across four coding agents — Grok Build, Claude Code, Codex, and Cursor. The point is that goal engineering is not a Grok feature. It is a discipline:

Primitive Grok Build Claude Code Codex Cursor
Set objective /goal <objective> /goal /goal Agent + explicit stop condition
Progress telemetry update_goal tool Goal progress APIs / state files Goal mode + state Hooks + state files
Pause/resume /goal pause/resume /goal pause/resume Pause/resume Manual session control
Verifier goal-verifier skill + Task subagent Reviewer agent Verifier subagent Review mode / second agent
State GOAL.md GOAL.md / progress files Markdown state GOAL.md
Worktrees Task with worktree isolation git worktree Built-in worktree Cloud agent worktree
Skills .grok/skills/ .claude/skills/ .codex/skills/ .cursor/skills/

If your tool does not have /goal as a slash command, you can still practice goal engineering. You set an objective with an explicit stop condition, maintain state in a file, and use a separate agent or test suite as the verifier. The pattern is tool-agnostic.


Patterns: Six Starter Templates

The repo ships six patterns with starter templates:

  1. Tests Green — CI red to green with verifier gates. Start here if you have never run a goal.
  2. Migrate Module — API or module migration plus import scan to catch leftover references.
  3. Implement Feature — Scoped feature with acceptance criteria.
  4. Fix Bug — Reproduce, fix, add regression test.
  5. Refactor Safely — Behavior-preserving refactor with test gates.
  6. Coverage Target — Raise test coverage to a threshold.

Scaffold any of them:

npx @cobusgreyling/goal init . --pattern tests-green --tool grok

Unsure which pattern fits? Run the Pattern Picker.


CLI Tools: Audit Before You Trust

The goal-engineering repo includes three CLI tools, also published on npm:

goal-audit — Scores goal readiness on a G0–G3 scale from signals: GOAL.md presence, skills, verifier, tests, CI, budget documentation, and run log freshness.

npx @cobusgreyling/goal-audit . --json --min-level G2

Exit code 2 if below threshold. Wire it into CI:

- uses: cobusgreyling/goal-engineering/.github/actions/goal-audit@main
  with:
    path: .
    min-level: G2

goal-init — Scaffolds a goal pattern into your repo:

npx @cobusgreyling/goal-init . --pattern tests-green --lang python

goal-cost — Estimates token cost for a pattern:

npx @cobusgreyling/goal-cost --pattern fix-bug

There is also a unified meta-package:

npx @cobusgreyling/goal doctor . --suggest
npx @cobusgreyling/goal init . --pattern tests-green --tool grok
npx @cobusgreyling/goal estimate --pattern tests-green --level G2

The audit is the starting point. Before you trust an autonomous goal with a module migration, run the audit on your repo. It will tell you what is missing — and it will be right.


Failure Modes: What Goes Wrong and How to Recover

The repo's failure modes doc is short, blunt, and worth reading before your first goal run:

Symptom Likely Cause Recovery
Agent marks done too early Weak done condition Add tests + goal-verifier; tighten /goal text
Goal "forgets" objective after compact No GOAL.md Mirror /goal in GOAL.md; agent reads each turn
Endless turns, no progress Objective too large Split into smaller goals; use Plan mode first
blocked_reason on first error Agent too eager to block Instruct: try 3+ approaches before blocking
Chat flooded with progress Not using update_goal Remind agent: milestones → update_goal(message) only
Loop and goal fight Same file, two automations Loop triages only; goal executes one item
/goal not in command list Feature disabled or tool missing Ensure goal feature enabled; update_goal in toolset

The recovery pattern for any stall is the same:

  1. /goal pause
  2. Read GOAL.md + last agent diff
  3. Fix environment (credentials, flaky test, deny list)
  4. Update GOAL.md with human decision
  5. /goal resume or /goal clear + new narrower objective

The Realities Nobody Should Skip

Greyling is clear about the trade-offs. Three points stand out:

"Done" is a claim until verified. The verifier helps. It does not replace you reading what landed in the repo. A goal that says "completed: true" with all tests passing still needs a human review of the diff. The verifier catches broken builds and missing imports. It does not catch architectural decisions you would have made differently.

Token costs multiply. A goal that spawns an implementer subagent and a verifier subagent across 30 turns is not the same cost profile as a chat session. It is closer to running two agents in parallel for the duration of the task. Budget deliberately. Use goal-cost to estimate before you start. Set turn caps in goal-budget.md. Keep /goal pause within reach.

Comprehension debt grows faster with good goals. The agent shipped the migration. All tests pass. The verifier confirms zero legacy imports. You still do not understand how the new code works. Goals accelerate output. They do not accelerate your understanding of that output. Build goals like someone who intends to stay the engineer.


How xAI's /goal Compares

MarkTechPost published a comparison on June 22:

Dimension Grok Build /goal Claude Code OpenAI Codex CLI Cursor Agent Mode
Handoff model One-line goal object Conversational + task list Prompt with approval mode Chat instruction in IDE
Progress view Auto checklist + live panel Internal to-do list Step-by-step log Inline edit stream
Steering controls status / pause / resume / clear Interrupt and reprompt Approve / reject steps Accept / reject edits
Verification Runs until completed and verified Runs tests when instructed Runs tests when instructed Runs tests when instructed
Where it runs Terminal (TUI, headless, ACP) Terminal Terminal IDE-integrated

The differentiator is the explicit goal object with a named lifecycle. Other agents run multi-step work. Grok Build's /goal makes the objective a first-class entity with pause, resume, and clear semantics — and builds verification into the termination condition rather than leaving it to the user's discretion.


Getting Started: Five Minutes

# 1. Audit your repo
npx @cobusgreyling/goal doctor . --suggest

# 2. Scaffold a pattern
npx @cobusgreyling/goal init . --pattern tests-green --tool grok

# 3. In Grok Build, set the goal
/goal Read GOAL.md. Implement the scoped objective. Run tests after each meaningful change. Use update_goal for progress. Do not mark completed until the verifier skill passes.

# 4. Monitor
/goal status

# 5. When done, verify yourself
git diff
npm test

Start with one small objective. A bug fix with a regression test. Not a module migration. The audit will tell you what your repo is missing. Fix those gaps first.


The Bigger Picture

Boris Cherny at Anthropic says his job is to write loops, not individual prompts. Peter Steinberger says you should design loops that prompt your agents. xAI's /goal pushes the same direction from the Grok side: hand off bounded objectives, let the agent run until verifiably done, steer with pause/resume/status instead of micromanaging every turn.

Goal engineering is not a bigger prompt. It is a system with persistence, telemetry, explicit lifecycle, and a verifier that does not let the implementer grade its own homework. The prompt was the unit of work when models were single-turn. The loop became the unit when agents needed cadence. The goal is the unit now that agents can run until a verifiable condition holds.

The repo is at github.com/cobusgreyling/goal-engineering. MIT licensed. The patterns are forkable. The audit runs on any repo. If you are building agent workflows that need to finish — not just run — this is the reference.


Sources


Article Metadata

Suggested title: Goal Engineering: The Layer Above Loops

Word count: ~2,100

Fact-check notes:

  • xAI /goal announcement date: June 22, 2026 — confirmed via xAI news URL and MarkTechPost coverage.
  • GitHub repo cobusgreyling/goal-engineering created June 23, 2026 (search result metadata shows 2026-06-23T10:23:54Z).
  • Medium essay published June 24, 2026 (Medium shows "5 days ago" as of June 29, consistent with June 24). Substack post dated June 23, 2026.
  • Repo had 3 stars at time of search — early-stage project.
  • Loop Engineering repo referenced as companion; Greyling is author of both.
  • Primitives matrix and failure modes docs fetched directly from GitHub raw content.
  • MarkTechPost comparison table sourced from their June 22 article.
  • Access requires SuperGrok or X Premium Plus subscription (per MarkTechPost).
  • All code examples and JSON snippets sourced from Greyling's Medium/Substack essays and GitHub README.