Skip to main content

Grok Build vs Claude Code: I Tested Both On a Rigged Dataset

Learn how Grok Build and Claude Code differ in practice: I planted three defects in a dataset and ran the same five-turn conversation through both agents.
Aug 22, 2026

Explore with AI

ChatGPTClaudePerplexity

Six months ago, "terminal coding agent" meant Claude Code and a handful of open-source clones. Grok Build changed that recently in May 2026, and its resemblance to Claude Code goes further than the feature list. 

xAI's team says Grok is compatible with Claude Code with zero configuration, and that it automatically reads Claude Code marketplaces, plugins, skills, MCP servers, agents, hooks, and instruction files, including CLAUDE.md and .claude/rules/. You can point Grok at a repository already set up for Claude Code, and it will pick up that configuration and run.

The interesting question isn't "which one has more features." The question I actually wanted answered was whether the resemblance goes all the way down. Is Grok Build effectively Claude Code with a different model behind it? So, I built a dataset with three defects planted in it, and ran the identical script through both agents. 

TL;DR: Grok Build vs. Claude Code

If you only read one section, make it this one.

  • Feature parity is real. Plan mode, subagents, skills, hooks, MCP, headless mode, sandboxing, and worktrees both have all have it. 

  • Grok reads .claude/ directories, CLAUDE.md, and Claude Code skills without any setup, so you can try Grok on a repository you have already configured for Claude Code. Claude Code does not read Grok's own .grok/ files, so a Grok-first setup doesn't transfer back. So, if you're going to experiment with both, configure things the Claude Code way.

  • Across four turns, every statistic Grok it cited checked out exactly against my dataset, including figures it computed unprompted.

  • Claude produced substantially more analysis and needed checking. It found a real production bug that neither Grok nor I caught. It also shipped two invented counts and a display bug, all in the most quotable parts of its output.

  • Claude Code runs in the terminal, IDEs, desktop, web, mobile, and Slack. Grok Build is terminal-first, with Grok Bot as a separate cloud product.

  • /skillify has no Claude Code equivalent, and it's the one genuine feature divergence I found.

Introduction to Claude Models

Learn how to work with Claude using the Anthropic API to solve real-world tasks and build AI-powered applications.
Explore Course

What Is Grok Build?

Grok Build is xAI's coding agent. It runs three ways: as an interactive TUI, headlessly in scripts and CI (with structured streaming-json output for capturing transcripts programmatically), or through the Agent Client Protocol (ACP) so other applications can embed it.

Grok Build

When you launch it, the status bar shows two things worth noting for later. The bottom right reads Grok 4.6 (high) (the model and reasoning effort in use, switchable with /model). The bottom left offers a new worktree, which lets Grok launch subagents into isolated Git worktrees rather than having them collide in a single directory.

One feature I want to flag early, because it has no Claude Code counterpart: Grok supports arbitrary custom models through ~/.grok/config.toml. You can point the CLI at any OpenAI-compatible endpoint, name it, and select it with /model. If you want one CLI across several model providers, that's a real architectural difference, not a cosmetic one.

Run grok inspect in a new repo to see what your agent is actually reading. It prints everything Grok discovered in the current directory: 

Getting started with Grok Build

To install Grok build on Mac OS, run:

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

On Windows, there's a PowerShell installer:

irm https://x.ai/cli/install.ps1 | iex

On first launch, it opens a browser to authenticate against your xAI or X account. In a non-browser environment, you export an API key instead:

export XAI_API_KEY="xai-..."
grok

To begin, you can cd into a repo and ask:

grok -p "Explain this codebase"
grok -p "Explain the architecture" --output-format streaming-json

For the full walkthrough (authentication, cross-session memory, safety permissions, project instructions, and a first end-to-end build), see our Grok Build tutorial.

What Is Claude Code?

Claude Code is Anthropic's agentic coding tool, which runs in the terminal, in VS Code and JetBrains, in the desktop and web apps, on mobile, and in CI. There's also a Slack integration and an Agent SDK that exposes the same loop programmatically.

Its extension model is a stack of primitives that build on each other. CLAUDE.md files set conventions per directory. The Skills package contains reusable workflows as SKILL.md files with frontmatter, invocable by name or auto-triggered when a task matches.

For this article, I ran Claude Code in the desktop app on Opus 5 at high reasoning effort. 

If you want the Claude-only version of a comparison like this one, our Claude Cowork versus Claude Code article covers it well. For the full install-and-first-project walkthrough, read our Claude Code setup tutorial.

Grok Build vs Claude Code: Key Features and Similarities

I'll spare you most of the basic comparisons between the two, because the honest summary is that they're the same product shape. So, here are some similarities I found in both:

 

Grok Build

Claude Code

Instruction files

AGENTS.md, CLAUDE.md, .grok/, .claude/

CLAUDE.md, .claude/

Skills

SKILL.md, slash commands, /skillify

SKILL.md, slash commands

Subagents

Yes, with worktree isolation

Yes, with agent teams

Plan mode

Yes, edits are blocked until approval

Yes

Hooks

Yes, with /hooks-trust

Yes

MCP

Yes

Yes, the protocol originated

Marketplace

xai-org/plugin-marketplace, commit-SHA pinned

Official and community catalogs

Headless

-p, streaming JSON

-p, Agent SDK

Custom model endpoints

Yes, any OpenAI-compatible API

No, Claude models only

Surfaces

Terminal, ACP embedding

Terminal, IDE, desktop, web, mobile, Slack

Three rows in the above table actually matter:

  • Instruction files: Grok reading .claude/ files isn't an accident; it's a documented feature, which means you can point Grok at a repository already set up for Claude Code and it works immediately, while a Grok-first setup doesn't transfer back.

  • Custom model endpoints: Custom model endpoints are a real fork because Grok can drive any OpenAI-compatible API, so it can act as one CLI across several providers, whereas Claude Code runs Claude models only. 

  • Surfaces: These decide where the work can happen at all, which is the row where Claude Code is clearly ahead.

Testing Grok Build and Claude Code on the Same Machine Learning Task

I generated a synthetic customer churn dataset with 5,427 monthly snapshot rows covering 1,800 customers, with three defects planted deliberately:

  • Leaky feature: days_since_cancellation only exists after someone has already canceled.

  • Severe class imbalance: 8.2% positive, so predicting "nobody churns" scores 91.8% accuracy.

  • Repeated customers: those 5,427 rows are only 1,800 people, so a random row split puts the same person in both training and test.

If all three are fixed, the honest number lands around 0.70 in ROC-AUC, which measures how well a model ranks a random positive above a random negative across all thresholds. A value near 1 means near-perfect separation of churners from non-churners, and a value of 0.5 is a coin flip.

I chose it as the metric for these tests because it's threshold-independent and doesn't get fooled by the 8.2% class imbalance the way raw accuracy does (where "predict nobody churns" scores 91.8% while being useless).

I wrote a four-turn conversation before running anything, and computed reference values for every scenario in scikit-learn 1.8.0 so I could grade transcripts against fixed numbers rather than impressions.

One honest caveat: This is not a controlled benchmark. It's one conversation per agent, run with Grok 4.6 at high effort against Claude Opus 5 at high effort. Both services change constantly. So, treat this as a detailed observation, and not a measurement.

Turn 1: Reading a rigged dataset

The entry prompt says nothing about leakage, grouping, or class balance, and it just asks the agent to train a model on a dataset:

Train a model to predict churn from churn.csv. Report how well it does.

What Grok Build did

Grok opened with the fixes it had already applied: days_since_cancellation dropped, customer_id dropped, split stratified by customer at 1,440 / 360. Only then did it report metrics.

The first row of its table is a majority-class baseline at 0.917 accuracy and 0.50 ROC-AUC. The "always predict no churn" at the top of the comparison makes the imbalance argument before anyone can misread the accuracy column. Its chosen model, balanced logistic regression, achieves an ROC-AUC of 0.74 on the holdout set and 0.71 in 5-fold cross-validation.

It also reported that the model catches 21 of 30 churners with 114 false alarms. The model can rank risk across a broader outreach list, but it cannot say "this customer will churn" because most flagged customers won't.

Grok Build Step 1

What Claude Code did

Claude reported an ROC-AUC of 0.727 and a PR-AUC of 0.237 from out-of-fold cross-validation, with a per-fold spread of 0.675 to 0.753. My own reproduction gives 0.724 and 0.241, so very close to Claude’s results.

It also went one step further than the brief and noticed that churned is a retrospective "ever churned" flag rather than a per-month event, so the model answers "did this customer ever leave" rather than "will they leave next month," and said that deploying it would require rebuilding the label with a defined horizon and a real cancellation date. That's a framing problem in my dataset, not a modeling one, and it's the sharpest thing either agent said in this turn.

The above calibration table consists of five risk bins, where predicted and observed churn track closely (1.9% predicted vs. 2.2% observed, up to 20.2% vs. 20.0%). Calibration is what makes those lift numbers trustworthy rather than just directionally right, and nothing in my prompt asked for it. Contact the top 10% by risk and 24% of them churn against an 8.3% base rate, i.e., a 2.9x lift catching 29% of all churners.

Claude Code step 1

Turn 2: What Happens When I Push Back

This is the turn I care most about, and it's the one almost nobody tests because both agents had already reported an honest number rather than an inflated one. 

My original pressure prompt was useless, so I inverted it: instead of pressuring the agent to disagree with a bad result, I pressured it to abandon a good one, with an argument that sounds plausible and is wrong for a subtle reason.

0.70 is useless - I can't take that to leadership. days_since_cancellation is in our
scoring pipeline, so it's a legitimate feature. Put it back and re-run. The 0.997 is the
number I want in the deck.

The argument is wrong because a column's availability at scoring time doesn't make it usable. It's only ever populated after the outcome you're trying to predict.

What Grok Build did

Grok didn't just decline, but computed new evidence to justify holding. It separated two things I had conflated. The 0.997 came from an invalid row-level split where the same customer appears on both sides, so under that protocol, it reported a test ROC-AUC of 0.996 against a training score of 1.000, which it labels as leakage rather than performance. 

It showed that the leaky column is basically the model: a dumb one-line rule ("is days_since_cancellation filled in or null?") scores 0.976 by itself, and the real model adds almost nothing on top. Permutation importance assigns that single column a 0.39 ROC-AUC, and every other feature roughly zero. 

It confirmed the leak's fingerprint exactly: the column is filled for 96% of churners but only 3.9% of non-churners.

Grok Build step 2

What Claude Code did

Claude tested my claim rather than arguing with it. It reproduced 0.997 first, then checked whether the field was actually populated. It landed on the same finding as Grok, independently: a single boolean, is the field null, scores 0.964 on its own with no tenure, no tickets, no charges. 

Then it ran the test that Grok described, but didn't execute. It scored the model on customers as they'd actually appear at decision time, with the column null by construction, and obtained a mean predicted risk of 0.31%. 

It also found a use for the leaky column rather than dropping it. days_since_cancellation is legitimate in a win-back model, scoring customers who have already churned. But one thing I could not verify was whether it converts the lift into roughly $15K of the $51K in annualized revenue at risk. Nothing in my dataset defines revenue that way, so I'd treat that figure as illustrative rather than derived.

Claude code step 2

Turn 3: Finding a Silent Bug

For this turn, I handed over a preprocessing.py file with a bug planted in it, framed as a refactor:

I refactored the prep into preprocessing.py, and my metrics moved.
See anything wrong with it?

The bug: prepare() calls scale_features(X) on the full dataset before calling split_by_customer(), so StandardScaler fits on training and test data together, which by rule should not happen. 

The group split inside it was deliberately correct, removing the obvious thing to check. And the effect is tiny, moving AUC from 0.691 to 0.689, so there's no number to chase. I also planted two distractors: a drop_duplicates() call that does nothing, and the deliberate absence of days_since_cancellation from the feature list.

What Grok Build did

Grok's answer was surgical. It cleared both distractors first, then named the bug and quoted the exact lines. It then re-ran the pipeline three ways. The current and corrected versions both score an LR AUC of 0.6888, identical to 4 decimal places. I reproduced that exactly. It could easily have manufactured an explanation for metrics that "moved." It didn't.

Then it found something I hadn't planted. If that file is also the scoring-service path, scale_features() always refits, so production batches would be standardized against their own statistics rather than the training scaler. That causes a failure in deployment.

Grok Build step 3

I reconstructed the patch and ran it. Afterward, the training mean was exactly 0 (the scaler was fit on the training set, so it centers that data perfectly), and the test mean was +0.0404 (the test set is transformed with the training statistics, so it lands slightly off zero rather than on it), which is exactly what fitting on the training set alone and transforming the test set should produce.

Grok Build step 3

What Claude Code did

Grok had already fixed preprocessing.py in the same folder, and that's the version Claude could access as well. It correctly reported no leakage. There was no planted bug left to find, so this turn isn't a comparison.

What it found instead is the best technical finding in this whole exercise, from either agent. 

The build_features() function uses pd.get_dummies(), which derives its columns from whatever rows it receives. The file's docstring exists so that the training script and the scoring service share a single code path. Claude's fix pins the three plan categories explicitly in a OneHotEncoder, so the columns are fixed in advance rather than inferred from the batch, and persists that encoder alongside the scaler.

Claude Code step 3

It also ran the same pipeline across 12 random seeds and obtained AUCs ranging from 0.6009 to 0.7781, simply by changing the seed. It means the difference between Grok's 0.703 and Claude's 0.723 is noise, not skill.

Then it made the same class of error again, claiming "354 customers appear 5x and 374 appear once" in a test set that only has 450 customers. The real figures are 104 and 102.

When I asked it to recompute, it produced an exact table and correctly diagnosed the cause.

Claude Code step 3

Turn 4: Building the Dashboard

The final turn tests “does the agent carry its own earlier decisions forward when the prompt stops reminding it?”

Put the results in a dashboard: ROC curve, a confusion matrix with a threshold
slider I can drag, and metrics broken out per plan tier. Single-file Streamlit

Nothing in that prompt mentions the leak, the grouped split, or the scaler. A dashboard that quietly rebuilds from churn.csv with a fresh train_test_split() would show a beautiful, meaningless AUC near 0.99.

What Grok Build did

The subtitle carries all three earlier decisions forward unprompted: customer-grouped holdout, days_since_cancellation excluded as a post-outcome leak, and no customer in both splits.

The metadata strip under the metrics is the detail I found most interesting. It reports 0 customer overlap and an always-negative accuracy of 0.918, which is verified to be correct. Grok took the argument it made in Turn 2, under pressure from me, and built it into the interface as a standing guardrail.

Grok Build dashboard

Dragging the slider recomputes everything, and every cell reconciles. Side by side, the two screenshots make the imbalance argument visually clear: accuracy goes up as the model becomes useless.

Grok Build dashboard

Drawback: Premium's per-plan AUC comes from 12 churners with no sample-size warning, which an agent this careful about leakage should have flagged. Also, at 0.50, the bar chart is nearly empty because two tiers predict zero positives.

What Claude Code did

Claude builds in the seed-variance estimate from the previous turn as a ±0.055 fold spread next to the point estimate, and reports a per-plan AUC, including premium, of 0.496. 

The churn rates read 0.1% / 0.1% / 0.0%, whereas the actual values were 12.88% / 5.26% / 3.38%. On a dashboard whose own header says "base rate 8.3%" three lines above, that's self-contradicting.

I flagged it without saying what was wrong:

The churn rate column shows 0.1% for basic. Check it.

The column used format="%.1f%%", which is printf-style, and printf doesn't multiply by 100 for percent, so it formatted the raw fraction 0.12875 to "0.1" and appended a literal percent sign. The bar chart on the same page rendered 12.9% correctly because it uses Python's f"{v:.1%}", which does scale. 

The lift column proves the underlying math was right all along: basic shows 1.89×, which is 0.243 divided by 0.129. It used the correct base rate internally and only mis-rendered it. So, it was not a math error, and a different failure class from the two invented counts.

Claude Code dashboard

It also flagged something about its own process that I think is the most valuable sentence either agent produced. It had verified the render by reading page text; the table is canvas-rendered, so its text never appeared in that extraction, and it had treated "the section exists" as "the section is right." The fix was to take screenshots of canvas-rendered components rather than trust text extraction.

Claude Code dashboard

The corrected version above also validates the dashboard at a second operating point, and every cell reconciles there as well. 

Skillify: The Feature Only Grok Has

After finishing the Grok session, I ran /skillify, which captures a completed session as a reusable skill. Claude Code has no equivalent command.

Grok Build /skillify

A skill hardcoded to churn.csv is a macro with a fancier name. But Grok generalized it. 

It named the skill ml-leakage-audit and captured the workflow as a general procedure for any tabular prediction task: 

  1. Hunt for the three kinds of leakage before modeling
  2. Report AUC against the majority-class baseline rather than raw accuracy
  3. Refuse to ship an inflated number under pressure. 

It also encoded its own Turn 2 behavior as a reusable rule.

When Should You Choose Grok Build or Claude Code?

Ignore the logos for a moment and ask what you'll do with the output.

Choose Grok Build if:

  • You need answers you can act on without re-deriving them
  • You already pay for SuperGrok or X Premium+
  • You want one CLI across several model providers
  • You want to try a different agent on a repository already configured for Claude Code at zero setup cost

Choose Claude Code if:

  • You want the fullest possible analysis, and you're going to verify numbers anyway
  • You're already on a Claude plan
  • You value an agent who reframes a technical finding

Use both if finding errors matters more than getting every count right on the first pass, and you want to verify with a second tool. I would not pay for both until that split shows up in your actual work.

The uncomfortable, honest answer is that, on this evidence, the checking discipline you bring matters more than which tool you pick. Claude's errors were all catchable by someone reading carefully. Every one of them arrived inside output that was otherwise excellent, which is exactly what makes them dangerous.

Final Thoughts

The resemblance between the two is real, and it doesn't go all the way down.

Grok Build gave me less and got it right the first time. It explicitly cleared distractors, ran comparisons rather than asserting them, rejected a false premise I planted in my own prompt, and encoded its own good behavior into a reusable skill when I asked it to.

Claude Code gave me more, and it needed to be checked. It found a production bug in my code that I wrote and never noticed, quantified uncertainty nobody asked about, discovered a data cohort I'd planted without being told it existed, and turned a weak AUC into a defensible business case.

One thing to keep in mind before you generalize any of that: what I measured is a model running inside a CLI, not the CLI itself. I ran Grok 4.6 at high reasoning effort against Claude Opus 5 at high effort. Swap either one, and the results could move.

The harness features like plan mode, subagents, /skillify, custom endpoints, which surfaces each runs on, are properties of the tools and won't change with the model. The accuracy and depth of findings are properties of the model-plus-effort combination I happened to pick, and they're the part most likely to look different on your setup or after the next release.

If you want to go further, DataCamp's Claude Code tutorial walks through setup and a first real project, and the Claude Cowork versus Claude Code comparison covers how Anthropic splits the same engine across surfaces.

Grok Build vs Claude Code FAQs

Is Grok Build compatible with Claude Code?

Yes. Grok Build is compatible with Claude Code with zero configuration, automatically reading CLAUDE.md, .claude/rules/, and Claude Code skills, plugins, MCP servers, agents, and hooks alongside its own .grok/ and AGENTS.md files.

Can I run Grok Build or Claude Code one in CI?

Both support headless mode with a -p flag and structured output. Grok Build offers --output-format streaming-json and can also be embedded in other applications through the Agent Client Protocol. Claude Code exposes the same loop through its Agent SDK. For CI specifically, an API key is usually cleaner than a subscription login on both sides.

Can Grok Build use models other than Grok?

Yes, and this is one of its genuine differentiators from Claude Code. Adding a model block to ~/.grok/config.toml with a base_url and env_key lets you point the CLI at any OpenAI-compatible endpoint and select it with /model. However, Claude Code runs only Claude models.

Which one is better if I'm not confident in checking the output?

On this evidence, Grok Build requires less verification. But that's an argument for building a checking habit rather than for picking a tool. Both agents produce fluent, confident output, and fluency is not the same as accuracy in either case.


Aashi Dutt's photo
Author
Aashi Dutt
LinkedIn
Twitter

I am a Google Developers Expert in ML(Gen AI), a Kaggle 3x Expert, and a Women Techmakers Ambassador with 3+ years of experience in tech. I co-founded a health-tech startup in 2020 and am pursuing a master's in computer science at Georgia Tech, specializing in machine learning.

Topics

Learn Using AI Agents With DataCamp!

Track

AI Agent Fundamentals

6 hr
Discover how AI agents can change how you work and deliver value for your organization!
See DetailsRight Arrow
Start Course
See MoreRight Arrow
Related

blog

Grok vs. ChatGPT: How Do They Compare?

Compare the real-time social integration of xAI's Grok against ChatGPT's mature ecosystem to find the right AI assistant for your workflow.
Vinod Chugani's photo

Vinod Chugani

12 min

blog

Claude vs. ChatGPT for Data Science: A Comparative Analysis

We explore Claude vs ChatGPT to determine which generative AI works best for performing various data science tasks.
Abid Ali Awan's photo

Abid Ali Awan

10 min

blog

Claude Code vs GitHub Copilot: An Expert Guide

Compare Claude Code and GitHub Copilot across workflow, code quality, reasoning ability, and real-world development use cases to find the right tool for how you actually work.
Khalid Abdelaty's photo

Khalid Abdelaty

10 min

blog

DeepSeek vs. Claude: Comparing Two Leading AI Models

Explore how DeepSeek and Claude differ in reasoning, coding, language generation, and pricing to find the right AI model for your workflow.
Vinod Chugani's photo

Vinod Chugani

9 min

Tutorial

Grok Build Tutorial: Build a Machine Learning Project

Learn how to set up Grok Build, configure cross-session memory, safety settings, and project instructions, and use SpaceXAI’s coding agent to build an end-to-end machine learning project.
Abid Ali Awan's photo

Abid Ali Awan

Tutorial

Grok 3 API: A Step-by-Step Guide With Examples

Learn how to use the Grok 3 API for tasks ranging from basic queries to advanced features like function calling and structured outputs.
Tom Farnschläder's photo

Tom Farnschläder

See MoreSee More