KAIROS
Kairos (ancient Greek: the opportune moment) is the unreleased always-on autonomous agent mode for claude-code. Unlike standard Claude Code which waits for user input, KAIROS keeps the agent alive between turns, acting at the right moment rather than on a schedule. It is gated behind compile-time flags (PROACTIVE and KAIROS) and is completely absent from external builds via Bun dead-code elimination.
The Tick Loop
In normal Claude Code, the message queue empties when the model finishes responding. KAIROS changes this: when the queue is empty, it injects a <tick> message containing the current local time.
const scheduleProactiveTick =
feature('PROACTIVE') || feature('KAIROS')
? () => {
setTimeout(() => {
const tickContent = `<${TICK_TAG}>${new Date().toLocaleTimeString()}</${TICK_TAG}>`
enqueue({ mode: 'prompt', value: tickContent, priority: 'later', isMeta: true })
void run()
}, 0)
}
: undefined
The setTimeout(0) yields to the Node.js event loop first, so user input always takes priority over tick messages. The system prompt on each tick:
"You are running autonomously. You will receive
<tick>prompts that keep you alive between turns — just treat them as 'you're awake, what now?' The time in each<tick>is the user's current local time."
SleepTool
Every tick without useful work is a wasted API call. SleepTool lets the agent yield control explicitly. Only available in proactive mode. The tool description surfaces the cost trade-off directly:
"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, when to wait for a slow process.
15-Second Blocking Budget
ASSISTANT_BLOCKING_BUDGET_MS = 15_000. If a shell command runs longer than 15 seconds, it is automatically moved to a background task. The agent gets control back immediately; nothing is killed. The command continues in the background and the agent is notified on completion.
Append-Only Daily Logs
Standard Claude Code rewrites MEMORY.md in-place. KAIROS can't — sessions are perpetual, and rewriting from a continuously-running agent would corrupt intermediate states. Instead, it writes append-only to date-named log files:
logs/YYYY/MM/YYYY-MM-DD.md
When the date rolls over mid-session, the agent silently starts appending to a new file. The system prompt: "Do not rewrite or reorganize the log — it is append-only. A separate nightly process distills these logs." That nightly process is auto-dream.
SendUserMessage
In background mode, stdout is unmonitored. KAIROS uses SendUserMessage (internally BriefTool) as its explicit output channel. The status field tags intent: 'normal' for replies, 'proactive' for unsolicited updates — enabling downstream routing to push or silently log.
Exclusive Tools
Three tools are only available in KAIROS mode, not in regular sessions: - SendUserFile — deliver files to the user - PushNotification — push alerts - SubscribePR — monitor pull request activity autonomously
Relationship to ULTRAPLAN
KAIROS handles ambient, continuous operations (memory accumulation, background monitoring, proactive nudges). ultraplan handles episodic deep deliberation (30-minute architectural planning in remote Cloud Container Runtime). The community drew the parallel to Kahneman's System 1 / System 2 — fast intuitive processing vs. slow deliberate reasoning.
Willow Mode
KAIROS includes an inactivity detection system called Willow Mode that activates when users return after extended absence. It re-orients context by reading accumulated daily logs and memory files to brief the returning user.
Key Claims
clm-20260409-4da80c4f2b46: KAIROS injects tick messages to keep agent aliveclm-20260409-4552203a567c: KAIROS and ULTRAPLAN form a two-speed system
Sources
src-20260409-a14e9e98c3cd— Internals: Auto-Memory, Auto-Dream, and Agent Teamssrc-20260409-037a8abb6277— Community Deep Dive: Architecture, KAIROS, Auto-Dream