How to analyze a massive file that doesn't fit Claude's context
Wann einsetzen: Claude can't fit the file, but Gemini can.
Voraussetzungen
- Gemini CLI + Google API key — npm i -g @google/gemini-cli; then gemini config set with your key from aistudio.google.com
- Install MCP — claude mcp add gemini-cli -- npx -y gemini-mcp-tool
Ablauf
-
Offload analysisask-gemini: @/var/log/app-2026-04.log — find all 5xx errors clustered around deploys in the last 72h, produce a table.✓ Kopiert→ Gemini analyzes, returns compact summary
-
Drill in with ClaudeBased on Gemini's summary, focus on the cluster around 2026-04-12 14:30 UTC and propose a root cause.✓ Kopiert→ Claude reasons over the summary
Ergebnis: Result that neither model alone could produce in one shot.
Fallstricke
- Sending sensitive logs to Gemini — Strip PII before invoking ask-gemini or use a self-hosted model instead
- Token cost on Gemini Pro for huge inputs — Use Gemini Flash for cost; Pro only when accuracy matters