CBT-I Diary Snapshot
{{ formatPercent(avgEfficiency) }}
Average sleep efficiency across {{ entries.length }} night(s)
Avg TST {{ formatHours(avgTstHours) }} Avg TIB {{ formatHours(avgTibHours) }} Avg SOL {{ formatMinutes(avgSolMinutes) }} Avg WASO {{ formatMinutes(avgWasoMinutes) }} 7-night SE {{ formatPercent(rollingSevenEfficiency) }} Cadence {{ reviewCadenceLabel }} Regularity {{ formatFixed(regularityScore, 0) }}/100 Trend {{ trendLabel }} Goal gap {{ formatSignedPercent(avgEfficiency - efficiencyGoalValue) }} {{ riskBand }} Latest {{ lastEntry.date }}
min:
min:
min:
%
Date Bed Up TIB (h) TST (h) SOL WASO Awake # SE % Quality Nap Wake drift 7-night SE Regularity Risk Copy
{{ row.date }} {{ row.bedtime }} {{ row.out_of_bed }} {{ formatFixed(row.tib_hours, 2) }} {{ formatFixed(row.tst_hours, 2) }} {{ formatFixed(row.sol_min, 0) }} {{ formatFixed(row.waso_min, 0) }} {{ formatFixed(row.awakenings, 0) }} {{ formatFixed(row.sleep_efficiency, 1) }} {{ qualityLabel(row.quality) }} {{ formatFixed(row.nap_min, 0) }} {{ formatFixed(row.wake_drift_minutes, 0) }} {{ formatFixed(rollingSevenEfficiency, 1) }} {{ formatFixed(regularityScore, 0) }} {{ riskBand }}
Priority Action Why now Checkpoint Metric focus Copy
{{ row.priority }} {{ row.action }} {{ row.reason }} {{ row.checkpoint }} {{ row.metric }}
No review guidance available.

                    
:

Introduction

A CBT-I sleep diary is a night-by-night record of when you went to bed, how long it took to fall asleep, how much time you spent awake after that, and when you finally got out of bed for the day. In insomnia treatment, those entries matter because they show whether time in bed is turning into sleep or into repeated wakefulness. This tracker turns that diary into nightly metrics and review cues.

The main value is pattern detection. One rough night can feel worse than it was, and one good night can feel more decisive than it is. This package counters that by converting each row into TIB, TST, sleep efficiency, wake drift, and a running snapshot with averages, a seven-night line, a trend label, and a diary-level risk band.

A realistic use case is someone trying to hold a 07:00 wake target while deciding whether the current sleep window should stay fixed for another week. Several nights of entries can show that sleep efficiency is climbing while wake timing is drifting later, or that bedtime looks steady while WASO is still consuming too much of the night. Those are different situations, and the next behavioral adjustment is not the same in both.

The advanced settings let the same diary support different review habits. You can set a wake target, choose an efficiency goal, decide how many recent nights to retain, include naps in the balance view, and switch review cadence between every three nights, weekly, and biweekly checkpoints. Those settings do not change the logged clock times, but they do change the review frame.

The important boundary is that this remains a tracking and review aid, not a diagnosis engine. The Risk badge, guidance points, and review-plan rows are package heuristics built from diary aggregates rather than a clinical severity scale. A seven-night starter diary appears automatically on first load so the chart is not empty, and those sample entries should be replaced before you draw conclusions.

Everyday Use & Decision Guide

A good first pass is to set Wake target to the time you are actually trying to anchor, leave the default Sleep efficiency goal at 85 if that matches your CBT-I plan, and log at least five to seven real nights before you judge the trend labels. The snapshot works better as a weekly review than as a single-night scorecard.

The tool fits best when you are comparing a run of nights under one routine. If bedtime, wake target, and review cadence keep changing every day, the averages still calculate correctly, but the story they tell is harder to trust. Stable inputs make the review plan more meaningful.

  • Enter the clock times first and the awake minutes second if you are reconstructing a missed night. The error appears only when SOL plus WASO equals or exceeds time in bed.
  • Use Review Plan after several nights, not after one entry. Its priorities come from diary averages, recent wake drift, and the cadence you selected.
  • Do not expect Include naps in sleep balance to raise SE %. It changes the effective sleep total saved in the row and JSON snapshot, but sleep efficiency still uses nocturnal TST and TIB.
  • Stop and verify when SE % looks good but Wake drift or Trend still looks poor. Better efficiency can still happen while the schedule drifts later.

When you compare one review period against another, keep the same wake target, goal, and retention window if you want changes in Goal gap, Regularity, and Risk to mean anything.

Technical Details

Each saved row starts with two clock times. The tool parses Bedtime and final Out of bed, carries the interval across midnight when needed, and converts that span into TIB. SOL and WASO are then subtracted from TIB to produce TST, while sleep efficiency stays tied to nocturnal sleep only. If the awake minutes equal or exceed time in bed, the row is rejected because the night would no longer be internally consistent.

Once several rows exist, the package behaves less like a single-night calculator and more like a diary reviewer. It computes diary-wide averages, a rolling seven-night efficiency mean, wake drift against the chosen target wake time, a Regularity score based on recent drift, and a package-only Pressure index that blends wake burden with average efficiency. Subjective sleep quality stays separate on a one-to-five scale.

Trend and risk are diary-level constructs, not per-night verdicts. Trend comes from a straight-line slope across nightly sleep-efficiency values, while Risk is assigned only after comparing average efficiency, regularity, and pressure against fixed thresholds in the code. The JSON snapshot bundles settings, summary metrics, guidance points, the review plan, and rebuilt entries into one record, and the diary itself persists locally between visits.

Formula Core

The central quantities are total sleep time, sleep efficiency, and regularity.

TST = TIB-SOL-WASO SE = 100×TSTTIB Regularity = clamp(100-1.9×mean(|wake drift|),0,100)
Sleep diary symbols and meanings
Symbol Meaning Unit How the package uses it
TIB Time in bed from bedtime to final out-of-bed time Minutes or hours Starting span for nightly calculations.
SOL Sleep onset latency Minutes Awake minutes before sleep begins.
WASO Wake after sleep onset Minutes Awake minutes after first sleep onset.
TST Total sleep time Minutes or hours TIB after removing SOL and WASO.
SE Sleep efficiency Percent Used in the snapshot, chart, and review logic.
Wake drift Difference between actual out-of-bed time and the chosen wake target Minutes Feeds recent drift and regularity.

Thresholds And Package Rules

Sleep diary thresholds and reading notes
Output or trigger Package rule How to read it
Trend Rising quickly at >= 0.45, Rising at >= 0.18, Falling at <= -0.18, and Falling quickly at <= -0.45 percentage points per night. A slope across nights, not a one-night jump.
Risk Low relapse risk needs efficiency at or above goal, Regularity >= 75, and Pressure index <= 35. Moderate relapse risk allows efficiency up to four points below goal with Regularity >= 60 and Pressure index <= 55. Otherwise the label is High relapse risk. Useful for review pacing, not a clinical banding system.
Review Plan Priority rows appear when efficiency is below goal, recent wake drift exceeds 40 minutes, trend is falling, or average SOL and WASO stay elevated. Cadence changes the weighting of some triggers.
Include naps Nap minutes are added to effective sleep totals but not to sleep efficiency itself. Mostly relevant in row details and JSON.

For fair comparison, keep Wake target, Sleep efficiency goal, Retain nights, and Review cadence stable while you judge improvement. Otherwise a change in framing can look like a change in sleep.

Step-by-Step Guide

Use the diary as a repeating review cycle rather than a one-off calculator.

  1. Open Advanced first and set Wake target, Sleep efficiency goal, Retain nights, and Review cadence. If you do not need a special setup yet, the default weekly review with an 85% goal is a clean baseline.
  2. Enter Night date, Bedtime, Out-of-bed time, Sleep onset latency, Wake after sleep onset, Number of awakenings, and any nap or quality detail you want to keep, then press Add entry. A successful row updates the snapshot badges.
  3. If the row does not save, check the on-page error before trying again. Missing date or time fields stop the entry, and the message SOL + WASO must be less than total time in bed. means the awake minutes and clock times cannot describe the same night.
  4. After several nights, read the CBT-I Diary Snapshot first. Compare Avg TST, Avg TIB, 7-night SE, Regularity, Trend, Goal gap, and Risk before drilling into one row.
  5. Use Diary Metrics for the nightly breakdown, Review Plan for prioritized actions and checkpoints, and Sleep Efficiency Trend for nightly efficiency against the goal and rolling average.
  6. Open JSON when you need the settings, summary, guidance points, review plan, and entries in one structured record. It is the fastest way to confirm which diary context produced the current interpretation.

Interpreting Results

Start with the diary snapshot rather than a single row. Goal gap, 7-night SE, and Trend tell you whether the recent week is moving toward the chosen target or simply fluctuating around it. If the goal gap stays negative and the trend is still falling, the package is warning against expanding time in bed yet.

  • Goal met: average sleep efficiency is at or above the selected goal. With the default settings, that means Avg SE >= 85%.
  • Wake timing concern: the review logic becomes more cautious when recent absolute Wake drift averages above 40 minutes.
  • Trend boundaries: Rising begins at +0.18 percentage points per night, Falling begins at -0.18, and the quickly labels appear at +/-0.45.
  • Risk meaning: the repeated Risk label in the table is a diary-level summary computed from current averages, not a separate classification for each row.

The common false-confidence error is to treat one strong SE % row or one better subjective Quality rating as proof that the whole week is stable. Verify the impression by checking whether wake drift is also tightening and whether the seven-night line is moving in the same direction as the nightly points.

Worked Examples

Efficiency below goal even though bedtime is consistent

A week of nights around 23:45 to 07:00 with SOL 35 minutes and WASO 50 minutes produces a typical TIB of 7.25 hours and a TST of about 5.83 hours. That is roughly 80.5% sleep efficiency, so the default 85% goal is still being missed even though wake time looks disciplined. The highest-priority review row should stay focused on holding time in bed steady rather than expanding it early.

High efficiency can still hide schedule drift

Now take a night with Bedtime 00:15, Out of bed 08:00, SOL 15, and WASO 20. The night looks strong at about 92.5% sleep efficiency, but against a 07:00 wake target it also carries Wake drift +60 minutes. The diary can therefore show healthy efficiency while Regularity and the review plan still say the schedule is sliding later than intended.

When the entry fails validation

Suppose you enter Bedtime 23:50, Out of bed 00:20, SOL 20, and WASO 20. Time in bed is only 30 minutes, so the awake total already exceeds the night itself and the package blocks the row. Recheck the final out-of-bed time or correct the awake minutes until the night describes a possible interval.

FAQ

Does the diary send my entries to a server?

No. The main workflow runs in the browser, and the diary rows persist locally so they can be restored on the same device and browser profile.

Why were there already seven nights in the tool the first time I opened it?

The package seeds a starter diary when no stored rows exist so the chart and snapshot are immediately populated. Replace those rows with your own nights before treating any output as meaningful.

Does Include naps in sleep balance change SE% or the chart?

No. Sleep efficiency and the chart stay tied to nocturnal TST and TIB. The nap switch only changes the effective sleep total preserved in each row and in the JSON snapshot.

Why is the same Risk label repeated on every diary row?

Because Risk is computed from the current diary aggregates, recent wake drift, and the pressure index. It is a summary judgment about the diary as a whole.

Why will an entry not save?

The required date and clock fields must be present, and the awake minutes have to fit inside the recorded time in bed. If the tool shows SOL + WASO must be less than total time in bed., fix the times or awake totals before trying again.

Glossary

Time in bed
The interval from getting into bed with the intention to sleep to the final out-of-bed time.
Total sleep time
Nocturnal sleep after subtracting sleep-onset latency and wake-after-sleep-onset minutes from time in bed.
Sleep onset latency
Minutes spent awake before first falling asleep.
Wake after sleep onset
All awake minutes after initial sleep begins and before the final rise time.
Wake drift
The difference between actual out-of-bed time and the chosen wake target.
Regularity score
A package score from 0 to 100 derived from recent absolute wake drift, where higher numbers mean tighter wake-time consistency.
Pressure index
A package-only index that rises when wake burden increases and average sleep efficiency falls.
Review cadence
The checkpoint rhythm used to weight and label review-plan recommendations.

References