CBT-I in your pocket. Nothing else.

noctos is an open-source app that runs the full six-week CBT-I protocol — the first-line clinical treatment for chronic insomnia. No accounts. No telemetry. No sleep scores.

v0.1.0 · Android · macOS (experimental) · AGPLv3

What it is

Six weeks. A diary. An algorithm that titrates your sleep window based on how you actually slept. A few reminders. That is the whole app.

CBT-I outperforms sleeping pills long-term and is the recommended first-line treatment by the American Academy of Sleep Medicine, the European Sleep Research Society, and NICE. Until now there has been no mature, free, source-available implementation of it.

How it works

  1. Week 1 — assessment

    Baseline diary, chronotype quiz (MEQ short form), sleep window setup.

  2. Week 2 — sleep restriction

    The algorithm prescribes a tighter time-in-bed window from your baseline efficiency. Floor at five hours. Never lower.

  3. Week 3 — stimulus control

    Bed for sleep only. Out of bed after 20 minutes of wakefulness. The diary tracks it.

  4. Week 4 — cognitive

    Worry journal with a bedtime-window guardrail. Catastrophization reframes.

  5. Week 5 — hygiene

    Caffeine log with a 5-hour half-life model and predicted milligrams at bedtime.

  6. Week 6 — relapse prevention

    What to do when sleep degrades again. The protocol, written down.

The titration rule, in full

rolling sleep efficiency ≥ 85%  →  expand window +15 min
rolling sleep efficiency < 80%  →  contract window −15 min
otherwise                       →  hold
floor: 5 hours. non-adherent nights excluded.

No magic. No black box. The algorithm is in lib/domain/cbti/sleep_restriction.dart and is covered by fifteen unit tests.

What it does not do

Download

Web

Runs entirely in your browser. SQLite lives in OPFS. No server, no account. Reminders not available on web (use the mobile/desktop build).

Open noctos

Android

Signed APK from GitHub Releases. F-Droid submission pending.

Latest release

macOS

Unsigned .app bundle. Right-click → Open the first time. Notarized build coming.

Latest release

iOS

Build it yourself from source. Signed distribution requires an Apple Developer account; we're working on it.

Build instructions

Source

AGPLv3. If you run a modified version as a network service, you must release source.

GitHub

Evidence base

Not medical advice

noctos is a self-help tool that mirrors the structure of clinician-delivered CBT-I. It is not a medical device, does not diagnose disorders, and is not a substitute for evaluation by a sleep physician. If your insomnia is severe, has lasted more than three months, or is accompanied by mood symptoms, suicidal thoughts, snoring with breathing pauses, or excessive daytime sleepiness, see a clinician.