Sub topic 1
How a habit works: cue, routine, reward
This chapter gives you the working model of a habit that the rest of the tutorial builds on. Later chapters shrink a habit to a minimum version for hard days. To do that well, you need to know which parts of a habit can shrink and which parts must stay fixed.
Prerequisites
This chapter assumes you have:
- A basic idea of what a habit is: a behavior you repeat in a recurring context.
- Some experience trying to keep at least one routine, such as exercise, reading, or writing.
You don't need any background in psychology or programming. A few short code samples appear later. They are optional aids, and you can skip them without losing the argument.
The three parts of the loop
A habit is easiest to reason about as a loop with three parts. This model is often called the habit loop. It comes from research on how the brain automates repeated behavior, and popular books have made it widely known.
- Cue. The trigger that starts the behavior. It can be a time, a place, a preceding action, an emotional state, or the presence of other people.
- Routine. The behavior itself. This is the part most people mean when they say "my habit."
- Reward. The payoff that follows. It tells your brain whether the loop was worth running again.
A concrete example: you pour your morning coffee (cue), you do a 20-minute home workout (routine), and you feel a sense of having started the day well (reward). Repeat this in the same context enough times and the cue begins to pull you toward the routine with little deliberate thought.
The arrow from reward back to cue is the important part. Each completed loop strengthens the association between the cue and the routine. That is why a habit gets easier with repetition. The strengthening happens when the loop runs, which is a point later chapters rely on.
Each part has a job
It helps to separate what each part does, because they fail in different ways.
| Part | Job | Typical failure |
|---|---|---|
| Cue | Starts the behavior without needing a decision | The cue is vague, absent, or changes from day to day |
| Routine | Delivers the behavior you want | The routine is too large or too demanding to start when you are tired |
| Reward | Reinforces the loop | The payoff is delayed, invisible, or missing |
Most advice about habits focuses on motivation. The loop model puts the weight elsewhere. If the cue is reliable and the routine is easy enough to start, motivation matters much less. The behavior begins because the context triggers it, and you aren't talking yourself into it.
Cues
A good cue is specific and observable. "In the morning" is weak because it spans several hours and many situations. "After I pour my morning coffee" is strong because it is a single event you can notice. Cues that follow an existing action are especially reliable, because that action already happens on most days.
A cue also has a context. The same cue in a different place can fail to fire. Someone who writes at their desk every weekday may find the cue disappears when they travel. Later chapters return to this under the idea of keeping the cue and context constant.
Routines
The routine is the behavior you perform once the cue has fired. Two properties matter for this tutorial:
- Size. How much effort and time the routine takes.
- Start cost. How hard it is to begin, apart from how hard it is to finish.
Start cost is often the real obstacle. A 45-minute gym session may be pleasant once you are there, but getting out the door is the hard part. When energy is low, the start cost of a large routine can exceed what you are able to pay that day.
Rewards
The reward is whatever makes the loop worth repeating. It can be built in, such as the relief after a run. It can also be added, such as ticking a box on a tracker or enjoying a coffee afterwards.
Two details are worth knowing:
- Timing. Rewards that arrive soon after the routine reinforce the loop more strongly than rewards that arrive weeks later. The long-term benefits of exercise, such as fitness, are real. They are too slow to act as the reward that holds the loop together day to day.
- Source. A reward doesn't have to be pleasure. A sense of completion, or evidence that you kept a commitment, also counts.
Writing the loop down
Making each part explicit exposes weak spots. Here is a habit written as a small data structure. YAML is used only because it reads clearly.
habit: exercise
cue: "After I pour my morning coffee"
routine: "20-minute home workout"
reward: "Check off the day on my tracker and enjoy the coffee"If you can't fill in one of these fields in a single concrete sentence, that part of the loop is probably the one that fails. For instance, if the cue reads "when I get a chance," the habit has no trigger. It depends on you remembering and deciding each day.
The following Python function does the same check mechanically. It is not something you need to run in real life. It makes the point that a loop with a missing part is incomplete.
def loop_gaps(habit: dict) -> list[str]:
"""Return the names of loop parts that are missing or empty."""
required = ["cue", "routine", "reward"]
return [part for part in required if not habit.get(part, "").strip()]
habit = {
"cue": "After I pour my morning coffee",
"routine": "20-minute home workout",
"reward": "",
}
print(loop_gaps(habit)) # ['reward']Many habits that "don't stick" turn out to be missing one part. People who set a routine and a goal often never choose a cue or a reward.
What makes a habit automatic
Repetition in a stable context gradually shifts a behavior from deliberate to automatic. Early on, you must remember the cue, decide to act, and push through resistance. Later the cue itself prompts the action, and the decision step shrinks or disappears.
Research on habit formation suggests this takes weeks to months, with wide variation between people and behaviors. Simple behaviors, such as drinking a glass of water, tend to become automatic faster than complex ones, such as a long workout. Treat any single "number of days" claim with caution.
Two consequences follow:
- Automaticity is partial and fragile early on. A young habit relies heavily on the cue and on the effort you put in. A disrupted day can break the chain.
- The loop strengthens only when it runs. If the cue fires and you don't perform the routine, you get no reward, and the link isn't reinforced. Repeated skipped loops let the association fade.
Where the loop is vulnerable
Each part can be disrupted, and the disruptions differ.
- Cue disruption. Travel, a changed schedule, illness, or a new job removes the context. The cue never fires.
- Routine disruption. The cue fires, but the routine feels too big. Low energy, a deadline, or poor sleep raises the start cost above what you can pay.
- Reward disruption. The routine happens, but nothing reinforces it. This is slower to notice, because the habit feels like a chore that is never acknowledged.
The second failure is the one this tutorial targets. On a hard day the cue often still fires. You pour the coffee, but the 45-minute session feels impossible. People then skip the routine entirely, the loop doesn't complete, and a pattern of skipped loops starts. The next chapter looks at that pattern in detail.
The model also suggests a design principle that the rest of the tutorial develops. The cue and the reward are cheap to keep. The routine is the part that can flex in size. If you shrink the routine and leave the cue and reward in place, the loop can still run on a bad day. A loop that runs keeps getting reinforced.
Common mistakes in applying the model
- Choosing a cue that isn't an event. "Evenings" or "when I feel motivated" are conditions, not triggers. Pick something you reliably notice.
- Stacking on an unreliable anchor. Attaching a new habit to an action you do only some days gives the habit the same gaps.
- Ignoring the reward. If you only think about the routine, the loop has nothing to reinforce it. Add a small, immediate payoff.
- Treating the habit as a decision each day. A habit depends on the cue doing the work. If you have to decide every time, you are relying on willpower, which varies from day to day.
- Assuming automaticity arrives on a fixed date. Expecting the habit to feel effortless after three weeks sets you up to read a normal effortful stretch as failure.
Summary of the working model
- A habit is a loop of cue, routine, and reward.
- The cue starts the behavior, the routine delivers it, and the reward reinforces the link.
- The loop strengthens only when it runs to completion.
- The cue and reward are cheap and stable. The routine's size is the part that can be adjusted.
- Hard days usually disrupt the routine, not the cue, which is why a smaller routine can keep the loop alive.
Exercise
A reader's habit is "read more." Their plan: they will read for 30 minutes "in the evening, when I feel like it," and they have no planned reward. Using the cue, routine, reward model, name two problems with this plan and propose a fix for each.
Show answer
Problem 1: the cue ("in the evening, when I feel like it") is a vague condition, not a noticeable event, so nothing reliably triggers the behavior. Fix: use a specific event, such as "After I brush my teeth at night, I sit in the chair by the lamp." Problem 2: there is no reward, so the loop has nothing reinforcing it. Fix: add a small immediate payoff, such as marking the day on a tracker or reading with a cup of tea. A further point: a 30-minute routine has a high start cost on a tired evening, which later chapters address by defining a smaller version.
Exercise
On a day when you are very tired, the cue fires but you skip the routine because it feels too big. According to the model, what happens to the loop, and why does it matter over time?
Show answer
The loop doesn't complete, so there is no reward and the cue-routine link isn't reinforced. If skipped loops repeat, the association weakens and the habit becomes less automatic. A single skip matters little, but a pattern of skips erodes the habit.