Writing

Building Driftwell with Claude

Claude turned my idea for a sleep app into a real Android app on Google Play, fast. Deciding what sounded right, and finding out whether people want it, stayed my job.

10 min read

  • Android
  • AI
  • Audio
  • Claude Code

Driftwell is an Android app that plays spoken affirmations, in a voice you choose, over soundscapes and frequencies, and keeps playing all night with the screen off.

I built it because I was fed up. At night I wanted a frequency and a few affirmations to fall asleep to, not a bright screen and another YouTube search. When I did find something, it was too short, or I didn’t trust the message, or the music was wrong. Or an ad cut in right as I was finally drifting off.

I gave the job to Claude Code, and Claude wrote most of the code, fast. Claude could build a frequency engine, test it and prove it matched its own spec, and it still had no way to know whether the result sounded like anything a person would fall asleep to.

That’s my argument. An agent can build and test the machinery, but anything sensory (sound, animation, voice) needed a person to listen and look, and whether anyone wants the result is a question no agent can answer.

Try it tonight. Driftwell is free on Google Play, with no ads. If you like it, Driftwell Plus unlocks everything else for a one-time $9.99. No subscription.

Get it on Google Play

Driftwell playing the Deep Sleep preset on my phone in the Nolan voice, with the sound on. The captions are only here in case you’re browsing with the sound off. The app itself doesn’t show captions.

Design criteria

Five criteria sat under the whole build:

  1. Mix it yourself. Spoken affirmations, soundscapes and frequencies like binaural beats are each selected independently and mixed into a custom session that plays all night with the screen off.
  2. Speech renders on the phone, quickly. Affirmations are user customizable, so voice-to-text can’t be prerecorded. It has to run on the phone, fast, and work offline.
  3. Voices sound soothing, never robotic.
  4. Frequencies sound professional, as good as generators like mynoise.net.
  5. No ads, ever.

Preview samples

A preset is a set of affirmations, a voice, a frequency and a soundscape that go together. The video at the top is Deep Sleep: the Sleep affirmations over a slow binaural beat and a soundscape called Long Rain. That’s the kind I play at night, with headphones on and the screen off.

Driftwell isn’t only for bed, though. The morning and daytime presets are faster and brighter, for waking up or for settling your focus before a hard meeting.

Sleep · Abundance
Morning · Energy
Daytime · Focus

Three more presets as they ship, recorded from the app on my phone, with the sound on. Captions are added for browsing without sound; the app doesn’t show them.


Everything above is the story. Everything below is the build. If you are here for the systems, this is where it starts.


Building the frequencies

Driftwell has 33 frequency presets, and they come in a few kinds. Binaural beats play a slightly different pitch in each ear, and you hear the difference as a slow beat. Pulsed frequencies get the beat by switching one pitch on and off. Sweeping frequencies move one pitch slowly from ear to ear. Then there are the 40 Hz presets and the singing bowls. All of them are generated by code on the phone, so any one mixes with any soundscape and any voice.

Some were much easier than others. Binaural came first and was close to right from the start, since it’s two pitches and a gap between them. Pulsed and sweeping frequencies took more care. A pulse that sounds gentle at 2 beats a second sounds harsh at 16, so the pulse had to soften as it speeds up. The sweep had to stay the same loudness as it moved, or you’d hear it dip in the middle.

The 40 Hz presets were the hardest. I told Claude “the 40 Hz is not great,” without knowing why. I’ve long used mynoise.net for this kind of sound, so it was my inspiration and my reference for debugging. I had Claude build one measuring tool and run mynoise’s output and ours through the same checks, so we compared numbers instead of descriptions. Measuring side by side showed what was wrong with ours, and that’s how I built Driftwell’s own frequency engine instead of copying anyone’s.

Here are three of my favorites. Use headphones, because the binaural one only works with a different sound in each ear.

Deep Sleep: binaural, 2 beats a second

Settling: a soft pulse, 4 a second

Rocking: one pitch sweeping slowly from ear to ear

Rendered straight from Driftwell’s frequency engine, with nothing else mixed in.

Singing bowls: generated (bad) vs. recorded (good)

The bowls started as generated frequencies too, and no amount of generation was going to make them sound like a real bowl. So I went back to recordings. Those had problems of their own. Looping short strikes sounded like a cheap synthesizer effect, and stretching one recording to play every note made the others sound fake. What ships is seven recordings I made of my own bowls, one for each note.

Bad: generated, an early experiment that never shipped

Good: recorded, my bowls, as they ship

The same three notes both times.

Voice trials

Three speech engines came and went before one stayed. The first was Android’s built-in text-to-speech, and it was extremely robotic, the opposite of a voice you’d fall asleep to. The dev log called it “unshippable, not merely a weak free tier”. Google’s cloud voices were fully built and working, and I had them deleted anyway: they needed a connection, and on a real listen they didn’t sound soothing enough.

Because anyone can write their own affirmations, voice-to-text had to run on the phone. I had Claude measure four on-device voice models, Kokoro, Supertonic, Kitten TTS and Piper, on a mid-range phone with real affirmation lines. Speed knocked out Kokoro. The rest was settled by listening, and Supertonic was the clear favorite.

Kitten and Piper were smaller and faster to download, and a small default with an optional upgrade was the obvious design. I shipped one engine only, because most people never tap an optional download, and a tier would have meant most people hearing the second-best voice.

Choosing the engine was the easy part. Tuning it was not. Slowing a voice down for sleep sounds like a single setting, and it took weeks to get right (more under testing below).

Teaching an AI to animate the landing scenes

Claude doesn’t understand a nature scene. Give it a still photograph and ask for something calm and alive, and it doesn’t know which part is sky and which is ground, or what kind of motion makes a picture read as a place instead of a screensaver. I had to teach it both, and it took three attempts to get right.

  1. Glowing orbs. The first attempt stacked layered photos with drifting glow orbs and sparkles, and I rejected it on sight. My note was “not wild alien looking orbs”.

  2. Motion nobody could see. The second attempt started from separating foreground from background. Each scene became one still photo, with the moving effects confined to the sky, which the build finds by working down from the top edge until it hits the treeline. Then the motion was so calm it was invisible. That produced the rule “An effect nobody notices is a bug, not restraint,” and the tests now fail if a scene moves too little as well as too much.

  3. Six scenes, each with its own motion. The third attempt is six photographs: aurora, beach, mountain, galaxy, sunrise, garden. I sourced the photos myself, all under Creative Commons or otherwise free-to-use terms. Only the two with jagged skylines need a cut-out of the sky. The galaxy must not have one, because the whole sky rotates.

The mountain’s clouds show the gap plainly. Claude’s measurement confirmed they moved exactly as designed, one screen width every 390 seconds. My note back was “seriously i do not see the clouds moving. i let it play for several minutes and i noticed no change.” Both were true, because that speed is below what the eye registers as motion. They now move more than twice as fast, and that version was confirmed by eye.

Every effect is one I designed and tuned by eye: falling leaves, drifting clouds and cloud shadows, birds, dolphins, a moving aurora and shooting stars.

This is a nice-to-have, not the point. If you’re trying to get away from blue light, you’ll have the screen off anyway. But it has a wow factor, it makes the app feel polished, and it brings Driftwell up to par with the animated sleep videos on YouTube.

Aurora
Beach
Mountain

Three of the six scenes, recorded from my phone at real speed. In each one, only the parts of the photo that should move do.

A month of testing

Claude wrote hundreds of automated tests, and each new one was proven by breaking the code it guards and watching it fail. For a month I also used Driftwell every night. These are what only a person caught:

  • Slow voices broke in ways tests passed. At the slowest speeds the voice padded lines with silence, so a preview “only played a few words.” One step up it “completely mangled the sentences.” Later a user pack came back with “slurring and odd pauses… weird slowdowns and speed UPS.” The quality check passed every one of those clips. Each slow speed was cut after a listen, and the slowest setting now is the slowest the voice can say evenly.
  • Wrong words. The new affirmations were written in first person and the app speaks in second, so a script converted them. Reading every line by eye caught “You was chosen”, and three of the five defects found that way were invisible to every test.
  • Too much control. I knew the app well enough to get what I wanted. Other people didn’t. They got frustrated first by having no presets, then by balancing all the sliders. It felt “just like YouTube videos at night”. That’s why Presets mode and the three-question preset builder exist.

The three-question preset builder, sped up.

Tests can tell you the code does what it claims. They can’t tell you the claim was the right one.

Guardrails

An app about sleep, anxiety and grief sits right next to medical advice, and I didn’t want to run afoul of Google Play’s policies. So early on, I set one strict rule: Driftwell is wellness, never treatment. No cures, no clinical claims, no promised outcomes, anywhere in the app or the store listing. Claude works under that rule on every change, and it saved me more than once:

  • The affirmations. A test screens all 1,230 lines for clinical words and promised outcomes. When it flagged the Grief pack’s lines about emotional healing after a loss, I read them, decided they weren’t health claims, and changed the rule instead of the lines.
  • The frequency descriptions. Traditional names for some frequencies promise things like “liberating guilt and fear.” Driftwell’s descriptions only say how a frequency sounds and how fast it moves, never what it does to you.
  • The voice license. The voice model’s license forbids using it for medical advice and requires the app to say the voice is synthesized. The rule already covered both, so a careless line in the anxiety or recovery packs would have broken the license as well as store policy.

AI will keep you safe, but only if you keep yourself safe first. Claude followed the rule every time. Writing the rule down was my job.

What’s next

  • Hearing from people. I hope more people use Driftwell and tell me whether it helps with what they set out to do, whether that’s sleeping, focusing or something else.
  • Control vs. just press play. Driftwell bets people want to choose their own words, voice and sound. YouTube bets the opposite. The app now meets people in the middle: seven curated presets you can just play, and a three-question preset builder for something of your own without touching a slider. If people use the builder and come back, the control is worth it.
  • iOS. The shared core that runs Driftwell’s data, downloads and presets already runs on the iPhone.
  • AI inside the app. An assistant could help you write affirmations for exactly what you’re working on, in your own words, and still keep them away from medical claims.

Why I build

Claude helped me turn an idea I’d been carrying around at night into a real app on Google Play in a couple of months. It wrote the frequency engine, the tests and the scenes. I decided what sounded right, what looked alive and what was safe to say.

This is why I got into software in the first place: to build things that help people live a little better. If Driftwell helps someone set down a hard day and sleep, or walk into a difficult meeting a little steadier, it was worth every night of testing.

Get it on Google Play

After all, AI doesn’t need to wind down to sleep. People do.