Sub topic 1
Why habits run on cues: the cue, routine and reward loop
Prerequisites
This chapter assumes you can describe your own daily routine (wake-up, meals, commute, work blocks, bedtime) and have set a personal goal before, such as "exercise more" or "read daily." You don't need any psychology background. You do need to be comfortable reading a short Python snippet. The code only models ideas, and nothing in it needs a library.
By the end you should be able to:
- Name the three parts of the habit loop and say what each one does.
- Explain why a reliable cue makes a behavior easier to repeat than relying on memory or motivation.
- Break any existing habit into cue, routine and reward.
- Say why habit stacking works by borrowing a cue that already exists.
The loop in three parts
A habit is a behavior you repeat in a stable situation until the situation alone starts it. You no longer decide each time. The standard model of this has three parts, popularized by Charles Duhigg and rooted in research on how repeated actions become automatic.
| Part | What it is | Example |
|---|---|---|
| Cue | A signal in your situation that starts the behavior. | The smell of coffee, 3 p.m., a phone notification |
| Routine | The behavior itself: physical, mental or emotional. | Walk to the kitchen and take a biscuit |
| Reward | The outcome that tells your brain the routine was worth repeating. | A sugar hit, a short break, relief from boredom |
The loop is circular. The reward strengthens the link between the cue and the routine, so the next time the cue appears, the routine is more likely to start with less effort.
Why habits run on cues
Early in a new behavior, you decide to do it each time. That takes attention and some willpower, and it fails on tired or busy days. Once a behavior is attached to a stable cue, the cue does the starting for you.
Research on everyday behavior points to a few consequences:
- Repetition in a consistent context builds the cue-to-routine association. The same place, time or preceding action, repeated, matters more than how motivated you feel on any one day.
- Once the association is strong, the behavior starts with less conscious deliberation. Diary studies suggest that a large share of daily actions, often estimated at around 40%, are performed habitually in this way.
- A habit can run even when your current intentions point elsewhere. This is why you sometimes find yourself at the fridge without having decided to go.
The practical point for this tutorial is that the cue is the lever you can design. You can't easily force a reward to feel good, and willpower is unreliable. You can choose which existing signal will start a new behavior.
Cue versus reminder
A reminder asks you to remember and then decide. A cue is something already in your path. A phone alarm that says "stretch" has to compete with whatever you are doing. Finishing a cup of coffee is a signal you meet anyway, and once the link is learned it triggers the next step with less effort. This difference is what habit stacking exploits in later chapters.
Anatomy of the cue
Cues come in several broad kinds. Any of them can start a routine.
- Time. It is 7:30 a.m., or it is Sunday evening.
- Location. You walk into the kitchen or sit at your desk.
- Preceding event. You finish brushing your teeth or close a meeting.
- Other people. A colleague asks "coffee?"
- Internal state. You feel anxious, bored or tired.
Habit stacking mostly uses the third kind, a preceding event, because it is specific and happens in a predictable order. Weak cues are vague ("sometime in the evening") or inconsistent ("when I'm not busy"). A vague cue is hard to notice, so the routine rarely starts.
The next chapters cover how to pick a good cue in detail. For now, you only need to see that cue quality varies and that it predicts whether a behavior repeats.
Rewards: what the brain counts
The reward is whatever makes the routine feel worth repeating. Three things are easy to get wrong:
- Rewards are about perceived value, not your stated goal. Your goal may be fitness. The reward your brain registers after a run might be the shower, a feeling of relief, or nothing at all. If nothing registers, the link does not strengthen.
- Timing matters. A reward that arrives seconds after the routine reinforces it. A reward that arrives months later (weight loss, a promotion) is real but too distant to reinforce a single repetition.
- Rewards can be small. A moment of satisfaction counts. A later chapter covers deliberate celebration.
This is why bad habits are often so sticky. Scrolling a feed gives an immediate reward every time, while a gym session gives its benefits slowly.
A worked example: the afternoon snack
Suppose you want to understand why you reach for a biscuit at 3 p.m. Break it into the three parts by asking one question for each.
- Cue. When does it start? A dip in energy, 3 p.m. on the clock, and being at your desk. You notice it follows a long meeting.
- Routine. What exactly do you do? Stand up, walk to the kitchen, take a biscuit, eat it while checking your phone.
- Reward. What do you get? Sugar, a break from screen work, and a few minutes of distraction.
Now you can see that the reward might not be the biscuit at all. It may be the break. If so, a walk outside could deliver the same reward through a different routine. This is the basic move of habit analysis: keep the cue and reward in view, and look at what the routine is for.
The same breakdown works for habits you want to build. Take "I read in bed every night."
- Cue: getting under the covers.
- Routine: pick up the book and read a page.
- Reward: calm, and a sense of ending the day well.
Modeling the loop in code
This short program records the three parts of a habit and flags anything missing. It also describes the loop in one sentence. It is a thinking aid, not a tracking system.
from dataclasses import dataclass
@dataclass
class HabitLoop:
cue: str
routine: str
reward: str
def missing_parts(self) -> list[str]:
parts = {"cue": self.cue, "routine": self.routine, "reward": self.reward}
return [name for name, value in parts.items() if not value.strip()]
def describe(self) -> str:
missing = self.missing_parts()
if missing:
return f"Incomplete loop, missing: {', '.join(missing)}"
return (
f"When {self.cue}, I {self.routine}, "
f"and I get {self.reward}."
)
loops = [
HabitLoop(
cue="I get back from a long meeting",
routine="walk to the kitchen and eat a biscuit",
reward="a break and a sugar hit",
),
HabitLoop(
cue="I get under the covers",
routine="read one page of a book",
reward="",
),
]
for loop in loops:
print(loop.describe())Running it prints a full sentence for the first loop and Incomplete loop, missing: reward for the second. The second case is common with new habits. You pick a cue and a routine, but nothing in the sequence feels good, so the link never gets stronger. Notice that the program never asks for willpower. The only inputs are the three parts.
Edge cases and common misreadings
The loop is a simplification. These points keep you from over-applying it.
- A cue is not a cause. A cue raises the chance of a behavior. It does not force it. You can learn to notice a cue and choose differently, and this is how people replace habits.
- Cues can be unnoticed. Many habits start from signals you never consciously register, such as a sound or the position of an object. If you cannot name your cue, watch what happens in the minute before the routine.
- One cue can start several routines. Finishing dinner might lead to dishes, a phone check and a snack. Which one wins depends on effort and past rewards. This matters later, when a single anchor has to carry more than one new habit.
- A routine can be mental or emotional. Worrying, rehearsing an argument and planning can all be habit routines, and they respond to the same loop.
- Context changes break habits. A habit tied to a particular place or schedule often weakens when you travel, change jobs or move house, because the cues disappear. This is a failure mode to plan for.
- Strength builds gradually. One repetition does not make a habit. The chapter on habit timelines covers how long this takes.
Where habit stacking fits
The loop gives you three places to intervene:
- Cue. Attach the new behavior to a signal that already occurs reliably.
- Routine. Make the new behavior easy enough to start.
- Reward. Make sure something feels good right after.
Habit stacking mainly targets the first one. You do not invent a new cue and hope you notice it. You borrow an existing routine, such as pouring coffee, and treat the end of it as the signal for the new behavior. Your brain already links that routine to a time and place, so the new behavior inherits a cue that works.
The next chapters add the tools that make a borrowed cue effective: if-then planning, choosing anchors, and shrinking the behavior.
Exercises
Exercise
A person says, "I want to drink more water, so I set a goal of eight glasses a day." They forget most days. Using the habit loop, name two things that are missing or weak, and say which part of the loop each belongs to.
Show answer
There is no specific cue. "Throughout the day" is not a signal they will notice, so nothing starts the routine. There is also no immediate reward. The benefit of hydration is delayed and hard to feel, so nothing reinforces the behavior. A fix would tie drinking to an existing event (the cue) and add a small immediate good feeling (the reward).
Exercise
Break this habit into cue, routine and reward: "Every evening after dinner I open my phone and scroll social media for 40 minutes." Then suggest what the reward might really be, besides "entertainment."
Show answer
Cue: finishing dinner, probably while sitting on the sofa or at the table. Routine: opening the phone and scrolling. Reward: likely a mix of novelty, a break from the day, social connection or avoiding a task. The real reward could be a mental break, which another routine, such as a short walk, might also provide.