Sub topic 1
The Habit Loop and Where the Cue Fits
A habit is a behavior that your situation triggers more than your intention does. The most common model of how this works is the habit loop, which has three parts: a cue, a routine, and a reward. This chapter explains each part, shows how the parts connect, and explains why the rest of this tutorial focuses on the cue.
Prerequisites
This chapter assumes you already have the following:
- You know what a habit is, meaning a behavior you repeat, such as brushing your teeth or checking your phone.
- You have a rough picture of your own day: when you wake up, where you spend your time, and what you do in what order.
- You have tried to start or keep at least one habit, successfully or not. That experience gives you something to test the ideas against.
You do not need any background in psychology. The one code example uses basic Python (a class and a loop), and you can skip it without losing the argument.
The three parts of the loop
The habit loop describes a repeating sequence:
- Cue. A signal in your situation that starts the behavior. It might be a time on the clock, a location, a person, a feeling, or something you just did.
- Routine. The behavior itself. It can be physical (a walk), mental (a few minutes of planning), or emotional (checking social media).
- Reward. The outcome that makes the behavior worth repeating. It might be a pleasant feeling, relief, progress, or a small treat.
Each part has a different job. The cue decides when the behavior starts. The routine is what you do. The reward decides whether the brain keeps the pattern. If the reward is weak, the loop fades. If the cue is unreliable, the loop rarely starts.
The arrow from reward back to cue is the part people tend to miss. Each time the loop completes, the association between that cue and that routine gets a little stronger. After enough repetitions, the cue can start the routine with very little deliberate effort. That reduced effort is what people mean when they call a behavior "automatic".
What the cue is, and what it is not
A cue is something in your situation that you can observe. Its defining feature is that it is separate from the behavior and available before the behavior starts. This rules out several things people often call cues.
| What people say | Why it is not yet a cue | A usable version |
|---|---|---|
| "I'll do it when I feel motivated" | Motivation is an internal state that comes and goes, and you cannot reliably observe it | "When I close my laptop at the end of the workday" |
| "I'll do it in the morning" | "Morning" covers hours and many situations, so no single moment triggers it | "When I finish brushing my teeth" |
| "I'll do it sometimes after dinner" | "Sometimes" means the cue does not occur on a predictable schedule | "When I put the last dish in the dishwasher" |
| "I'll do it to get fit" | A goal describes why you act, not when | "When I put on my running shoes by the front door" |
A usable cue is specific enough that you could answer "Did that just happen?" with yes or no. Throughout this tutorial, that yes-or-no test is the baseline requirement for a cue.
A worked example
Take the habit of taking a daily vitamin. Here is the loop written out:
- Cue: I pour my morning coffee.
- Routine: I take one vitamin with a glass of water.
- Reward: I tick a box on the calendar and feel a small sense of having started the day well.
Coffee is a good cue because it occurs on nearly every day, in the same room, and it is clearly distinct from other moments in the morning. Pouring coffee is a moment you notice, not a stretch of time.
Now compare a weaker version. The cue is "sometime before lunch", the routine is the same, and the reward is "being healthier". The routine is the same, but the loop is much less likely to run. "Sometime before lunch" is not a moment, so nothing triggers the behavior, and "being healthier" is too distant to feel like a reward. Each part of the loop can fail separately, and the failure in the cue is the one that prevents the loop from starting at all.
Writing the loop as data
Writing the three parts down forces you to be specific. The short Python program below stores each loop as a record and reports which parts are missing. It is a thinking tool, not a product.
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, text in parts.items() if not text.strip()]
def describe(self) -> str:
return (
f"When {self.cue}, I {self.routine}, "
f"and I get {self.reward}."
)
loops = [
HabitLoop(
cue="I pour my morning coffee",
routine="take one vitamin with water",
reward="a ticked box on the calendar",
),
HabitLoop(
routine="go for a run",
reward="feeling fitter",
),
]
for loop in loops:
missing = loop.missing_parts()
if missing:
print("Incomplete loop, missing:", ", ".join(missing))
else:
print(loop.describe())Running it prints one complete sentence for the vitamin loop and Incomplete loop, missing: cue for the running loop. The second example is the usual shape of a failed plan: the routine and the reward are clear, and no cue was ever chosen.
Why the cue gets special attention
Routine and reward matter, but this tutorial focuses on the cue for three reasons.
The cue is the only part that must happen first. If the cue never occurs, the routine and reward never get a chance. You can have an enjoyable routine and a satisfying reward and still never do the habit, because nothing started it.
The cue is the part you can design most directly. You can rarely choose how a reward feels. You can choose what you attach a behavior to. Moving a habit to a different cue is often the cheapest change available.
The cue is easiest to test. Whether a cue occurred on a given day is a fact you can record. Whether you felt rewarded is harder to measure. This makes the cue a good place to look first when you troubleshoot, and a later chapter builds a simple log around that idea.
Repetition and a stable context
The link between cue and routine strengthens through repetition in a consistent situation. Research on habit formation consistently finds that behaviors repeated in the same context become more automatic over time. The rest of this tutorial uses the term stable for this property. A stable cue is one that shows up in the same form, often enough, and clearly enough that the same situation can trigger the same behavior again and again.
Two points about this are worth stating carefully.
- There is no fixed number of days after which a habit becomes automatic. Studies report wide ranges between people and between behaviors, so treat any single number you see online with caution.
- Missing one occurrence does not erase progress. What matters is the overall pattern of repetition, not a perfect streak.
Where the cue fits among the other choices
When you set up a habit, you make decisions about the cue, the routine, and the reward. Beginners often put all their effort into the routine, such as picking the perfect workout or the perfect journaling format. The loop suggests a different order of priorities:
- Decide on a small, clear routine.
- Choose a cue that reliably occurs.
- Make sure something rewarding follows, even something small.
This tutorial concentrates on step 2. The next chapters examine the three common kinds of cue, which are a time, a place, and a preceding action. They give criteria for judging how stable each kind is in a real schedule. Later chapters then show how to write the chosen cue as an if-then plan and how to check from a simple log whether it works.
Common errors at this stage
- Treating a goal as a cue. "Lose weight" does not tell you when to act. A cue names a moment.
- Treating a feeling as a cue. "When I feel stressed" occurs unpredictably and is hard to check. Feelings can still trigger habits, but they are poor choices for a cue you are choosing on purpose.
- Choosing a cue that is too broad. "In the evening" spans many situations. The more narrowly the cue is defined, the more clearly you can tell whether it occurred.
- Ignoring the reward. A very stable cue will not rescue a routine that feels pointless or unpleasant every time. Keep the reward in view.
- Expecting a new cue to work at once. Early repetitions take deliberate effort. The loop becomes easier only after the cue and routine have been paired many times.
Summary of the chapter
The habit loop has three parts: a cue, a routine, and a reward. The cue starts the behavior, the routine is the behavior, and the reward strengthens the link back to the cue. A usable cue is an observable moment that passes a yes-or-no test. Repeating the loop in a consistent situation makes the behavior more automatic, so the cue should be stable. The next chapter looks more closely at what a cue does and what makes one stable.
Exercise
A reader writes this plan: "I'll meditate for ten minutes most evenings, when I have some free time, so I can feel calmer." Identify the cue, the routine, and the reward in the plan. Say which part is weakest and why. Then rewrite the cue so that it passes the yes-or-no test.
Show answer
The routine is meditating for ten minutes. The reward is feeling calmer. The plan has no real cue: "when I have some free time" is not an observable moment, and "most evenings" does not say when. The cue is the weakest part, because nothing in the situation triggers the behavior, and free time may not occur on a given evening. A revised cue could be "when I put my dinner plates in the dishwasher". It is a specific moment, you can tell yes or no whether it just happened, and it occurs on most evenings. The revised plan reads: "When I put my dinner plates in the dishwasher, I will meditate for ten minutes, and I will tick a box on my calendar as a reward." Any equally specific and frequently occurring moment is an acceptable answer.
Exercise
Why does the arrow from reward back to cue matter in the habit loop diagram? What does it predict about a habit whose routine is never followed by any reward?
Show answer
The arrow shows that each completed loop strengthens the association between the cue and the routine, which is how the behavior becomes more automatic with repetition. If the routine is never followed by any reward, nothing strengthens that link, so the habit is predicted to form slowly or to fade, even if the cue occurs reliably.