The Habit Loop: Cue, Routine, and Reward

· Keel Habit · General education, not medical advice

The short answer

A habit runs on a three-part loop: a cue triggers a routine, which delivers a reward. Over time your brain starts to crave the reward when it senses the cue, which is what makes the loop run on autopilot. Understanding these parts is the key to changing a habit — you keep the cue and reward but swap the routine.

Almost everything you do without thinking runs on the same quiet machinery. Once you can see it, habits stop feeling like mysteries of willpower and start looking like a pattern you can actually work with.

That pattern has a name — the habit loop — and it has just a few moving parts. Learn them once, and you have a lens for understanding any habit you want to build, keep, or break.

3 partsCue, routine and reward — the anatomy of every habit.
+ cravingThe anticipation that powers the loop and makes it run on autopilot.
swap the routineThe golden rule of change: keep the cue and reward, change the middle.

What is the habit loop?

The habit loop is a three-part model of how habits work: a cue triggers a routine, which delivers a reward. It was popularized by journalist Charles Duhigg in his book The Power of Habit, which pulled together decades of behavioral and neuroscience research into one memorable framework (overview; study guide).

The idea is deceptively simple. Your brain is always looking for ways to save effort. When it finds a sequence of actions that reliably produces a good outcome, it files that sequence away and starts running it automatically — freeing up your conscious attention for other things. A habit is just a well-worn loop your brain has decided it no longer needs to supervise.

That automation is a feature, not a bug. It’s why you can drive a familiar route while thinking about something else, or brush your teeth without deciding to. But the same machinery that automates the helpful stuff also automates the reaching-for-your-phone, the late-night snack, the stress cigarette. The loop doesn’t care whether the habit serves you — it only cares that it works.

What are the three parts of a habit?

Every habit breaks down into three components: the cue, the routine, and the reward. Here’s what each one does.

  • The cue is the trigger — the signal that tells your brain to start the loop and which routine to run. Cues almost always fall into one of a handful of categories: a time of day, a location, an emotional state, the presence of other people, or an immediately preceding action. The cue is often invisible to you; you notice the behavior, not what set it off.
  • The routine is the behavior itself — the thing you actually do. It can be physical (lighting a cigarette), mental (a spiral of worry), or emotional. This is the part most people focus on, because it’s the visible one, but on its own it’s the hardest part to change.
  • The reward is the payoff — what your brain gets out of running the routine. Rewards satisfy a craving: the nicotine hit, the sugar rush, the small hit of distraction, the relief from boredom or stress. The reward is what teaches your brain that this particular loop is worth remembering and repeating.

Run those three in sequence enough times and the connection between them hardens. Eventually the cue alone is enough to trigger the craving and the routine, without any conscious decision in between. That’s the moment a behavior becomes a habit.

The fourth element: craving

There’s a piece that sits underneath the three parts and makes the whole thing run — craving. A cue doesn’t just remind you a behavior is possible; it makes you anticipate the reward, and it’s that anticipation that pulls you into the routine.

The neuroscience here is striking. In studies of the brain’s reward system, researchers found that dopamine — often called the “reward chemical” — doesn’t fire mainly when you receive a reward. Once a pattern is learned, the dopamine response shifts backward in time from the reward to the cue that predicts it (Schultz, 2015). In other words, your brain gets its anticipatory jolt the moment it senses the trigger — before you’ve done anything at all.

This is why cravings can feel so involuntary and so urgent. By the time you consciously notice the urge, your brain has already predicted the reward and started nudging you toward the routine. It’s also why the cue is such a powerful lever: change what your brain predicts when it sees a trigger, and you change the pull. We go deeper on this in how dopamine drives cravings.

The habit loop in everyday life: worked examples

Abstract models are easy to nod along to and hard to use. So here are three ordinary habits — one neutral, one you might want to keep, one you might want to change — broken into their parts.

HabitCueRoutineReward (the craving it satisfies)
Morning coffeeWaking up; walking into the kitchenMake and drink a cup of coffeeAlertness and a warm, familiar ritual
Afternoon phone-check3 p.m. slump; a boring or hard taskPick up the phone and scrollA quick hit of novelty and escape from discomfort
Stress vapeA tense email; feeling overwhelmedStep outside and vapeNicotine hit plus a few minutes away from the stressor

Notice what the same structure reveals. The afternoon phone-check isn’t really about the phone — the craving is for relief from a boring task, and the phone is just the routine that happens to deliver it. The stress vape isn’t only about nicotine; part of the reward is the pause, the step outside, the breathing room. Once you see what the reward actually is, you can start looking for other routines that deliver the same thing.

How your brain wires the loop

Why does a loop that starts as a conscious choice end up running on its own? The short version is a process neuroscientists sometimes call chunking: your brain bundles a sequence of actions into a single automated unit. The first few times, you’re paying full attention. With repetition, the brain compresses the whole sequence and hands it off to run in the background — which is exactly why habits are so efficient, and so hard to interrupt once they’re set.

That efficiency has a cost. Because the loop is stored below conscious awareness, you can be halfway through a routine before you notice you started it. And because the cue-craving link keeps getting reinforced every time you complete the loop, well-practiced habits carve deep grooves that don’t disappear just because you decide you’re done with them. That’s the frustrating truth behind why habits are hard to break — the old loop is still physically there, waiting for its cue, even after you stop running it.

The encouraging flip side: the same wiring that built the habit can build a better one. New loops form the same way old ones did — through a cue, a routine, and a reward, repeated until the brain automates them.

How to use the habit loop to change a habit

Here’s where the model earns its keep. The most reliable way to change a habit is to keep the same cue and the same reward, and swap only the routine in the middle. Duhigg calls this the “golden rule” of habit change, and it works because you’re not fighting your brain’s wiring — you’re redirecting it.

Trying to erase a cue is nearly impossible; the trigger is usually baked into your environment or your emotions. Trying to ignore a reward means white-knuckling against a craving your brain is actively generating. But leaving both in place and offering a different routine that satisfies the same craving? That your brain can accept, because the payoff it’s predicting still arrives.

Take the stress vape from the table above. The cue (feeling overwhelmed) and the reward (a calming pause and a break from the stressor) aren’t going anywhere. But the routine can change: step outside and take ten slow breaths, or a short walk, and you still get the pause and the relief — without the nicotine. The first few times it feels deliberate and slightly unnatural. Repeated at the same cue, it starts to automate, just like the original.

A simple sequence for doing this deliberately:

  1. Identify the routine you want to change — the obvious, visible behavior.
  2. Experiment to find the real reward. Ask what craving the routine actually satisfies. Is the afternoon scroll about the phone, or about escaping a hard task? Test different rewards and see which craving actually quiets down.
  3. Isolate the cue. When the urge hits, note the five usual suspects — time, place, emotion, other people, preceding action. A pattern usually emerges within a few days.
  4. Design a new routine that answers the same craving at the same cue, and repeat it until it sticks.

If you want the full walkthrough with more tactics, see how to break a bad habit. And if you’re trying to build good habits rather than break bad ones, one of the most effective tricks is to borrow an existing cue — attaching a new routine to something you already do reliably, which is the idea behind habit stacking.

Map your own loop

The fastest way to make this concrete is to run one of your own habits through it. Fill in the blanks:

  • My cue is: ________________ (What happens right before? Note the time, place, feeling, who’s around, and what you’d just done.)
  • My routine is: ________________ (What do I actually do — the visible behavior?)
  • My reward is: ________________ (What craving does this satisfy? What do I get out of it — a feeling, a hit, an escape?)
  • A new routine that could deliver the same reward is: ________________

You don’t have to get it right on the first try. The reward is often the hardest part to name, and it’s normal to guess wrong at first — that’s exactly why step two is an experiment, not a one-shot answer. Watch a few repetitions, adjust your guesses, and the loop comes into focus.

The takeaway

A habit is not a character flaw or a failure of willpower. It’s a loop — cue, routine, reward, held together by craving — that your brain built to save effort. Seeing the parts is what turns “why do I keep doing this?” into “here’s the cue, here’s the payoff, here’s the routine I can swap.” That shift, from mystery to mechanism, is where change actually starts.

The one thing to remember: keep the cue, keep the reward, change the routine. You can't easily delete a habit — but you can redirect it.

Understanding the loop is step one; running it in real life is where an app like Keel helps. It learns your cues, gives you a ready alternative routine for the moment a craving hits, and shows your progress building over time — so a healthier loop has a chance to take hold. It’s free to start, private, and works across vaping, drinking, sugar, doomscrolling and more.


Sources & method. The cue–routine–reward framework and the “golden rule” of habit change are drawn from Charles Duhigg’s The Power of Habit (overview; study guide). The description of dopamine shifting from the reward to the predictive cue reflects peer-reviewed neuroscience on the brain’s reward-prediction system (Schultz, 2015). This article is general education, not medical advice.

Questions, answered

What is the habit loop?

The habit loop is a simple model of how habits work: a cue triggers a routine, which delivers a reward. It was popularized by journalist Charles Duhigg in his book The Power of Habit, drawing on behavioral and neuroscience research. The loop explains why habits feel automatic — once the pattern is learned, the cue alone is enough to set the whole sequence in motion.

What are the three parts of a habit?

The three parts are the cue (the trigger), the routine (the behavior itself), and the reward (the payoff your brain gets). A fourth element, craving, ties them together — it's the anticipation that pulls you from cue to routine. Every habit, good or bad, can be broken down into these components.

How does the habit loop work?

A cue — a time, place, feeling, or preceding action — signals your brain that a reward is available. That prediction creates a craving, which drives you to run the routine, and the routine delivers the reward. Each successful loop strengthens the link, so the behavior needs less and less conscious thought until it runs on autopilot.

How do I identify my cue, routine and reward?

Start with the routine, since it's the most obvious part — it's the behavior you want to understand. Then work backwards to the reward by asking what craving the behavior actually satisfies, and forward to the cue by noting what was happening right before: the time, place, emotion, other people, or action that preceded it. Watching a few repetitions usually makes the pattern clear.

How do you use the habit loop to change a habit?

The most reliable approach is to keep the same cue and the same reward, but swap the routine in the middle for a healthier behavior that satisfies the same craving. Because the cue and payoff stay intact, your brain doesn't fight the change as hard. This 'golden rule' of habit change is easier than trying to erase a cue or ignore a reward outright.

Habit science with a plan, not willpower

Keel Habit gives you an AI coach, craving SOS tools and a streak that survives slips — private, local-first, free to start.

Habit science with Keel →

Download on the App Store

Free to start. iPhone & iPad. Android coming soon.

Keep reading