Switch language한국어
Back to the list

Tool-use API design for LLMs: 5 patterns that prevent agent loops and silent failures

TL;DR AI

Key summary

2 min read
  1. In July 2025, a Claude Code instance reportedly fell into a recursion loop, consumed 1.67 billion tokens in five hours, and racked up an estimated $16,000 to $50,000 in charges.

  2. The incident exposed a key production risk for LLM agents: they can keep calling tools without crashing, turning silent failures into runaway costs.

  3. The article recommends tool-design patterns that make agent state clearer, reduce ambiguity, and stop endless retries before they spiral.

  4. Suggested fixes include self-describing results, explicit next_action_hint signals, and APIs that surface failure instead of hiding it.

Read the original