Writing & chat · guidance updated 18 Oct 2026
Grok prompt guide
Grok 4.7 (API, Cursor, Grok Build, gateways). 500k context, May 2026 cutoff. Reasoning always on; control depth via reasoning_effort (low/medium/high/xhigh). Encrypted reasoning auto-returned. Grok 4.7 Fast on Cursor/Grok Build (2x cost).
How to prompt Grok
- Give concrete material (data, notes, actual text) rather than placeholders; xAI stresses detailed queries.
- State specific goal and success criteria up front.
- Trigger live data explicitly: 'search X for posts from last 24 hours about...' or 'search web'.
- Use low reasoning effort for fast agentic work; medium for complex analysis; high (default) for hard problems; xhigh for maximum quality.
- For API users, set prompt_cache_key to route requests to same server and ensure reliable cache hits.
- On Responses API, pass encrypted reasoning items back unchanged in next request to maintain reasoning across turns.
- Ask for sources or links for any claim from search results.
- Structure longer prompts with Markdown headings or XML tags.
- Use context compaction for long agent loops to reduce input tokens on repeated calls.
- Iterate with short follow-ups rather than rewriting whole prompt.
- Specify output format and length; Grok 4.7 produces lengthy output by default.
The shape of a good prompt
## Goal [what you want and why] ## Context [facts, pasted data, constraints] ## Live data [search X / web, time window, sources wanted] ## Reasoning effort [low/medium/high/xhigh or accept default] ## Output [format, length, stance wanted?]
Avoid
- Vague one-liners with no context
- Expecting current events without requesting search
- Leaving placeholders instead of real data
- Asking for balanced overviews when you want a verdict
- Ignoring encrypted reasoning on multi-turn Responses API calls
- Requesting presencePenalty, frequencyPenalty, or stop with reasoning models
Example
Request what do people think of the new iphone
## Goal Give me a snapshot of public reaction to the newest iPhone model. ## Live data Search X posts from the last 7 days and recent reviews on the web. Cite the posts and articles you rely on. ## Output - 3 most-praised features and 3 most-common complaints, each with a one-line example quote - Overall sentiment: positive, mixed or negative, with a one-sentence reason - Your direct verdict on whether it is worth upgrading from a two-year-old iPhone Keep it under 250 words.