C.W.K.
Stream
Lesson 09 of 10 · published

1M-Token Context Window

~14 min · gemini, context-window, long-context, performance

Level 0🌱 Novice
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

The context advantage Gemini brings

Gemini 2.5 Pro and 3.0 Pro ship with a 1M-token context window — significantly larger than Claude Sonnet's 200K (or 1M for the 1M-context variant) and Codex's 256K. That changes what's tractable: an entire mid-size codebase fits, a 500-page PDF fits, weeks of conversation history fits without compaction.

The trade-off is latency and cost — bigger context means more compute per token. For long-context wins to actually pay off, the task must benefit from breadth: cross-cutting refactors, document synthesis, large-corpus search-and-summarize. For tight tasks, the 1M window is overkill.

Code

When 1M context is the right tool·text
Yes — 1M context shines:
- Audit a 200K-line codebase in one pass
- Synthesize a 1000-page legal corpus
- Multi-week conversation that hasn't been /compact-ed
- Cross-file refactors that need to see *all* affected sites
- Analyze a folder of 50 PDFs in one query

No — 1M context is overkill:
- "Fix this bug in src/auth.ts"
- "Generate a commit message"
- Single-file review
- Anything that fits in 50K tokens
Pin the long-context model + measure·bash
# Switch to the 1M-context model
gemini --model gemini-2.5-pro

# Or pin in settings
# ~/.gemini/settings.json
{ "model": { "default": "gemini-2.5-pro" } }

# Track usage
gemini /stats
# Tokens in:  847,212
# Tokens out:   8,401
# Cache hit:   612,000  (the cache pays off on long context)

External links

Exercise

Run the same task in two ways: (a) Gemini with default smaller context against a few targeted files; (b) Gemini with 1M-context model loading the whole repo. Compare quality, latency, and cost. Note which task shapes actually deserve the 1M window.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.