The Neuroscience Behind Flow and Fatigue | Generated by AI
Question: As a software engineer, after a full workday and being awake for 11 hours, I find it hard to sleep or stop focusing on the computer. My brain feels tired. I go outside to eat for about an hour, but the symptoms don’t improve much. However, when I come back and start configuring my OpenWrt router, within 10 minutes my brain feels sharp again, and I can work productively for another hour or two. Why does this happen?
Answer:
What you experienced is a well-documented neuroscientific phenomenon with several overlapping explanations. Let’s break it down systematically.
1. What You Were Actually Experiencing: Two Different Types of Fatigue
First, it’s important to understand that what you call “brain tiredness” is likely mental fatigue — not the same as physical tiredness or sleepiness.
Mental fatigue is primarily related to the duration of an activity rather than the nature of the activity itself. Whether you’re writing code, writing a report, or even watching television, the longer the task goes on, the more fatigue sets in. However, fatigue is modulated by motivation and enjoyment — we feel it less intensely when doing something we genuinely like.
A key neurological consequence of mental fatigue is decreased activity in the prefrontal cortex — the brain’s “control tower” involved in working memory and concentration. This causes attentional filtering to deteriorate, making it hard to maintain focus and screen out irrelevant stimuli.
2. Why Going Outside Didn’t Help Much
Your outdoor walk and meal didn’t dramatically relieve fatigue because context switching carries cognitive costs.
When employees divert attention to non-task-related activities, they cognitively disengage from the task at hand — but this diversion is not without cost. There are switching costs associated with moving mentally from one set of activities to another. Depending on the nature of the cognitive shift, these costs can linger over many repeated iterations even of a familiar task.
In short, your brain was still loosely ruminating on unresolved work problems during the walk — it never truly “disengaged.” Food helped blood sugar and physical energy, but the mental fatigue mechanism wasn’t reset.
3. Why the OpenWrt Configuration Woke Your Brain Up
This is the most fascinating part. When you started configuring the router — a novel, challenging, hands-on technical task — you likely entered what neuroscience calls the Flow State. Here’s exactly what happened in your brain:
🔵 Dopamine Surge (The “Sharpness” You Felt)
When reward systems are active, one is less likely to experience negative or inhibiting mood states such as fatigue, hunger, or low expectations. Higher dopaminergic activity coincides with activating cognitive states such as optimism and energy.
Dopamine — through the nucleus accumbens — energizes, increases creativity, and diminishes feelings of fatigue or resistance.
🔵 Norepinephrine Surge (The “Locked In” Feeling)
Flow is also associated with an increase in norepinephrine, a neurotransmitter that enhances attention, vigilance, and cognitive processing. The heightened levels of norepinephrine during flow help to sharpen focus and optimize performance.
Norepinephrine also releases glucose into the bloodstream, giving you more energy, while in the brain it increases arousal, attention, efficiency of neural networks, and emotional control — keeping you locked on target and holding distractions at bay.
🔵 A Cocktail of 5 Neurochemicals
During a flow state, the brain releases five neurochemicals simultaneously: norepinephrine, dopamine, serotonin, anandamide, and endorphins — all of which are performance-enhancing and feel-good chemicals that make you faster, stronger, and quicker both physically and mentally. Flow is the only time the brain produces all five of these simultaneously.
4. Why OpenWrt Specifically — and Not, Say, Netflix?
Flow requires a sweet spot between skill and challenge.
According to flow theory, the flow experience relates to the skill set perceived to be possessed by the individual relative to the perceived challenge of the activity. The discovery of more complex behaviors results in an emergent motivation that transforms a previously unengaging task into one that is intrinsically motivating.
Configuring OpenWrt is:
- Novel enough to trigger dopamine (new problems, unfamiliar settings)
- Within your engineering skill range — not impossibly hard, not trivially easy
- Provides immediate feedback — you can see if a setting works or breaks the network
Watching TV or casual browsing, by contrast, is passive and provides no challenge — so it does not trigger the same neurochemical cascade. This is why rest alone rarely feels as restorative as engaged activity that you enjoy.
5. Why You Could Then Work for 1–2 More Hours
With intermediate tonic activity in the locus coeruleus (the brain’s norepinephrine center), phasic responses are strong to task-relevant stimuli — this is the “exploitation mode”, associated with optimal engagement and performance.
Once you bootstrapped yourself into flow via the router task, your brain’s arousal system was re-activated. This elevated state persisted even when you transitioned back to regular work — because the dopamine and norepinephrine levels take time to subside.
Summary Table
| Factor | What Happened |
|---|---|
| 11 hours of coding | Prefrontal cortex fatigued, attentional filtering broke down |
| Going outside | Mild physical recovery, but no neurochemical reset — cognitive switching cost |
| OpenWrt config | Triggered Flow state — dopamine + norepinephrine + 3 other chemicals released |
| Brain felt “sharp” | Fatigue signals overridden by reward/arousal neurochemicals |
| Worked 1–2 more hours | Neurochemical elevated state persisted after flow activity ended |
Practical Takeaway for You
You have accidentally discovered a personal “flow primer” — a challenging, novel technical hobby that re-engages your dopamine system after cognitive fatigue. This is healthier and more effective than passive rest for mental recovery in the short term. Many engineers report similar experiences: tinkering with hardware, writing side-project code, or gaming in genres that demand real skill all function this way. The key is that the activity must genuinely challenge and interest you — passive scrolling will not replicate the effect.
References:
- Go with the flow: A neuroscientific view on being fully engaged (PMC)
- The Neuroscience of the Flow State: Involvement of the LC-NE System (Frontiers)
- The Neurochemistry of Flow States (troyerstling.com)
- Flow: The Science Behind Deep Focus (BrainFacts.org)
- Mental Fatigue Explained (Merlin Wright Associates)
- Recognizing and limiting mental fatigue through cognitive science (Didask)
- The Microstructure of Work: How Breaks Let You Rest (Harvard Business School)