Yuval Avidani
Author
"xAI took the code agent running in their own terminal, Grok Build, and just released it as open source under the Apache 2.0 license - including the full agent engine." That happened this week, and it's a much bigger deal than it sounds. Because it turns out that once a tool like this opens up, we can pry it open, measure it, and tune it exactly where every other tool hides the ball: how many tokens the tool burns before we've even typed a single letter.
That's exactly what we did. We took Grok Build, forked it (created our own independent copy), and built Logan from it - our own code agent, named after Wolverine (heals, adapts, and pops claws on nasty bugs). We added memory management, automations, smart model routing, and full token transparency - the ability to see every token burned, in real time. In this post I'll break down the whole story, and compare six terminal code agents head to head: Grok Build, Claude Code, GitHub Copilot CLI, OpenCode, Hermes, and our own Logan.
What xAI actually released (and why "SpaceX" pops up here)
Let's clear up a small confusion right away. The repo sits under the xai-org organization on GitHub, and the README explains that the code is "synced occasionally from SpaceXAI's monorepo." Meaning this is xAI, Elon Musk's company, and the internal name they gave their giant code repository is SpaceXAI. So if you saw "SpaceX," that's where it comes from. It's not the rocket company that shipped a code tool - it's the AI arm.
What's actually in there? Grok Build is a code agent that runs in the terminal as a TUI (Text User Interface, a full-screen text interface - think of a graphical app, but drawn with letters inside the terminal). It understands the codebase, edits files, runs shell commands, searches the web, and manages long-running tasks. It's all written in Rust (99.6% of the code), with 2.2K stars and 306 forks as of today.
There's one nuance that's easy to miss: the code is open for reading and forking under Apache 2.0, but the README explicitly says "External contributions are not accepted." Meaning this is open source for reading, not open source for the community - we can learn from it and fork it, but not send improvements back upstream. And that's exactly what makes a fork like Logan legitimate and useful: we take the excellent base, and add on top of it what's missing for us.
The hidden tax: what every tool sends before we typed a word
Now for the part we love most in the newsroom - the data. Every code agent has a fixed "entry tax": even before we type our request, the tool sends the model a system prompt (background instructions that define who the agent is and what it's allowed to do), followed by a list of schemas (formal descriptions) of every tool it has at its disposal. Think of it like a waiter who, before even asking what you'd like, reads you the entire menu, the restaurant rules, and the safety instructions - every single time. All of that text costs tokens, and we're both paying for it and filling up the context window (the maximum amount of text the model can hold in its head at once) with it.
And here the differences are huge. Researchers at Systima wired up a "proxy" (a middleman that intercepts traffic) between the tool and the model, and measured the exact numbers. Claude Code sends about 32,800 tokens before we've typed a single letter: about 6,500 for the system prompt itself, about 24,000 for schemas of 27 tools, and another roughly 2,000 for the first message template. OpenCode, by contrast, sends only about 6,900 tokens - 4.7x less - because it carries just 10 tools. This isn't sloppiness on Claude Code's part, it's a choice: more tools buy more capability, and the price is more fixed tokens (a different approach, not a worse one).
And where do we fit into this picture? Grok Build, and Logan built on top of it, are built on that same lean architecture of about 10 tools - exactly like OpenCode. We measured Logan's base system prompt text ourselves, and it comes out to just 1,034 tokens. Here's the comparison:
Six tools, six philosophies
Now let's meet all the players, because each one has its own approach. Grok Build and Logan belong to the "lean and open" camp: fast Rust, few tools, and forkable/tunable. OpenCode by SST (today Anomaly) is the community's truly open child, with about 160K stars, 75+ model providers, and an open license that invites contributions. Hermes by Nous Research goes for a completely different angle, under the MIT license, with an emphasis on an agent that learns us over time: it builds its own skills from experience, improves them on the fly, remembers who we are across sessions, and also runs on Telegram, Discord, and Slack. Claude Code by Anthropic and Copilot CLI by GitHub are the proprietary (closed) camp: both are insanely rich and polished - Claude Code with a context window up to a million tokens and a massive MCP ecosystem, and Copilot CLI (which reached GA in February 2026) with Plan mode, Autopilot mode, and /fleet which orchestrates sub-agents in the background - but both require a subscription and keep the code closed.
What we added in Logan
Beyond the Wolverine vibe (a fan tribute, no official Marvel connection), Grok Build is deliberately a lean base: it doesn't ship with productized long-term memory management, no automatic model routing, and no ready-made provider presets. We added all of that in Logan:
- Memory management: Logan keeps a MEMORY.md file with a hybrid index, and runs hooks (code that fires automatically on certain events) at the end of every turn and every session, writing "reflections" on its own - what worked and what failed. Two skills, self-improve and learn-user, distill this into lessons learned and a personal preferences profile. Think of it like a journal the agent keeps on itself and on us, so we don't keep repeating the same mistakes.
- Automations and goals: a /loop command for repeated runs, integration with cron, launchd (Mac) and Task Scheduler (Windows), and a /goal command that gives the agent a whole objective ("migrate auth to OAuth") - and it plans and executes it on its own.
- Smart model routing: the --route auto flag classifies every task and routes it to the right tier - a trivial task goes to cheap haiku/flash/ollama, a complicated architecture task goes to opus/a strong model. This way we're not burning an expensive model on "run the tests."
- Dual-stack and providers: 8+ ready-to-use providers (Anthropic, OpenAI, Gemini, OpenRouter, Ollama, LM Studio, LiteLLM, Bedrock), and you can even code with Claude and search the web with Grok in parallel, each one doing what it's best at.
- One-command install:
bash scripts/install-logan.shsets up PATH, a managed binary, config, and skills sync, so we can start working within minutes.
And this is exactly the place to be fair: Logan is a young fork. A large part of the infrastructure still carries internal xai-grok-* names, Bedrock works through a proxy (LiteLLM) rather than natively, and smart automatic result-scoring is still ahead of us. We're building on an excellent base, but it's a base - not a finished product.
The feature I'm proudest of: seeing every single token
If there's one thing I built into Logan out of pure conviction, it's that you shouldn't fly blind. Most tools hide the token bill from us until the invoice arrives. In Logan we turned this into three layers, in the order you should actually use them:
- Layer 1, the live status bar: with no command at all, after every response, you see how much of the window is full and what the last call cost. Watch for the
!character that warns you before compaction (shrinking the history once the window fills up). - Layer 2, /stats: the session's colorful accounting ledger - input, output, cache, thinking tokens, and estimated cost, broken down by model.
- Layer 3, /context deep: and this is the part we love most. This command shows the actual text of the system prompt sitting in our window, word for word. Meaning, the hidden tax we've been talking about this entire post - we can just read it with our own eyes.
Here's what that looks like in practice:
And compaction is honest too: when the window fills up, Logan explicitly says Compacted 90K -> 24K (saved 66K) instead of quietly shrinking things behind your back.
How we measured this - because we don't guess
Our rule is sacred: measure, don't guess. And that's exactly what's written in Logan's own docs: "built so you never have to guess where the tokens went." So we didn't make up the 1,034 token figure. We ran Logan's base text through the same tokenizer (token counter, o200k) that the models actually count with, and counted. Here it is exactly:
And if you were wondering why you'd even need a "layered" system prompt, here's how Logan assembles it, layer by layer, with each layer budgeting itself so it doesn't blow up the window:
In my view
In my view, the real story here isn't Logan, and it isn't who sends the fewest tokens. The story is that xAI took a genuine production tool, one running in their own house, and opened it up just enough for us to measure and tune it. Most tools hide the tax we pay on every turn; an open fork lets us see it, and then lower it. That doesn't mean Logan is "better" than Claude Code - Claude Code is rich, stable, and insanely polished, and its 27 tools buy real capability that we don't dismiss. It's simply a different approach: pay less of a fixed tax, and see every token with your own eyes.
What intrigues me now: if every code agent showed us, in full transparency, how many tokens it burns before we've even typed a word, how many of us would choose differently?
