Cron
An Android alarm app that picks your wake time from your calendar, location, travel time and sleep signals.

At a glance
- Kotlin, Android
Tags
An Android smart alarm that decides each evening when to wake you, from your calendar, your location, the travel time to your first commitment and overnight sleep signals. A second, fixed alarm is armed as a safety floor. The evening plan is computed with Anthropic's Claude.
How a night goes
Every evening, a daily trigger starts a session. Claude is given the wake window you allow, your travel and preparation buffers, your location and time zone, then works through a routine with tools: it reads the next 24 to 30 hours of the calendar, finds the first event that needs you somewhere, looks up its address, estimates the commute and sets the alarm for the arrival time minus the commute minus the preparation time.
The filtering matters. All-day events are ignored because they are markers, not appointments. Purely virtual events are skipped unless they are all there is. Back-to-back events are collapsed to the one that decides when you actually have to leave home. On a free day, the alarm goes to the latest time of a wake window you set.
Overnight, a foreground service listens to the phone and, when available, to sleep stages from Health Connect. A lighter model, Claude Haiku, is asked to re-plan when something changes:
- If you fall asleep again after waking, the alarm is set again.
- A short bout of activity in mid-sleep, under three minutes, is treated as a bathroom trip and ignored.
- Ten minutes out of bed brings a morning briefing notification.
- When the sensors show light sleep close to the alarm, it can ring a minute or two early to wake you gently.
- After three snoozes, the app stops asking the model and simply rings again five minutes later.
Two alarms
The AI alarm is the one that moves. The hard-latest alarm is armed once, when the session starts, and never moves: if the model fails, the network is down or the API key is wrong, you still wake up by that time. The model can never set an alarm later than it, and the limit is enforced by the tool itself, not left to the prompt.
Under the hood
Written in Kotlin with Jetpack Compose. Each night is a session driven by a small state machine (planning, monitoring, awake, monitoring again, complete), stored in a Room database. Work is queued with WorkManager, commute times and addresses come from the Google Routes API, and the Anthropic key is entered in the app and kept in encrypted storage. Without a Routes key, the app falls back on a flat thirty minutes of commute.
The app also remembers things about you, such as how much sleep you need or how early you want to be at an airport, in a memory screen that lists what it has learned.

