← Back to Blog

Why We Wrote Our Own Sleep Score

For ADHD brains, sleep quality determines your focus window — not your calendar. Your wearable tracks hours; we built a score that tells you what they mean. Here's how, and the midnight bug we fixed first.

I slept six hours last night. My watch said "Good Recovery." By noon I was staring at a blank document, re-reading the same sentence, wondering why the afternoon that was supposed to be my deep-work window felt like wading through wet sand.

Six hours. Good recovery. Sure.

If you wear an Apple Watch or an Oura Ring or a Whoop or any of the other devices that promise to decode your body while you sleep — you've felt this gap. The number says one thing. Your body says another. And if you have ADHD, that gap isn't just annoying. It's the difference between a productive morning and a lost one.

This is the story of why I stopped trusting the number on my wrist and wrote my own.


The midnight problem

Before I could build a sleep score, I had to fix a bug that took me longer to find than I'd like to admit.

CanopyOS reads your sleep data from Apple Health. Every morning, it pulls last night's sleep to help predict your energy for the day. Simple enough — query HealthKit for sleep samples, add them up, do some math. Ship it.

Except sleep doesn't respect midnight.

If you go to bed at 11pm and wake up at 6:30am, your sleep session crosses the date boundary. Half your night belongs to yesterday. Half belongs to today. If you ask HealthKit for "today's sleep" starting at midnight, you get the 12:00–6:30 half. You're missing the first ninety minutes — the part where most of your deep sleep actually happens.

I didn't catch this in testing because my own sleep was so inconsistent that the numbers always looked wrong. I assumed the data was messy. It was. But it was also incomplete.

I didn't catch the bug because my own sleep was so inconsistent that the numbers always looked wrong. I assumed the data was messy. It was. But it was also incomplete.

The fix was to widen the query window. Instead of asking for sleep between midnight and now, CanopyOS asks for sleep between 6pm the previous evening and noon today. An 18-hour window that captures the full night regardless of when you went to bed — whether that's 9pm or 2am (no judgment, we've all been there).

It sounds obvious in retrospect. Most bugs do. But this one mattered because everything downstream depends on it. If the sleep data is wrong, the energy prediction is wrong. If the energy prediction is wrong, the focus window is wrong. And if the focus window is wrong, the whole premise of the app falls apart.

Getting sleep right isn't a feature. It's the foundation.


Why not just use Apple's number?

Here's something most people don't realize: Apple Health doesn't give you a composite sleep quality score. Your watch tracks when you were asleep, what stage you were in, and how long — but it doesn't roll that up into a single number that means something actionable.

Apple gives you the raw ingredients — sleep stages, durations, timestamps — but no recipe. No composite score. No "here's what this means for your day." That part is up to you. Or up to your wearable's companion app, which might show you a "recovery score" or a "readiness" metric — but those are proprietary. Black boxes. You don't know what they're weighting, and their definition of "good" may have nothing to do with your definition of "functional."

And for ADHD brains, "functional" is the only metric that matters. I don't need to know if my sleep was clinically optimal. I need to know: can I focus this morning, or should I protect my energy for the afternoon?

That's a different question than any wearable is trying to answer.

I don't need to know if my sleep was clinically optimal. I need to know: can I focus this morning, or should I protect my energy for the afternoon?

Three things that actually matter

So we built our own score. Not from scratch — from sleep science research, from understanding what actually predicts next-day cognitive function, and from testing it against my own experience (and then our beta testers' experience) over weeks.

The score looks at three components. I'll tell you what they are and why they matter. I won't tell you the exact weights or thresholds — that's the recipe, and we're keeping it.

Duration. This one seems obvious, but the nuance matters. Six hours isn't automatically bad. Four hours is. Nine hours isn't automatically better than seven. There's a range where your brain gets what it needs, and outside that range, the returns drop off fast. For ADHD brains, sleep debt compounds differently — one short night doesn't just mean one tired day. It means two or three days of impaired executive function. The scoring reflects that.

Architecture. Not all sleep is the same. A night with seven hours of light sleep is fundamentally different from a night with seven hours that includes real deep sleep and REM cycles. Deep sleep is where your brain consolidates memory and clears metabolic waste. REM is where emotional processing happens. If you're getting hours but not depth, your watch might say you slept fine. Your brain knows otherwise. CanopyOS reads the sleep stage data from HealthKit — the breakdown between deep, REM, light, and awake time — and factors in the composition, not just the total.

Efficiency. How much of the time you spent in bed were you actually asleep? If you laid down for eight hours but spent ninety minutes awake in the middle — tossing, checking your phone, staring at the ceiling running through tomorrow's to-do list — that's a different night than eight hours of solid, unbroken sleep. The score accounts for that ratio.

Three components. Each one captures something the raw "hours slept" number misses. Together, they give CanopyOS a picture of your night that's close enough to what your body actually experienced to make a useful prediction about your day.


The part where trust gets built

Here's what I've learned building this: the score itself isn't the hard part. The hard part is getting someone to believe it.

Every productivity app makes promises. We'll predict your best time to work. We'll optimize your schedule. We'll tell you when to focus. And every one of those promises relies on data the user can't see, processed by logic the user can't verify, producing recommendations the user is supposed to just... trust.

That's a bad deal. Especially for people who've been burned by every other app that made the same pitch.

So CanopyOS does something different. Every morning, after your health data comes in and the app predicts your energy for the day, you do a check-in. You tell the app how you actually feel — your energy level, your mood. The app takes what the data says and holds it next to what you said.

Then, when you come back for your evening reflection, you see both. We call it the Alignment Strip. It's a simple visual: "This morning you predicted" on one line, "You felt" on the next, and a quiet synthesis underneath. When they match: You read yourself well. When you had more energy than the data expected: You had more than the data saw. When the prediction overshot: The data overestimated you. You were right to go slow.

The app shows you both. What it predicted, and what you said. Not to grade you. To let you see whether the system is listening.

The point isn't to be right every time. The point is to be transparent every time. Because trust isn't built by accuracy alone. It's built by showing your work.

And here's where it compounds: CanopyOS tracks these patterns over time. Your energy rhythms on Mondays look different than Thursdays. Your post-travel weeks hit different than your home weeks. The system learns your day-of-week patterns from every check-in you do, and the predictions get sharper as the data builds. Not because the algorithm gets smarter — because it has more of you to work with.


Why this matters for ADHD

Most people can power through a bad night. They're groggy, they drink extra coffee, they're fine by lunch.

ADHD brains don't work that way. Sleep quality directly impacts executive function — the exact set of cognitive skills that ADHD already impairs. Task initiation. Working memory. Impulse control. Emotional regulation. All of them degrade faster with poor sleep, and all of them recover slower.

If you have ADHD and you slept badly, your productive window isn't just smaller. It might be in a completely different place than you expected. The meeting-packed morning you planned for might be the worst possible time for deep work. The afternoon you wrote off might actually be your only real shot.

That's what the sleep score feeds into. Not a grade. Not a judgment. A prediction about when — when today's focus window is open, based on the night you actually had. Not the night your calendar assumed you'd have.

Your calendar doesn't know how you slept. Your focus window does.


If you're building your day around a number on your wrist — or worse, around no data at all — there might be a better way to find your window.

Join the beta at canopyos.net


Next: The Graveyard of Productivity Apps — every system I tried, why they all failed, and what finally broke the pattern.