Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
What This Skill Does
Tracks API request usage in a rolling window and assigns a tier (ok, cautious, throttled, critical, paused) so agents reduce activity before hitting rate limits. On a real 429, it calculates exponential backoff and schedules automatic recovery. Works with Claude and OpenAI provider presets, with no external dependencies beyond Python and a JSON state file.
Unlike simple retry loops or dashboards, it prevents 429s before they occur by decelerating agent behavior smoothly rather than reacting after the limit is already hit.
When to use it
- Preventing 429 interruptions in long-running agent loops
- Throttling sub-agent spawning as Claude rate limits approach
- Auto-pausing overnight cron jobs after a rate limit hit
- Running multiple agent instances with separate usage tracking
- Tuning rate limit estimates based on observed request patterns
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: add rate limiting to my agent bash loop
- 1Run gate check with `python3 scripts/rate-limiter.py gate`
- 2Read exit code to determine current tier
- 3Skip sub-agents or background tasks if exit code is 1 or 2
- 4Execute the agent's primary work
- 5Record token usage with `python3 scripts/rate-limiter.py record 2000`
Agent completes work without hitting a 429, with request history logged to the state file for future gate checks