“Hacking” Sleep to Boost Immunity

August 10, 2022 5 min read

“Hacking” Sleep to Boost Immunity – Adapted from Book “The Immunity Code”

Sleep is of fundamental importance for all animals, including humans, and disrupted sleep is emerging as one of the major drivers of accelerated aging over time. During sleep, the body and brain undergo repair and restoration, and this housekeeping is essential for the sustained functions of not only our tissues and immune systems, but also our sense of well-being and cognition. Some of the recognized functions of sleep are: 

  • Facilitates learning and memory consolidation [1]
  • Clears metabolic waste products that accumulate in the brain during waking consciousness [1]
  • Promotes immune cell function [1,2]
  • Accelerates wound healing [3]
  • Supports positive mood and sense of well-being [4] 

Sleep Stages 

Sleep is cyclic, with an oscillation between two states: rapid eye movement (REM) sleep, where dreaming occurs, and non-REM sleep. Non-REM sleep is further divided into deep sleep and light sleep. Each sleep cycle is approximately 90 minutes, and can be broken down into five discrete stages: four non-REM and one REM [5]. As sleep cycles progress through the night, REM stages increase in length. 

Deep sleep is the stage of sleep associated with bolstering immune function and tissue repair. On the other hand, the function of REM sleep is poorly understood but is believed to serve a complementary role in supporting learning, memory, and cognition. Moreover, some researchers hypothesize that deficits in REM sleep can drive weight gain, obesity, depression, and immune dysfunction. 

“Hacking” Sleep to Boost Immunity and Your Overall Health 

In this book “The Immunity Code”, it outlines some of the major benefits of sleep, how many people in our society are unconsciously sabotaging their sleep, and how to optimize sleep to improve health and slow down aging. 

One major disrupter of sleep that is fasting according to the book. In particular, fasting appears to have negative effects on REM sleep. Thus, despite the great press that fasting has gotten over the past few years, it is not a panacea and can actually cause harm in certain cases. 

STEP 1 Stop Fasting 

There are a series of steps we can take to restore “peak human sleep”, the first of which is to stop routinely fasting, especially before sleep. In fact, carbohydrate consumption in the evening actually promotes melatonin production and release. Thus, adding some carbohydrates into your dinner or having a carb-based snack within an hour or two of bedtime can help to reduce sleep latency (i.e. the time it takes to fall asleep) [6]. 

STEP 2 Mimic Our Ancestors 

The next steps to restoring optimal sleep relate to getting back to our roots and modifying our modern sleep routines to more closely mimic those of our ancestors. The modern sleep environment is characterized by: 

  • Staying up an extended period of time after sunset
  • Waking up after the sunrise
  • Snoring and sleep apnea caused by a narrowing of the airways
  • 24/7 temperature-controlled environments
  • Frequent waking during sleep
  • Long sleep latency
  • Insomnia 

In contrast to the modern sleep environment, the ancestral sleep environment (as observed in the Hadza hunter gatherer tribe) is characterized by going to sleep with the sunset and rising with the sunrise. To this end, the second step is to try out the ancestral sleeping schedule: going to bed around 9pm and waking up around 5am. 

STEP 3 Chewy Secret 

Additionally, the ancestral environment involves broad airways that are established through the regular consumption of hard, chewy foods. The mechanical force generated by the jaw during the chewing of hard foods develops the facial bone structure, which facilitates widening of the upper palate and broadening of the nasal airways. These broad airways prevent apnea, allowing the body to be appropriately oxygenated during the sleeping window. Thus, the third step is to incorporate more hard, chewy foods into your diet to help reshape the face and widen the airways. This can be accomplished with raw vegetables, beef jerky or other dried meats, and chewy cuts of meat like skirt or flank steaks. With the guidance of a skilled holistic orthodontist, dental appliances can also be implemented to encourage widening of the upper palate. 

Inflammation and Sleep

Although acute inflammation serves crucial roles in immune function and tissue repair, chronic low-grade inflammation is at the root of virtually every chronic disease, from obesity and diabetes, to Alzheimer’s and autoimmunity. Research suggests that inflammatory markers, namely C-reactive protein (CRP) and IL-6, are positively associated with sleep disturbances, meaning that an inflamed body engages in lower quality sleep. This poor-quality sleep further exacerbates inflammation and immune dysregulation, driving a feed-forward loop that leads to accelerated aging and breakdown of the body and mind. 

To this end, the author outlines his “inflammation spin down” which involves: 

  • Implementing the Two Day Core pattern of eating, outlined in Chapter 25 of The Immunity Code as well as in our previous blog post found here
  • The addition of five modules to insert over the course of four days.

The five modules are: 

  1. Evening pre-bed module

Melatonin, vitamin D, rutin, pterostilbene

  1. Inflammation small molecule module

Fisetin, exogenous ketones, niacin, N-acetyl cysteine, vitamin D

  1. Cold induction module

First thing in the morning: cold water immersion OR walk-in refrigerator OR cold shower

  1. High omega food module

Foods choices include: avocado, salmon, walnuts, cheese, eggs, chia seeds, hemp seeds, flax seeds, edamame, tuna, sardines, cod, mackerel, sea bass, macadamia nuts, hazelnuts, pecans, cottage cheese, olive oil, olives, peanut butter, tofu, pumpkin seeds

  1. Feast module

Consume twice the amount of calories you typically eat on Day 1, the “fiber day”, of the Two Day Core Pattern to stimulate growth and repair 

Using this strategy, the four days are outlined as follows: 

Day 1: “fiber day” (Day 1 as outlined by the Two Day Core Pattern) and the evening pre-bed module 

Day 2 and Day 3: inflammation small molecules, cold induction, high omega food module, evening heat, and evening pre-bed module 

Day 4: Feast module 

For individuals who particularly struggle with getting restful sleep, oleamide and GABA can be added to the list of molecules outlined in the “evening pre-bed” module to further promote deep sleep. 

For individuals struggling with sleep latency, soaking the hands and feet in warm water for a few minutes before bed paradoxically helps the body’s core temperature decrease, which is essential for dropping into sleep. 

Finally, be sure to avoid as much bright light exposure post-sunset as possible, and consider turning off your WiFi at night to avoid potential disruption to sleep caused by electromagnetic frequencies (EMFs). 

Incorporating some or all of these strategies will not only improve the quality of your sleep, but will also set you up for optimal health and a decelerated aging process.



Dr. Alexis Cowan, a Princeton-trained PhD specializing in the metabolic physiology of nutritional and exercise interventions.

Follow Dr. Cowan on Instagram: @dralexisjazmyn 


[1] Yamazaki R, Toda H, Libourel PA, Hayashi Y, Vogt KE, Sakurai T. Evolutionary Origin of Distinct NREM and REM Sleep. Front Psychol. 2020 Dec 14;11:567618. doi: 10.3389/fpsyg.2020.567618. PMID: 33381062; PMCID: PMC7767968. 

[2] Besedovsky L, Lange T, Born J. Sleep and immune function. Pflugers Arch. 2012 Jan;463(1):121-37. doi: 10.1007/s00424-011-1044-0. Epub 2011 Nov 10. PMID: 22071480; PMCID: PMC3256323. 

[3] Mostaghimi L, Obermeyer WH, Ballamudi B, Martinez-Gonzalez D, Benca RM. Effects of sleep deprivation on wound healing. J Sleep Res. 2005 Sep;14(3):213-9. doi: 10.1111/j.1365-2869.2005.00455.x. PMID: 16120095. 

[4] Triantafillou S, Saeb S, Lattie EG, Mohr DC, Kording KP. Relationship Between Sleep Quality and Mood: Ecological Momentary Assessment Study. JMIR Ment Health. 2019 Mar 27;6(3):e12613. doi: 10.2196/12613. PMID: 30916663; PMCID: PMC6456824. 

[5] Patel AK, Reddy V, Araujo JF. Physiology, Sleep Stages. [Updated 2022 Apr 28]. In: StatPearls [Internet]. Treasure Island (FL): StatPearls Publishing; 2022 Jan-. Available from: https://www.ncbi.nlm.nih.gov/books/NBK526132/ 

[6] St-Onge MP, Mikic A, Pietrolungo CE. Effects of Diet on Sleep Quality. Adv Nutr. 2016 Sep 15;7(5):938-49. doi: 10.3945/an.116.012336. PMID: 27633109; PMCID: PMC5015038.

Leave a comment


The Human Milk Oligosaccharide - 2'-Fucosyllactose (2'-FL) Prevents Intestinal Inflammation Cover Image
The Human Milk Oligosaccharide - 2'-Fucosyllactose (2'-FL) Prevents Intestinal Inflammation, Study Finds

July 12, 2024 6 min read

Human milk oligosaccharides (HMOs), particularly the glycan known as 2’-Fucosyllactose (2’-FL), have been a cornerstone in neonatal nutrition, offering the first sweet taste and vital energy while establishing a thriving gut microbiome. Recent studies have expanded the understanding of these substances, with research showing 2’-FL's pivotal role in not only fostering beneficial gut bacteria but also in potentially mitigating adult conditions such as colitis. The Schalich et al. (2024) study further explores this by investigating 2’-FL's ability to modulate gut microbial metabolism, suggesting a promising future for HMOs in adult disease prevention and therapy, particularly for inflammatory bowel diseases like colitis.
Read More
How Akkermansia Survives and Thrives in the Gut?
How Akkermansia Survives and Thrives in the Gut?

June 27, 2024 6 min read

Discover some of the unique mechanisms Akkermansia employs to survive in the human gut and the genetics behind how this fascinating bacterium can maintain cholesterol homeostasis.
Read More
Study Finds Short-Term Cranberry Supplementation Has A Strong Bifidogenic Effect In The Human Gut - Blog Layer Origin
Study Finds Short-Term Cranberry Supplementation Has A Strong Bifidogenic Effect In The Human Gut

June 21, 2024 7 min read

Understand how cranberry extracts could improve the composition of the gut microbiome, increasing the abundance and activities of friendly bacteria and potentially offering a solution to combat the effects of the Western diet.
Read More