You need to add rate limiting to all tool calls in an agentic loop. Yo — Daily Challenge 2026-07-03 — Claude Cert Academy

You need to add rate limiting to all tool calls in an agentic loop. You have 8 tools. Which pattern correctly applies rate limiting as a cross-cutting concern without modifying each tool?

Answer: Register a pre-tool hook that checks the rate limit before every tool call

A pre-tool hook applies rate limiting once, around all tool calls, without modifying any individual tool. Adding a wrapper to each of 8 tools means adding another wrapper every time you add a new tool — the concern is not cross-cutting, it's replicated. System prompt instructions cannot enforce rate limits programmatically. A dedicated rate-limit-check tool relies on the model to call it consistently, which is not a reliable enforcement mechanism.

Continue to Claude Cert Academy