Skip to content

Back to the record

Jul 25, 2025Unverified

Gemini CLI's autonomous tool loop silently consumed 47 million tokens on a five-file refactor

AI loose in the worldAvailabilityDERIVED

Approved by person, Oct 11, 2026. How entries are approved

Showing full summaries.

A developer using Gemini CLI with a paid Vertex AI API key asked it to refactor a few test files. The CLI's default autonomous agent mode ran a reason-act-observe loop, calling ReadFile and Shell tools to gather context and re-sending the entire growing history on every request. The session logged 251 requests consuming 47,185,013 input tokens on gemini-2.5-pro - which the reporter priced at roughly $940 at a conservative $20 per million tokens. When the account hit its tokens-per-minute limit, the CLI displayed a misleading error about the AI Studio free daily quota, masking the real problem. A follow-up session consumed another 721,943 input tokens in under 14 minutes of wall time.

What this means for youIf you use an AI coding tool on a paid API key, a single task can silently run up a large bill. At work, teams should set spending caps and usage alerts before letting agents run unattended.

Sources

Incident records from the AI Agent Incident Database by sipi.bot (https://sipi.bot/incidents/), licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).

Source data license: CC BY 4.0. Attribution to sipi.bot is required.

Covered by snapshot 45

da93f03b406f409940d0a6ef47b526607f82ebf457d98f69299b88aceede576a

This entry is record number 2362. It has not been edited since it was approved; the hash above would not match if it had. How to verify

Gemini CLI's autonomous tool loop silently consumed 47 million tokens on a five-file refactor | Vigilo AI Watch