Know your insomnia treatments
Good sleep is non-negotiable for everything. If you sleep like shit, you will feel terrible, have less energy, be dumber, get sick more often, die early, etc. Unfortunately, it’s very hard to just simply sleep better. I’ve spent a huge amount of time trying to improve my sleep; this post is a collection of everything I’ve learned in the process.
(I’m not a doctor and nothing in this post is medical advice.)
The obvious things
Before doing anything fancy, do all the obvious things. You don’t need to do literally all of them, but you should try everything at least once.
Sleep for enough hours. Most people need 8-9 hours of sleep.
Make sure you get at least 15 minutes of sunlight in the morning within an hour or so. Ideally not just through a window, but actually going outside. The sun is absurdly bright, and even on an overcast day the light from the sky is hugely brighter than indoor lighting. If you really cannot go outside, or if you live somewhere where the sun doesn’t rise until much later than your wakeup time, you can also try devices that simulate morning light, like Luminette glasses, but honestly taking a walk every morning is so good that you should try really hard to do that.
Consistency is very important. Make sure to wake up around the same time every day.
If you nap, try to keep it to less than 90 minutes, and closer to the middle of the day so it doesn’t interfere with your sleep at night.
Winding down before bed helps a lot, though it’s not the end of the world if you can’t. If you are strong of will and can successfully not look at screens for a few hours before bed, you should probably do that. Blue light filtering glasses can also help (night shift on phones/laptops is typically not good enough). Don’t read anything agitating. Especially don’t go on X (the everything app).
Don’t drink caffeine and alcohol. If you have to, drink caffeine only in the morning, and alcohol early enough or in small enough quantities so your BAC has time to go down; you can use an online calculator to estimate how much alcohol is still in your system. Don’t eat within 3 hours of bedtime. Exercise during the day, but not too close to bedtime.
Wear a sleep eye mask and earplugs while sleeping. Get an Eight Sleep. Get a better mattress and pillows. Try a weighted blanket. If you live somewhere with bad air quality (or have indoor sources of air pollution), use an air purifier. If your indoor CO2 is too high, open a window at night.
Get blood tests. If you have a magnesium deficiency, take magnesium glycinate. Take vitamin D if you’re deficient (two-thirds of all Americans are deficient, so you should probably just supplement anyways).
CBT-I
CBT-I is basically therapy for insomnia. It sounds kind of fake but it actually works surprisingly well. The key observation is that if you are experiencing really bad insomnia, it’s easy to fall into a feedback loop where trying to get more sleep on the margin actually perpetuates the insomnia; and so to fix insomnia you need to break out of the feedback loop.
One of the core ideas of CBT-I is basically you want to associate being in bed with sleeping. If you spend lots of time lying in bed wide awake, your brain starts to associate lying in bed with being wide awake. This has some obvious implications: don’t lie in bed doing other things like working; if you’re trying to fall asleep and can’t, don’t keep lying in bed, get up and pace around and do something relaxing until you feel sleepy before trying again.
The other core idea of CBT-I is to force your sleep to become more efficient (time asleep divided by time in bed) by only allowing yourself to sleep during some fixed window of time (say, midnight to 9am). No matter when you actually go to bed, or how much time you spend awake, or how tired you are, you cannot go to bed before the window, or sleep in past the window. The typical insomniac night consists of very low efficiency sleep—maybe only 50%. The natural tendency is to compensate by spending more time in bed. But this is bad because it teaches your brain to get used to low efficiency sleep. The CBT-I solution is to make your brain suffer for having low efficiency, by hard-limiting your time in bed.
The officially sanctioned sleep restriction schedule is something like calculate your sleep efficiency, force yourself to only be in bed for as many hours as you’re actually sleeping, and then once your efficiency is really high, the slowly increase the amount of time in bed. So if you’re in bed for 9 hours but only asleep for 6 of them, For safety reasons it’s often recommended never to go below 5.5 hours per night. Personally, I did the simpler thing of just setting a 9 hour window at my ideal sleep time.
CBT-I is really brutal initially. For the first week you get like 3 hours of sleep every night, and since you can’t take naps, you feel like your head is about to implode into a black hole. You’ll desperately want to stay in bed in the mornings. But then eventually you get so sleep deprived that your sleep efficiency starts increasing.
Maybe I was being overly reckless, but I did not find CBT-I therapists or apps to actually be that useful once I understood the basic principles. Nonetheless, you probably still want to check in frequently with a doctor or something to make sure you’re not going insane, and to keep you accountable even while sleep restriction makes you feel absolutely miserable.
Sleep trackers
I love wearable sleep trackers. They generally do a bunch of things, but for insomnia in particular, the best thing is they keep track of how much time you spend actually asleep, making sleep efficiency much easier to track. This is great because you should never be checking the clock in the middle of the night. Doing so can only make you more stressed and less able to go back to sleep.
Another weird thing is it’s actually kind of hard to tell whether you are asleep. You can feel awake when you’re actually asleep, or even have dreams about lying in bed awake (!).
I use an Oura but I don’t have particularly strong opinions on which sleep tracker is the best.
Sleep apnea
A lot of people have undiagnosed sleep apnea. If you snore or are overweight you are at heightened risk, but anyone can have it. The main reason to do a sleep test is they literally will not let you buy a CPAP machine unless you test positive for sleep apnea, because it’s a prescription device. The at-home tests are really straightforward: you order a device from an online provider like Lofta, you wear it overnight to collect data, and then you get a report that tells you if you have sleep apnea.
I’ve heard people say that you need a doctor to set your CPAP settings for you or bad things will happen. Maybe if you set it wrong, your lungs will inflate like a balloon and you will die a painful death. Again, maybe I was being reckless, and again none of this is medical advice whatsoever, but I personally did not find the consultation with the sleep doctor to be very useful. They just told me to put it on APAP mode with a pressure range of something like 5-12. The goal of CPAP is very simple, you want to tune the CPAP parameters to minimize number of events per hour (which, conveniently, the CPAP machine will tell you through their app).
In theory, it shouldn’t be possible for patients to change the settings at all, and only the clinician should be able to change it. So you’re supposed to make an appointment every time you want to change any of the parameters. In my opinion, this is completely deranged. Thankfully, almost all CPAP machines have a secret backdoor mode that gives full control over all of the settings; the directions are readily found on google.
Some people get enormous benefits from CPAPs. Others don’t. I’ve generally heard the recommendation to try it for a few weeks before any verdict.
Sleep drugs
If nothing else is working for you, then you may have to use sleep drugs. Sleep drugs can be kind of terrifying, so I’d recommend trying everything else first. Depending on the exact drug, they can hurt sleep architecture substantially, reducing the quality of your sleep and slowly destroying your brain.
As far as I can tell, the class of sleep drugs that has the best safety/efficacy tradeoff is the relatively new class of dual-orexin antagonists. Orexin makes you alert, so blocking orexin make you sleepy. The flagship drug of this category is dayvigo (lemborexant), though the older drugs quviviq (daridorexant) and belsomra (suvorexant) are also sometimes prescribed. Dayvigo worked perfectly for me for a few months, but then stopped working: while it would still knock me out, I would wake up fully alert only a few hours later. I ultimately stopped using it, but I’ve heard that many people do great on it.
There are several different antidepressants that work as sleep drugs at low doses. Trazodone is frequently used, but it has substantial hangover risk, and also I find it increases congestion. Nonetheless, it very reliably puts me to sleep when nothing else will. Doxepin is a tricyclic antidepressant that helps keep you from waking up in the middle of the night, but doesn’t help you fall asleep at all; I found it to be not super effective. Mirtazepine is an antidepressant and anxiolytic that makes you drowsy and also supposedly increases your appetite. These drugs often have weird dosing curves straight out of some half-baked fantasy novel; for example, the smaller your dosage of mirtazepine, the more drowsy it makes you.
Melatonin is a classic, though it’s probably more effective for shifting your sleep schedule than for making you drowsy. The general recommendation there is to take 0.3mg of it a few hours before your intended bedtime, rather than 30 minutes. Melatonin is available in sublingual (under the tongue) formulations that absorb faster than the oral (swallowed) formulations, though it’s unclear which is better. I don’t generally take melatonin on a regular basis anymore.1 Ramelteon is a melatonin-agonist—that is, it mimics the behavior of melatonin. I’m not sure why it exists; I’ve never tried it.
First generation antihistamines like Benadryl make you drowsy, but because they are anticholinergic, they’re not great for your brain long term—they hurt your memory, and increase your risk of dementia. Hydroxyzine also appears to be similar, though I’ve never tried it myself.
Ambien (zolpidem) is.. well, infamous because if you take it, you might wake up to discover that you somehow spent the night nailing cookies to your table. There are also a bunch of other Z-drugs that I don’t know much about. I’ve never taken any of them.
Clonidine is a non-stimulant ADHD drug that also makes you drowsy. It also has hangover risk, and happens to also reduce your blood pressure. I found the effectiveness to fade pretty quickly though.
Pregabalin is a nerve pain drug that is used off label as an anxiolytic and even more off label as a sleep drug. Unfortunately, it’s kind of addicting and can make you dumber. Gabapentin is an older variant of the same drug.
There are some really weird drugs that I haven’t tried and have no idea whether they work. I heard about gaboxadol recently—apparently it improves sleep quality, but also has a really narrow therapeutic window before it becomes a potent hallucinogen. Nearcyan is a huge shill of ultra-low dosage aripiprazole (like, <1mg), an antipsychotic that supposedly helps set your circadian rhythm very effectively; the existing studies are kind of mixed, but nobody really tests the extremely low dosage regime, so it’s hard to say.
I’ve heard rumors that melatonin degrades rapidly when exposed to air and moisture. I might run an experiment someday to see whether this is true for various popular melatonin formats.






The "associate bed with wakefulness" problem is exactly what I've been trying to solve from a different angle — not by restricting time in bed, but by giving the hyperaroused mind something precise enough to follow until it runs out of momentum. Language rather than silence. Whether it actually works as an intervention I don't know, but the mechanism seems adjacent to what CBT-I is doing.
Given you recommend Eight Sleep, I assume you're a fan. Has it noticeably improved your sleep?