Code Generation with Claude Code
Your team has deployed a Claude Code agent to automate large-scale refactoring tasks across a monorepo. To control costs, you set task_budget to 20,000 tokens for all jobs. After the deployment, engineers report that Claude is frequently refusing to start refactoring tasks entirely, or delivering incomplete results that stop partway through the first file. Logs confirm the requests are reaching the API and no stop_reason: "max_tokens" is being returned. What is the most likely root cause, and what is the correct architectural response?