Nutrition and sleep · patterns measured in your own data
Nutrition and sleep: the patterns Biokode finds in your own data
Anyone who has eaten a pizza at eleven knows that what you eat affects how you sleep. What almost nobody knows is how much it affects them: how many minutes, in which metric, how often. Biokode answers that with your own data: it reads sleep from your watch or ring, gathers what you logged that day and compares the nights following each factor with the rest of your nights.
This page explains what is known in general, why a study’s average will not tell you when to have dinner, and how Biokode measures it so as not to sell you a correlation that is not there.
How Kodi tells you
Two real readings from the engine, with the caution built into them:
What is known in general, said carefully
Research on food and sleep is plentiful and, on average, points in fairly consistent directions: alcohol helps you fall asleep and worsens the second half of the night; caffeine taken in the afternoon lengthens the time to fall asleep and reduces deep sleep in many people; large dinners very close to bedtime are associated with more awakenings; and short sleep changes appetite the next day, generally towards more calories and later.
All of that is true as a group average. The problem is that you are not an average. The effect of coffee varies enormously with how you metabolise it; some people sleep the same after dinner at ten and others notice it at nine. A general recommendation is a reasonable starting point, not a diagnosis of what happens to you.
Why the study average does not decide your dinner time
A study tells you that, in a group of a hundred people, late dinners were associated with twenty minutes less sleep. It does not tell you whether you are among those who lose forty or among those who lose nothing. To find out you have to do what the study did, but with you: gather your nights with the factor, gather your nights without it and compare.
That takes three things almost nobody has to hand: sleep measured every night (your wearable does that), a record of what you did each day (Biokode does that when you log food and note an event) and an honest way of comparing that does not mistake noise for signal. The third is the hard one.
How Biokode measures it in your nights
The engine looks at a rolling window of several months. Each night is a sleep record from Apple Health or Health Connect, assigned to the local day it ended on: duration, share of deep and REM sleep, resting heart rate and overnight HRV. Each day has its factors: those derived from the log (late dinner, when the last meal falls shortly before you fall asleep; late training, when the session ends late) and those you note with a tap (alcohol, sauna, meditation, an event of your own).
For each factor, it compares the nights that follow a day with it against the nights without it, metric by metric. If you slept 6 h 50 min on average after a late dinner and 7 h 20 min the rest of the time, you will see “about 30 minutes less, 7%”.
- Sample minimums: a factor does not appear until there is a minimum number of nights with it and of baseline nights. Before that there is nothing to say, and the engine does not say it.
- Strength measured against your own variability: every difference goes through a statistical test with the real number of nights for that metric. An HRV that swings a lot from night to night earns no labels on a handful of data points; a stable resting heart rate earns them with fewer.
- Effect floor and sample ceiling: a difference that is too small is not labelled however consistent it is, and a strong label needs more nights than a weak one.
- Unknown is not absent: days when you logged no food do not count as “no late dinner” or “no alcohol”. It only compares what it knows.
- Everything is presented as association (“is associated with”), never as cause. And the action Kodi proposes always targets the factor (earlier dinner, moving the workout), never eating less.
The factors it can look at today
- Late dinner: last logged meal shortly before the bedtime your wearable records.
- Alcohol: noted with a tap in the day’s event log.
- Late training: a session ending late in the day, from your workout log or your wearable.
- Sauna and meditation: one-tap events, because some people sleep better afterwards and some do not.
- Your own events: anything you want to watch (a work dinner, a trip, a long nap) is logged as a named event and enters the same analysis.
- Short night as cause, not effect: the engine also looks at what happens to your intake the day after sleeping less than usual (total calories, share eaten in the evening) and to your mood and energy that day.
How to read a result without fooling yourself
“11% less HRV after a late dinner, medium association, 9 nights” means exactly that: on nine nights after a late dinner your average HRV was 11% lower than on the rest, and the difference is large enough against your variability that it is reasonably unlikely to be noise. It does not mean the late dinner causes the drop: the nights you eat late may also be the nights you get home later, more tired and with more than one drink.
So the useful reading is not “late dinners are bad” but “here is something that repeats in me; I will try changing it for two weeks and see whether the association moves”. Biokode is built for that loop: you change the factor, keep logging and the engine recomputes over the rolling window.
What Biokode does not do
- It does not measure sleep: it reads it from your watch or ring through Apple Health or Health Connect. Without a wearable, this part does not exist.
- It does not diagnose sleep disorders or replace a sleep clinic. If you sleep badly persistently, the app will tell you so and refer you to a professional.
- It does not claim causes. Everything is association over your personal averages, and it is shown that way.
- It does not invent patterns to have something to say: if there is no signal, there is no message.
Frequently asked questions
Does eating late affect sleep?
Which wearable do I need?
How long until the first pattern shows up?
Can it tell me coffee affects me if I do not log it?
Is this medical advice?

Find out what repeats in your nights
Connect your wearable, log what you eat and note alcohol or coffee with a tap. In a few weeks, Kodi tells you what changes in your sleep after each one, with its numbers and its limits. 7-day free trial.
Keep going
Biokode is a wellness tool and does not replace advice from a healthcare professional. Associations between factors and sleep are contrasts of personal averages over a rolling window, not cause-and-effect relationships. The engine’s criteria and thresholds are those in force as of August 2026 and may be tuned. Figures in the examples are illustrative.