Early access: your sandbox is free, with $5 of AQ Composer credits every month. Your own subscriptions stay unmetered. Start free

aq.dev / guides / grok-4-7-for-coding-agents

Grok 4.7 for Coding Agents: What Changed and How to Run It

Grok 4.7 is xAI's new flagship model, released September 21, 2026. Unlike Grok 4.6, which was a post-training upgrade over 4.5, this is a new and larger base model, trained with a longer reinforcement-learning run on a harder task mix weighted toward problems that take many hours, with better self-verification and long-context management as the stated goals. Pricing did not move: $2 per million input tokens and $6 per million output below 200K prompt tokens, a 500K context window, and four reasoning-effort levels from low to xhigh. The headline gain is agentic endurance (xAI reports Terminal-Bench 4.0 nearly doubling, from 20.3% to 38%), and the headline catch, measured independently on launch day, is token appetite: it burned roughly twice the output tokens per task of its predecessor. Both halves matter if you run coding agents all day. (One naming note carried over from our 4.6 guide: xAI rebranded as SpaceXAI after merging into SpaceX in July 2026, but the API, docs, and model IDs still live under x.ai.)

What xAI says changed

All numbers in this section are xAI's own, published with the September 21, 2026 launch:

BenchmarkGrok 4.6Grok 4.7
Terminal-Bench 4.020.3%38.0%
DeepSWE v1.1 (high effort)65.2%71.0%
CursorBench 4.040.4%46.3%
EEBench53.0%64.0%

The launch material frames the release around long-horizon work: a bigger base model, a longer reinforcement-learning stage with its task distribution shifted toward many-hour problems, and a model that checks its own intermediate results more carefully before moving on. The table backs the framing. The biggest jumps are on the benchmarks that reward staying power (Terminal-Bench 4.0 is multi-hour terminal work) rather than raw single-patch skill, where the CursorBench and DeepSWE moves are solid but not dramatic. xAI also reports gains on knowledge-work evals (its table includes AA-Briefcase v1.1, the Harvey Legal Agent Benchmark, and HealthBench Professional) and claims the model is meaningfully better at producing documents and presentations. On EEBench, an electrical-engineering benchmark, xAI reports 64.0%, ahead of the GPT-5.6 Sol Max and Claude Fable 5.1 Max scores it published alongside (39.4% and 56.4%).

The independent read, launch day

Artificial Analysis measured Grok 4.7 on September 21, 2026, and the picture it draws is more specific than the launch post. On its Intelligence Index the model scored 46 at xhigh effort, a two-point rise over Grok 4.6 that lands mid-pack: Claude Fable 5.1 and GPT-6 lead the index at 53. On its Coding Agent Index, which scores model-plus-harness pairs on real tasks, Grok 4.7 paired with Grok Build scored 56, up nine points over 4.6 and fourth overall behind Claude Fable 5.1, GPT-6 Astra, and Claude Opus 5. On AA-Briefcase, its evaluation of realistic professional work, Grok 4.7 reached 1657 Elo, just behind Claude Opus 5 and Fable 5.1. For a model priced at a third of most frontier peers, fourth place on agentic coding is a genuinely strong result.

Two caveats deserve equal billing. First, Terminal-Bench 4.0: Artificial Analysis measured 26% in its own harness, well under xAI's reported 38%, and far behind the 60% and 55% it records for GPT-6 Astra and Claude Fable 5.1. Harness, tool configuration, and token budgets move agentic scores a lot; when a vendor number and an independent number disagree this much, the honest read is a range, not a point. Our guide to benchmarking the model or the harness covers why these gaps happen. Second, verbosity: running the Intelligence Index, Grok 4.7 at xhigh generated about 81K output tokens per task, versus roughly 36K for Grok 4.6 at high effort and 27K for GPT-6 Astra Max, about 240M tokens in total against a 94M median for the models it tracks, averaging around 7.1 minutes per task at 39.3 output tokens per second (54.2 at high effort).

The cost math for agent teams

The unchanged list price and the doubled token appetite point in opposite directions, and the second one wins more often than you would guess. A model that charges $6 per million output tokens but spends twice the tokens per completed task is not half the price of a $12 model; depending on the workload it can come out even or worse, and launch-week coverage (VentureBeat, September 2026) made exactly this point about real-world ROI. The number that matters for a team running coding agents is cost per completed task on your own repository: same task, same done criteria, measured end to end. List price per token is an input to that number, not a substitute for it. The long-context tier compounds this: at or above 200K prompt tokens, rates double to $4 input and $12 output per million, and many-hour agent sessions are precisely the ones that grow prompts that large.

How to run it

Four ways, as of September 2026:

The xAI API. Model ID grok-4.7, available since launch day. $2 input, $0.50 cached input, $6 output per million tokens below 200K prompt tokens; $4, $1, and $12 at or above it. 500K context window, reasoning effort selectable from low to xhigh (high is the default).

Grok Build, xAI's coding CLI. Grok 4.7 is available in Grok Build from launch day. Grok Build remains the terminal agent xAI shipped in May 2026: plan mode with approvals, parallel subagents on git worktrees, headless mode, MCP support. The CLI is open source, but signing in requires a SuperGrok subscription ($30/month, with higher tiers above it), which is still the cheapest way to run the model heavily without metering yourself per token.

Third-party surfaces. GitHub Copilot added Grok 4.7 on launch day for Pro, Pro+, Max, Business, and Enterprise plans, selectable across VS Code, Visual Studio, JetBrains, Xcode, Eclipse, the Copilot CLI, and its cloud agent. Cursor and the major model routers listed it the same day.

Side by side with other agents in AQ. More on that below.

When to pick it, when not to

Pick Grok 4.7 when the work matches what it was tuned for: long-running agent sessions that plan, execute, and verify over hours, where its self-checking and the near-doubled Terminal-Bench number (even the conservative independent one is a jump from 4.6) pay off, and where the SuperGrok flat rate or the low list price caps your spend. It is also, on the independent numbers, the strongest Grok yet at agentic coding by a wide margin.

Reach for something else when latency dominates (roughly 7 minutes per benchmark task and sub-55 tokens per second compound painfully in tight interactive loops), when your workload is metered per token and verbosity would eat the price advantage, or when you need the strongest terminal-driving model available regardless of cost: on independent measurement the frontier leaders still clear it by 2x on Terminal-Bench. The honest summary of launch-day evidence: the biggest agentic step Grok has taken, priced aggressively, with a token appetite that means you must do your own cost math.

Test it against your incumbent, on your own repo

Benchmark deltas are somebody else's repo. The only number that matters is how a model handles your codebase, your test suite, your conventions, and for this release specifically, what a many-hour run actually costs you at your own prompt sizes. The cheap way to get it: give the new model and your incumbent the same real task from your backlog, in parallel isolated checkouts, and compare the sessions, not just the diffs. Our guide to reviewing an AI coding session covers what to look for beyond the patch: how the agent explored, what it verified, where it guessed.

Where AQ fits

AQ is the multiplayer coding harness where engineering teams run AI coding agents like Claude Code and Codex together: shared live terminals, a code editor, and app previews, in your own cloud. Grok runs in AQ as the real xAI CLI, next to Claude Code, Codex, Cursor Agent, Kimi, and plain shells, each in its own workspace on an isolated git worktree. That makes release weeks like this one cheap to evaluate: open two workspaces on the same repository, give Grok 4.7 and your current default the same task, and let the whole team watch both live sessions from the browser to judge the difference on your own code. You sign into the CLI with your own xAI subscription, and AQ never marks up usage on your own subscriptions. Sessions run on your team's VM and survive closed laptops, which suits exactly the many-hour agent runs this model was trained for.

Frequently asked questions

What does Grok 4.7 cost through the API?

As of September 2026: $2 per million input tokens, $0.50 per million cached input tokens, and $6 per million output tokens for prompts under 200K tokens. At or above 200K prompt tokens, rates double to $4, $1, and $12. That is unchanged from Grok 4.6, but independent launch-day measurement found 4.7 generating roughly twice the output tokens per task, so cost per completed task can rise even though list price did not.

Is Grok 4.7 better than Grok 4.6 for coding agents?

Yes, on every published number. xAI reports Terminal-Bench 4.0 rising from 20.3% to 38%, DeepSWE v1.1 from 65.2% to 71%, and CursorBench 4.0 from 40.4% to 46.3%. Independently, Artificial Analysis scored the Grok 4.7 plus Grok Build pairing 56 on its Coding Agent Index, nine points over 4.6 and fourth overall. The trade is speed and verbosity: it runs slower and spends more tokens per task than 4.6.

Why do xAI and Artificial Analysis report different Terminal-Bench scores?

xAI published 38% on Terminal-Bench 4.0; Artificial Analysis measured 26% in its own harness on launch day. Agentic benchmarks are sensitive to the harness, tool configuration, reasoning effort, and token budget used, so vendor and independent numbers routinely diverge. Treat the pair as a range, and treat the gap itself as a reminder to test on your own tasks before switching defaults.

How big is Grok 4.7's context window?

500K tokens through the xAI API, the same as Grok 4.6, with reasoning effort selectable from low to xhigh (high is the default). Pricing steps up once a prompt reaches 200K tokens, so the long, many-hour agent sessions the model was tuned for are also the ones that hit the doubled rate.

How can my team try Grok 4.7 next to the agent we already use?

Run both on the same task and compare. In AQ, each agent CLI runs in its own workspace on an isolated git worktree of the same repository, so you can give Grok Build and Claude Code the identical backlog item, watch both live sessions in the browser, and review the two sessions side by side. Everyone signs in with their own subscriptions, and AQ adds no markup on your own subscriptions.