← all posts
// architecture · gemini

What a million tokens actually buys you in a terminal

Every conversation about Gemini CLI reaches the same number within a minute: a one-million-token context window. It is the headline spec, the thing no other mainstream terminal agent matches, and the least understood feature in the tool. Most people treat it as a bigger junk drawer: stuff more files in, hope the answers improve. That is the wrong mental model, and it quietly produces worse answers at higher cost.

A million tokens is roughly a long novel, or the full source of a mid-sized service with room to spare. The interesting question is which jobs are impossible in a smaller window and become routine in this one. After months of reaching for it on real work, I count three.

Whole-module audits

Retrieval-based agents read your codebase the way a tourist reads a city: a street here, a landmark there. For localized edits that is fine. For coherence questions it fails structurally, because the answer lives in the whole, not in any chunk. Does this module have one error-handling convention or four? Which exports does nothing import? Where has the implementation drifted from its own comments? No embedding search returns the inconsistency between file twelve and file forty, because no single chunk contains it.

Gemini CLI makes the alternative one keystroke: @src/billing/ pulls the entire directory into the window verbatim. Then I ask audit questions. List every retry policy in this module and where each is used. Find the public functions no other file references. Show me where the validation logic disagrees with the schema it claims to enforce. The answers cite real lines, because the model has actually read every file rather than a summary of a search over them.

Log forensics without knowing the grep

The second workflow is grubbier, and I use it more. A production incident, a few hundred thousand lines of logs, and no idea yet what to grep for. Classic retrieval is circular here: you need to know the anomaly before you can write the query that finds it.

Long context inverts that. gemini -p "find where the behavior changes and trace back to the first anomaly" < incident.log is a real command, and the model is genuinely good at the slow-drift signals no pattern match surfaces: the latency that crept upward for an hour before the first error, the worker that went silent while everything around it stayed noisy. The window is the feature here: those patterns only exist across the whole file, and chunking destroys them.

A million-token window earns its keep only when the answer lives in the whole, not in any chunk.

Spec, code, and tickets in one sitting

The third workflow is the one I would pay for outright: cross-artifact reconciliation. Load the vendor spec as a PDF (the CLI ingests documents and images directly, which I cover in the multimodal piece) plus the module that implements it, plus a text export of the open tickets. Then ask for the gaps. Which requirements have no implementation. Which code answers no requirement. Which tickets describe behavior that has already been fixed. That is a staff engineer's lost afternoon compressed into a few minutes, and it flatly does not fit in a smaller window.

What the pitch leaves out

Now the honest part. Three things about the million-token pitch deserve pushback before you rewire your workflow around it.

  • Attention degrades before the window ends. Recall across long context is not uniform: models stay sharp near the start and end of the window and get fuzzy in the middle, and needle-in-a-haystack benchmarks overstate real comprehension. The long version of that argument is in context windows are a lie. Past roughly the halfway mark I stop trusting unsupported claims and make the model quote its evidence.
  • Cost scales with what you stuff in. On an API key you pay for every token on every turn, and a chat re-sends the loaded context with each message. A lazy @./ on the repo root turns a cheap question into a few-dollar one, and a long session multiplies it. On the free tier the bill arrives as burned daily quota instead, kinder but not free.
  • Latency scales too. Prefill on a near-full window takes long enough to break conversational flow. Batch audits tolerate that; interactive debugging does not.

So my rule: long context is a tool, not a default. For repeated questions over a stable corpus, retrieval still wins on cost and latency, and a small context assembled deliberately still beats a large one assembled lazily. But when the question is genuinely holistic (an audit, an incident, a reconciliation), the window is the entire feature, and nothing else in the terminal comes close. Reach for the million tokens when the answer lives in the whole. The rest of the time, choosing what the model sees is still the job.

#gemini#context#architecture