SleepTool
- Entity ID:
ent-sleep-tool - Type:
tool - Scope:
shared
What it is
SleepTool is a specialized tool available only in KAIROS proactive mode that lets the autonomous agent yield control explicitly — choosing when to go dormant and for how long. It replaces the naive approach of running a tick on every event loop cycle with agent-directed scheduling.
Why it exists
In KAIROS's always-on tick loop, every tick without useful work is a wasted API call. The agent needs a way to say "nothing to do right now, wake me in 5 minutes" without the system burning tokens on empty ticks. SleepTool solves this by making sleep a first-class tool call with an explicit cost trade-off.
The tool description surfaces the economics directly to the model: "Each wake-up costs an API call, but the prompt cache expires after 5 minutes of inactivity — balance accordingly." The agent decides its own rhythm: how long to sleep, when to wake early for a slow process, when to stay awake during active monitoring.
What depends on it
- KAIROS — SleepTool is only available when proactive mode is active, not a general feature
- Cost optimization — without SleepTool, KAIROS would burn API calls on every tick, making autonomous operation prohibitively expensive
- Cache economics — the 5-minute cache expiry creates a natural tension: sleep too long and lose the cache, sleep too little and waste API calls
Trade-offs and limitations
- Only available in proactive mode — not accessible to regular Claude Code sessions
- The 5-minute cache expiry window creates a hard constraint on maximum sleep duration for cache-sensitive operations
- The agent must learn the right sleep/wake cadence for each task profile — too aggressive wastes tokens, too passive misses events
Key claims
- SleepTool is the only tool in Claude Code that is conditionally available based on operating mode
- The tool description explicitly encodes the cost/benefit trade-off for the model to reason about
Relationships
- depends_on: kairos
- related_to: cache-economics, prompt-cache
- used_by: autonomous agents, background monitoring tasks
Evidence
src-20260409-a14e9e98c3cd: Internals — KAIROS section