Uber's Cost Control Measures for Interactive Coding Sessions
When an Uber engineer opens Claude Code for an interactive coding session, automatic compaction kicks in at 400,000 tokens, even for models with million-token context windows. The reasoning effort is set to medium, and no MCP tool definitions load into the context at startup—all these settings are decided by Uber.
According to CTO Praveen Neppalli Naga, Uber exhausted its 2026 AI budget within the first few months of the year. Unexpected AI costs have also affected other projects, with 38% of respondents in a VentureBeat survey delaying, scaling back, or canceling AI projects due to budget overruns in the past year.
Weekly agentic requests at Uber grew 9.4x from February to August, not just for Claude Code but across all agentic offerings. Despite this increase, overall AI spending remained relatively flat since April, as reported by Uday Kiran Medisetty, a distinguished engineer at Uber, at the Agentic Infrastructure Stack Summit.
Medisetty outlined Uber's four strategies to control the costs of interactive sessions:
-
Automatic Compaction: At 400,000 tokens, an agent sends its entire context back to the model on every request. A larger context increases costs, so 400,000 is a balanced point.
-
Effort Setting: Set to medium, this controls the reasoning done by the model before answering. Models perform better at a medium effort level, showing degradation at high effort.
-
Prompt Cache: The main agent's prompt cache lasts for an hour, while sub-agents have a five-minute cache. This reduces costs by reusing cached prompt text but requires tuning the cache timers based on request frequency.
-
No MCP Tool Definitions at Startup: Instead of direct MCP integrations that preload tool descriptions, agents invoke individual commands as needed, saving startup tokens. With over 100 tools, preloading would consume 50,000 to 70,000 tokens.