<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Commoditech</title>
    <description>The latest articles on DEV Community by Commoditech (@commoditech).</description>
    <link>https://dev.to/commoditech</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4208487%2F68acafc5-9142-475a-a7ef-d37d2c3da280.png</url>
      <title>DEV Community: Commoditech</title>
      <link>https://dev.to/commoditech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/commoditech"/>
    <language>en</language>
    <item>
      <title>Grok CLI and terminal agents: 90,000 tokens before the test says 'wrong'</title>
      <dc:creator>Commoditech</dc:creator>
      <pubDate>Mon, 26 Oct 2026 10:58:26 +0000</pubDate>
      <link>https://dev.to/commoditech/grok-cli-and-terminal-agents-90000-tokens-before-the-test-says-wrong-2elp</link>
      <guid>https://dev.to/commoditech/grok-cli-and-terminal-agents-90000-tokens-before-the-test-says-wrong-2elp</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://commoditech.pl/en/grok-cli-terminal-ai-agents-software-engineering" rel="noopener noreferrer"&gt;commoditech.pl&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Give a terminal agent a repository and the instruction "fix this test", and the loop does not end after one model call. Every step appends a search result, a file window and some stdout to the context.&lt;/p&gt;

&lt;p&gt;Take a 2,000-token prefix (instruction, &lt;code&gt;AGENTS.md&lt;/code&gt;, the task), 1,000 tokens of new observation per step, and no prefix cache. Twelve steps send &lt;strong&gt;90,000 input tokens&lt;/strong&gt;. One call with the same prefix and one observation sends 3,000. That is a ratio of 30. The last three steps cost 36,000 tokens, 40% of the bill; the first three cost 9,000, or 10%.&lt;/p&gt;

&lt;p&gt;You can redo that sum on paper. It is not an invoice from a named rollout. But it is what the invoice looks like when nobody set a step cap and the loop stops when the model says "done" instead of when a test goes green.&lt;/p&gt;

&lt;p&gt;The second risk matters more than the tokens. An agent that reads an issue, a README or a tool result also acts on whatever a third party wrote there, and it has a shell underneath. AgentDojo (Debenedetti et al., &lt;a href="https://arxiv.org/abs/2406.13352" rel="noopener noreferrer"&gt;arXiv:2406.13352&lt;/a&gt;) has 97 tasks and 629 security test cases. Models fail some tasks even when nothing is attacking them, and a prompt injection hidden in tool output breaks some security properties and leaves others intact.&lt;/p&gt;

&lt;p&gt;So a leaderboard score combines three things: the model, the scaffold, and how clean the test set is. The API bill is the sum of a growing context. What you can control is a stop condition tied to a test, plus a list of tools the agent may call. The name of the binary on your &lt;code&gt;$PATH&lt;/code&gt; is none of these.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Anatomy: host, loop, MCP
&lt;/h2&gt;

&lt;p&gt;A terminal agent is a loop, not a chat. The host keeps the history, calls the model, runs an action and appends the observation. Grok CLI is one such host. xAI documents it as &lt;strong&gt;Grok Build&lt;/strong&gt;, and the command is &lt;code&gt;grok&lt;/code&gt; (&lt;a href="https://docs.x.ai/build/overview" rel="noopener noreferrer"&gt;docs&lt;/a&gt;, &lt;a href="https://x.ai/build" rel="noopener noreferrer"&gt;product page&lt;/a&gt;). The docs describe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an interactive TUI and a headless mode (&lt;code&gt;grok -p "..."&lt;/code&gt;);&lt;/li&gt;
&lt;li&gt;a plan before edits, and subagents;&lt;/li&gt;
&lt;li&gt;a session per git worktree (&lt;code&gt;grok -w&lt;/code&gt;);&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;AGENTS.md&lt;/code&gt;, skills, hooks, plugins and MCP servers;&lt;/li&gt;
&lt;li&gt;model selection with &lt;code&gt;-m&lt;/code&gt; and &lt;code&gt;grok models&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;grok inspect&lt;/code&gt; (or &lt;code&gt;grok inspect --json&lt;/code&gt;), which shows the rules, skills, plugins, hooks and MCP servers discovered in the current directory;&lt;/li&gt;
&lt;li&gt;authentication by browser login, &lt;code&gt;grok login --device-auth&lt;/code&gt; on remote machines, or the &lt;code&gt;XAI_API_KEY&lt;/code&gt; environment variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The official install is a &lt;code&gt;curl … | bash&lt;/code&gt; one-liner; there is also an npm package, &lt;code&gt;@xai-official/grok&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The flags that matter most for the rest of this article are the control flags in the &lt;a href="https://docs.x.ai/build/cli/reference" rel="noopener noreferrer"&gt;CLI reference&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# cap the loop, pick a sandbox profile, restrict tools, set permission rules&lt;/span&gt;
grok &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"make tests/test_parser.py::test_dates pass"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--max-turns&lt;/span&gt; 8 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--sandbox&lt;/span&gt; &amp;lt;profile&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--tools&lt;/span&gt; &amp;lt;allowed-tools&amp;gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--deny&lt;/span&gt; &amp;lt;rule&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--max-turns&lt;/code&gt; is the step cap from the arithmetic above, built in. &lt;code&gt;--sandbox&lt;/code&gt;, &lt;code&gt;--tools&lt;/code&gt; / &lt;code&gt;--disallowed-tools&lt;/code&gt; and &lt;code&gt;--allow&lt;/code&gt; / &lt;code&gt;--deny&lt;/code&gt; are where "which tool may write" gets decided. The flag to avoid on any machine that can reach production is &lt;code&gt;--always-approve&lt;/code&gt;, alias &lt;code&gt;--yolo&lt;/code&gt;. (Placeholders above are deliberate; see the Sandbox and Permissions pages for the actual profile and rule syntax.)&lt;/p&gt;

&lt;p&gt;None of this is a resolve rate. As of October 2026, xAI's public docs do not attach a SWE-bench score to the &lt;code&gt;grok&lt;/code&gt; binary. If someone measures one, it belongs to a specific model, step cap and harness.&lt;/p&gt;

&lt;h3&gt;
  
  
  Model Context Protocol
&lt;/h3&gt;

&lt;p&gt;MCP separates the host from its tools. The &lt;a href="https://modelcontextprotocol.io/specification/2025-11-25" rel="noopener noreferrer"&gt;specification&lt;/a&gt; (revision 2025-11-25) is built on JSON-RPC 2.0. The host (Grok CLI or another client) holds the client side. A server exposes &lt;strong&gt;tools&lt;/strong&gt; (functions the model may call), &lt;strong&gt;resources&lt;/strong&gt; (data to read) and &lt;strong&gt;prompts&lt;/strong&gt; (templates). The lifecycle is: &lt;code&gt;initialize&lt;/code&gt; negotiates capabilities, &lt;code&gt;tools/list&lt;/code&gt; returns schemas, and &lt;code&gt;tools/call&lt;/code&gt; runs one tool. On the client side, the spec also defines &lt;strong&gt;sampling&lt;/strong&gt; (the server asks the host to call a model) and &lt;strong&gt;roots&lt;/strong&gt; (the directories the server may see).&lt;/p&gt;

&lt;p&gt;The local transport is stdio: a process on the same machine with no port. The remote transport, introduced in revision 2025-03-26 and kept in 2025-11-25, is Streamable HTTP; the older HTTP+SSE setup is no longer the main remote option. One MCP server can serve several hosts, but that does not settle which tool is allowed to write. In Grok CLI, servers are managed with &lt;code&gt;grok mcp list|add|remove|doctor&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"jsonrpc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"method"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tools/call"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"params"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"get_issue"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"arguments"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PAY-1842"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The message shape comes from the MCP tools spec. &lt;code&gt;get_issue&lt;/code&gt; is a made-up read-only tool, not a built-in Grok CLI tool.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;AGENTS_md&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;LIMIT&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nf"&gt;target_test_green&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;model&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mcp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tools_call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;shell&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sandbox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# network, .env and git push live here
&lt;/span&gt;    &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;truncate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The interface matters even when the model stays the same. SWE-agent (Yang et al., &lt;a href="https://arxiv.org/abs/2405.15793" rel="noopener noreferrer"&gt;arXiv:2405.15793&lt;/a&gt;, NeurIPS 2024) ran GPT-4 Turbo on SWE-bench Lite:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An agent limited to a plain shell resolved &lt;strong&gt;11.00%&lt;/strong&gt; of tasks; SWE-agent resolved &lt;strong&gt;18.00%&lt;/strong&gt; (54 of 300).&lt;/li&gt;
&lt;li&gt;In the file-viewer ablation, a 100-line window scored 18.0% and pasting the whole file scored 12.7%.&lt;/li&gt;
&lt;li&gt;In the editor ablation, shell-only editing fell to 10.3%, against 18.0% for edits that run a syntax lint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running &lt;code&gt;cat&lt;/code&gt; on a whole file floods the context with text the model never uses in the patch.&lt;/p&gt;

&lt;p&gt;On the full SWE-bench, the same setup resolved 12.47% (286 of 2,294) at an average of $1.59 per instance at the paper's prices. The 87.7% in the paper's abstract is HumanEvalFix, a set of short function repairs, not the 2,294 GitHub issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Numbers you can recompute, and numbers you shouldn't carry over
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SWE-bench&lt;/strong&gt; (Jimenez et al., &lt;a href="https://arxiv.org/abs/2310.06770" rel="noopener noreferrer"&gt;arXiv:2310.06770&lt;/a&gt;, ICLR 2024) has 2,294 problems from 12 Python repositories. The best model in that paper, Claude 2, resolved 1.96% with no tool loop. Putting 1.96% next to 12.47% mixes up the model, the year and the scaffold. The ablation that holds the model fixed and changes only the interface is 11.00% against 18.00% on Lite: seven points on 300 tasks. That is enough to stop treating raw bash as a neutral API for a model. It is not enough to write "the agent resolves issues" into a proposal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SWE-bench Verified&lt;/strong&gt; (&lt;a href="https://openai.com/index/introducing-swe-bench-verified/" rel="noopener noreferrer"&gt;OpenAI, 13 Aug 2024&lt;/a&gt;): annotators reviewed 1,699 tasks and 500 were kept. 196 of them are "easy" (under 15 minutes) and 45 are "hard" (over an hour). GPT-4o resolved 33.2%. In the annotation, 38.3% of samples had an underspecified problem statement, 61.1% had tests that could fail a valid solution, and 68.3% were filtered out overall.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verified retired&lt;/strong&gt; (&lt;a href="https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/" rel="noopener noreferrer"&gt;OpenAI, 23 Feb 2026&lt;/a&gt;): the frontier moved from 74.9% to 80.9% in six months. OpenAI audited 27.6% of the set, focusing on tasks that models often fail. In at least 59.4% of the audited problems they found material issues in the test design and/or the problem description; tests that reject a correct patch are the biggest group, but not the only one. Contamination is a separate problem. OpenAI stopped reporting Verified and pointed to SWE-bench Pro.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro questioned too&lt;/strong&gt; (&lt;a href="https://openai.com/index/separating-signal-from-noise-coding-evaluations/" rel="noopener noreferrer"&gt;OpenAI, 8 Jul 2026&lt;/a&gt;): on the public split of SWE-bench Pro (731 tasks), the frontier pass rate rose from 23.3% to 80.3% in eight months. An automated pass flagged 200 tasks (27.4%) as broken, and a human campaign flagged 249 (34.1%). In the same post, OpenAI estimates that roughly 30% of Pro is broken and walks back its earlier advice to switch to Pro. Read the jump and the broken-task rate together.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vendor tables.&lt;/strong&gt; In the &lt;a href="https://openai.com/index/introducing-gpt-5-2/" rel="noopener noreferrer"&gt;GPT-5.2 announcement&lt;/a&gt;, GPT-5.2 Thinking scores 80.0% on Verified and 55.6% on Pro public. That 24.4-point gap between two sets for the same model is larger than the whole 2024 shell-versus-ACI ablation. The &lt;a href="https://openai.com/index/introducing-gpt-5-4/" rel="noopener noreferrer"&gt;GPT-5.4 announcement&lt;/a&gt; reports 57.7% on Pro public and 75.1% on Terminal-Bench 2.0. That is three percentages and three definitions of "can program". These are vendor figures, not independent measurements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Developer productivity.&lt;/strong&gt; METR's randomized trial (Becker et al., &lt;a href="https://arxiv.org/abs/2507.09089" rel="noopener noreferrer"&gt;arXiv:2507.09089&lt;/a&gt;) followed 16 experienced open-source developers on 246 tasks from February to June 2025:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With AI tools allowed, tasks took &lt;strong&gt;19% longer&lt;/strong&gt; (CI +2% to +39%).&lt;/li&gt;
&lt;li&gt;Before the study, the same developers forecast a 24% speedup. Afterwards they still believed they had been 20% faster.&lt;/li&gt;
&lt;li&gt;Economists had forecast a 39% speedup and ML researchers 38%.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a &lt;a href="https://metr.org/blog/2026-02-24-uplift-update/" rel="noopener noreferrer"&gt;February 2026 update&lt;/a&gt;, METR says a follow-up with newer tools gave no reliable signal either way. The +19% describes early 2025, not Q4 2026.&lt;/p&gt;

&lt;p&gt;The takeaway is that the interface moves the score even with fixed weights. A team's perception can have the opposite sign from the stopwatch. And a Verified or Pro percentage with no scaffold and no test audit attached does not predict your sprint.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Case: 90,000 tokens before the test says "wrong"
&lt;/h2&gt;

&lt;p&gt;The assumptions are explicit so you can swap in your own token counter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prefix P = 2,000 tokens. Each step appends D = 1,000 tokens. With no prefix cache, the input at step k is P + (k−1)·D.&lt;/li&gt;
&lt;li&gt;N = 12: 12·2,000 + 1,000·(12·11/2) = 24,000 + 66,000 = &lt;strong&gt;90,000&lt;/strong&gt; input tokens. A single call costs 3,000, so the ratio is 30.&lt;/li&gt;
&lt;li&gt;Steps 1–3 cost 9,000 tokens (10%); steps 10–12 cost 36,000 (40%).&lt;/li&gt;
&lt;li&gt;With a cap of N = 8 (&lt;code&gt;--max-turns 8&lt;/code&gt;): 16,000 + 28,000 = &lt;strong&gt;44,000&lt;/strong&gt;, which is 51% less. That comes from a shorter loop, not from a measured dashboard p99.&lt;/li&gt;
&lt;li&gt;A vendor prefix cache discounts the shared beginning of the context. It does not remove a bad step, and it does not turn the stop condition into a test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A cut that still keeps a check in place looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a step cap, and a stop only when the target test passes;&lt;/li&gt;
&lt;li&gt;file views of about 100 lines;&lt;/li&gt;
&lt;li&gt;MCP limited to reading the issue and the CI status;&lt;/li&gt;
&lt;li&gt;a shell with no network and no secret files;&lt;/li&gt;
&lt;li&gt;one git worktree per agent;&lt;/li&gt;
&lt;li&gt;a human doing the merge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the test still fails at step 8, the loop stops. You don't get a patch, but you do get a bounded bill and a diff to review.&lt;/p&gt;

&lt;p&gt;METR's result explains why teams still say "it feels faster". The gate therefore isn't a survey after the session. It is a test you knew before the agent started, plus a token counter on the session.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Decision table
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Complexity&lt;/th&gt;
&lt;th&gt;Latency&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;th&gt;When to use it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;In-editor suggestion, a human accepts the diff&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;No agent-loop tail&lt;/td&gt;
&lt;td&gt;About one call&lt;/td&gt;
&lt;td&gt;Local edits whose diff a person can read in full&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Terminal agent with a file window, step cap and test-as-stop&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Sum of steps until green or cap&lt;/td&gt;
&lt;td&gt;P=2,000, D=1,000: 90k tokens at N=12, 44k at N=8&lt;/td&gt;
&lt;td&gt;The issue has a test, the repo is familiar, a human merges&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The same agent plus read-only MCP&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Plus tool round trips&lt;/td&gt;
&lt;td&gt;Every tool result lands in D; wide JSON breaks the 1k assumption&lt;/td&gt;
&lt;td&gt;Repeatable reads: issue text, logs, CI status. No writes. Audit with &lt;code&gt;grok inspect&lt;/code&gt;, &lt;code&gt;grok mcp doctor&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Networked shell, no cap, an MCP server that writes, &lt;code&gt;--yolo&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Low at first, high in an incident&lt;/td&gt;
&lt;td&gt;Unbounded tail&lt;/td&gt;
&lt;td&gt;Retrying the last step resends the largest context (13k at N=12), plus side effects&lt;/td&gt;
&lt;td&gt;Not in a repo that holds secrets, and not near production&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Two agents, one working directory&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Wall time may fall, git conflicts rise&lt;/td&gt;
&lt;td&gt;Two bills, one of which gets thrown away&lt;/td&gt;
&lt;td&gt;Don't. Use a separate worktree per session (&lt;code&gt;grok -w&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  5. Anti-patterns the host tutorial doesn't mention
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A leaderboard percentage written into a contract.&lt;/strong&gt; Verified was retired in February 2026, and by July 2026 roughly a third of public Pro was flagged as broken. A contract should be judged on your tickets and your tests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A shell-only agent running &lt;code&gt;cat&lt;/code&gt; on whole files.&lt;/strong&gt; In the SWE-agent paper that scored 11.00% and 12.7%, against 18.0% with a 100-line window. Keep observations short, or D stops being 1,000.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stopping when the model says "done".&lt;/strong&gt; At N=12, steps 10–12 carry 40% of the input tokens. A loop with no test spends its most expensive third on retries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A writing MCP tool and a networked shell under one grant&lt;/strong&gt;, plus an MCP server committed to the repo without review. &lt;code&gt;grok inspect&lt;/code&gt; exists so you can see what a directory loads. READMEs and issue bodies are an injection channel. And running a &lt;code&gt;curl | bash&lt;/code&gt; installer on a laptop that can reach production is a policy decision, not an onboarding step, even when it is the official install.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does 80% on SWE-bench Verified mean the agent closes 80% of a senior engineer's tickets?&lt;/strong&gt;&lt;br&gt;
No. The score depends on the model, the scaffold and how clean the benchmark is, and both Verified and Pro have been publicly questioned by the vendor that promoted them. Your sprint is measured by your own tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should an MCP server run over stdio or remotely on the company network?&lt;/strong&gt;&lt;br&gt;
Stdio runs a process next to the host and opens no port, so it suits a tool that may only read that directory anyway. Streamable HTTP gives the server an address, which means it also needs authentication and a separate list of tools that may write. Reads of issues and CI can go remote; a networked shell and production writes don't inherit that grant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can a terminal agent work in a repository under NDA?&lt;/strong&gt;&lt;br&gt;
Yes, if the API key, the transcript and the shell stay inside your boundary. Exporting a session (&lt;code&gt;grok export&lt;/code&gt;) copies the diffs and anything the loop pulled into context, which can include a secret from &lt;code&gt;.env&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Jimenez et al. (2024). &lt;em&gt;SWE-bench&lt;/em&gt;. ICLR 2024. &lt;a href="https://arxiv.org/abs/2310.06770" rel="noopener noreferrer"&gt;arXiv:2310.06770&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Yang et al. (2024). &lt;em&gt;SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering&lt;/em&gt;. NeurIPS 2024. &lt;a href="https://arxiv.org/abs/2405.15793" rel="noopener noreferrer"&gt;arXiv:2405.15793&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI (13 Aug 2024). &lt;a href="https://openai.com/index/introducing-swe-bench-verified/" rel="noopener noreferrer"&gt;Introducing SWE-bench Verified&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI (23 Feb 2026). &lt;a href="https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/" rel="noopener noreferrer"&gt;Why we no longer evaluate SWE-bench Verified&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI (8 Jul 2026). &lt;a href="https://openai.com/index/separating-signal-from-noise-coding-evaluations/" rel="noopener noreferrer"&gt;Separating signal from noise in coding evaluations&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI. &lt;a href="https://openai.com/index/introducing-gpt-5-2/" rel="noopener noreferrer"&gt;GPT-5.2&lt;/a&gt; and &lt;a href="https://openai.com/index/introducing-gpt-5-4/" rel="noopener noreferrer"&gt;GPT-5.4&lt;/a&gt; announcements (vendor figures)&lt;/li&gt;
&lt;li&gt;Becker et al. (2025). &lt;em&gt;Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity&lt;/em&gt;. &lt;a href="https://arxiv.org/abs/2507.09089" rel="noopener noreferrer"&gt;arXiv:2507.09089&lt;/a&gt;; &lt;a href="https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/" rel="noopener noreferrer"&gt;METR, 10 Jul 2025&lt;/a&gt;; &lt;a href="https://metr.org/blog/2026-02-24-uplift-update/" rel="noopener noreferrer"&gt;METR update, 24 Feb 2026&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Debenedetti et al. (2024). &lt;em&gt;AgentDojo&lt;/em&gt;. &lt;a href="https://arxiv.org/abs/2406.13352" rel="noopener noreferrer"&gt;arXiv:2406.13352&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://modelcontextprotocol.io/specification/2025-11-25" rel="noopener noreferrer"&gt;Model Context Protocol, revision 2025-11-25&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;xAI. &lt;a href="https://docs.x.ai/build/overview" rel="noopener noreferrer"&gt;Grok Build docs&lt;/a&gt;, &lt;a href="https://docs.x.ai/build/cli/reference" rel="noopener noreferrer"&gt;CLI reference&lt;/a&gt;, &lt;a href="https://x.ai/build" rel="noopener noreferrer"&gt;product page&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Konrad Wojtasik is the CEO of &lt;a href="https://commoditech.pl/en" rel="noopener noreferrer"&gt;Commoditech&lt;/a&gt;, a Warsaw IT staff-augmentation company that places software, data and AI engineers into client teams. Related: &lt;a href="https://commoditech.pl/en/llm-orchestration-inference-cost" rel="noopener noreferrer"&gt;LLM orchestration and inference cost&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cli</category>
      <category>mcp</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
