I'm not an engineer. I build apps with a team of AI agents, and this post was written with AI help.
This is about one design rule in my train alarm app: wake up the person who's asleep, and nobody else.
The app is called Railnap. Fall asleep on your commuter train, and just before your stop, an alarm plays only in your earphones. I first built it for trains in Japan, and Railnap is the US edition, built on the same code.
It was in the very first sentence
When I started the project, my whole idea fit in one sentence:
An app that wakes you just before your station, with an alarm only you can hear in your earphones.
You've probably seen it happen. Someone's phone alarm goes off on a quiet train. The people around them jump more than the person who set it.
I didn't want to miss my stop. But I didn't want to be that person, either.
So "only in your earphones" wasn't a nice-to-have. It was the condition the whole app was built around.

During a ride: when it will wake you, that the sound will play in your earphones, and that it's watching your location
With earphones, without earphones
Here's how the alarm behaves:
- Earphones in: the alarm plays only in your earphones, and the phone vibrates.
- No earphones: it doesn't play through the speaker at all. It only vibrates.
- Earphones fall out while it's ringing: the sound stops right away, and the vibration keeps going.
Wired or Bluetooth both work. If you're listening to music, the music gets quieter and the alarm plays on top of it.
The third case is the one I worried about most. When you doze off, earphones slip out of your ears all the time. On a phone, when earphones disconnect, the sound usually switches to the speaker. If that happened mid-alarm, the whole car would hear it, and the app would have failed at its one job.
So the moment the earphones come out, the app stops the sound before it can reach the speaker, and keeps vibrating to keep waking you.
Pick a sound that actually wakes you
There's a nice side effect of playing only in your earphones: you can use a loud sound, and nobody else hears it.
You can choose from several sounds, from soft ones to loud alarm-clock-style ones. You can also set the volume and have it start quiet and fade in.
Pick whatever actually gets you up. Don't be polite about it.

When it rings: "I'm awake," or ring again a little later if you're not there yet
Two things at once
Not sleeping past your stop, and not bothering the people around you.
It's not one or the other. The alarm I wanted had to do both. Only when it did both did it feel like the app I'd been wishing for on my own commute.
Is there a small, everyday tool you wish you could build for yourself?
Railnap works on seven US commuter railroads: Caltrain, MBTA Commuter Rail, Metra, SEPTA Regional Rail, Long Island Rail Road, Metro-North Railroad, and Metrolink.
Railnap is not sponsored by, affiliated with, or operated by any of these agencies.
Originally published on Medium.




