How to prompt Grok 4.6
Prompt Grok 4.6 with a short, fixed skeleton: GOAL (one outcome), CONTEXT (audience, inputs, limits), OUTPUT FORMAT (exact shape) and QUALITY BAR (include, avoid, and what to do when uncertain). Put static instructions first and the variable question last. Match reasoning_effort to the difficulty of the work, because reasoning can’t be switched off.
A note on sources. xAI doesn’t publish a dedicated prompt-engineering guide for Grok 4.6 the way Anthropic and OpenAI do for their models. The model facts, reasoning levels and ordering advice below come from xAI’s documentation. The ALL CAPS skeleton is a structuring convention that works well in practice, not an xAI requirement.
Key facts about Grok 4.6
- 500K-token context window. Large codebases and long transcripts fit without aggressive trimming.
- Reasoning is always on. The only control is
reasoning_effort:low,medium,high(default) orxhigh. - Built for long-running agents, with context compaction and function calling for tool-heavy work.
- Some sampling parameters don’t apply. Presence and frequency penalties and stop sequences can’t be combined with reasoning requests.
The prompt skeleton
GOAL:
Add rate limiting to the public search endpoint so a single API key
can make at most 60 requests per minute.
CONTEXT:
- Audience: backend team, Go service using chi router
- Inputs: the search handler and middleware folder
- Constraints: Redis is already available; no new services
OUTPUT FORMAT:
- Diff of changed files
- Short note on how limits reset
QUALITY BAR:
- Include: response headers showing remaining quota
- Avoid: changing authenticated endpoints
- If uncertain: state the assumption and continue
Pick one structuring convention and stick to it. Mixing XML tags into this skeleton makes the structure ambiguous.
GOAL: an outcome, not an activity
“Add pagination so clients can request pages of 50” is a goal. “Look at the results endpoint” is an activity. Write one sentence with a direct verb and the result you expect.
Don’t pad the prompt with the model’s own name and version. It adds tokens without changing behaviour.
CONTEXT: short bullets of real facts
Cover who the output is for, what the model has to work from, and the limits that shape the work. Keep it to bullets.
- Only include facts you actually have. Use a placeholder like
[detail TBD]instead of a plausible guess. - In code, point at the relevant files rather than dumping the whole tree.
- Grok can search the web and X, but don’t assume live search is in play unless your request needs it. Never ask it to “cite a post” you haven’t provided.
OUTPUT FORMAT: say the shape positively
Name the sections and their order, any length limit, and whether you want a table, JSON or prose. “Answer in three short paragraphs” steers better than “don’t write too much”. For code, prefer diffs and cap the explanation.
QUALITY BAR: include the uncertainty rule
The QUALITY BAR has three parts:
- Include: what must be present for the answer to be complete.
- Avoid: what would make the answer wrong or unusable.
- If uncertain: whether to ask, flag the gap, or state an assumption.
The “if uncertain” line is the part most often left out, and the one that most reduces confident fabrication.
Put static content first
xAI’s caching guidance also makes for better prompts. Put system instructions, examples and reference documents at the start, where they form a stable prefix, and the specific question at the end.
In multi-turn conversations, append new messages instead of editing earlier ones. Keep a stable conversation ID so requests route consistently. Caching changes speed, not output quality.
Choosing reasoning effort
low— fast; straightforward tool calls and latency-sensitive apps.medium— data analysis and long-context reasoning of moderate difficulty.high(default) — hard multi-step logic and maths.xhigh— the hardest problems, where quality matters more than time.
Choose effort by how hard the work is, not by how long the prompt is.
Why Grok prompts go wrong
- The GOAL describes an activity instead of an outcome.
- No audience, so tone and depth are guesswork.
- No output format, so the structure doesn’t fit where the answer is going.
- No “if uncertain” rule, so gaps get filled with inventions.
- XML tags mixed into the ALL CAPS skeleton.
- Variable content placed before the stable instructions.