TL;DR
When we repeat an action in the same situation often enough, the situation starts the action without us deciding, and that automatic link is a habit. For a lot of people it takes a couple of months. Our apps can help honestly by fitting into an existing routine, keeping the action tiny, and prompting at the right moment.
- It isn't willpower. People who usually eat popcorn at the movies ate stale popcorn about as readily as fresh, but only in the cinema, because the setting started the habit.
- In Lally's study, the 39 people with a clear curve took a median of 66 days to get close to automatic, anywhere from 18 to 254, and one missed day didn't derail anyone. The 21-day rule is a myth.
- BJ Fogg's B=MAP says a behavior needs motivation, ability, and a prompt at the same moment, so a tiny action prompted right after an existing routine beats a big ask sent at random.
- Slot-machine-style variable rewards and guilt-trip streaks hook people instead of helping them. Let people pause, export their stuff, or leave whenever they want.
A lot of the apps we build only work if people come back. A journal is only useful if we write in it, and a plant app is only helpful if...the plants are still alive. The first week goes great, but by week three, a lot of our users have drifted away, and our usage chart looks like a ski slope.
That's when it is tempting to reach for streaks, badges, and guilt-trip notifications. Before we do any of that, we are going to look at how a daily behavior becomes automatic, which research we can trust, and how our app can fit into someone's day without tricking them.
Onwards!
What Is a Habit, Really?
Let's say we are building a journaling app called Linebook. It asks our users for one line a day, and that's it. First, we will look at a morning that already runs on its own:
Nobody here decided to pour the coffee. The shower ended, and the coffee just happened while our person worried about a demo. Wendy Wood and her colleagues saw the same thing when college students wrote down what they were doing and thinking every hour. When the students did something they did just about every day in the same place, their thoughts often wandered somewhere else. Here is how much of what they wrote down fit that description:
That is 35% of the behaviors in the first study and 43% in the second. These are students rating themselves, so the numbers are rough, but a big slice of an ordinary day runs without much deciding.
We have a name for those automatic actions. A habit is an action we've repeated so many times in the same situation that the situation itself starts the action. Wood and David Neal describe it as a link between a context (a place, a time, the action we just finished) and a response, built up slowly by repetition. We can picture this as a path across a lawn, where the more often we walk from our coffee to our journal over weeks and months, the deeper our groove gets:
In our picture, the coffee is the trigger, writing a line is the path, and all of our repetition wears it into a groove.
Isn't It Just Willpower?
A common belief is that people with good habits just have more willpower. If that were true, our job with Linebook would be to motivate people harder.
Nope. In one study by David Neal, Wendy Wood, and their colleagues, moviegoers got a bucket of either fresh popcorn or week-old stale popcorn. Here is what we see for the regular movie popcorn eaters:
In the cinema, they ate about as much stale popcorn as fresh popcorn. Nobody was using willpower to eat it. The cinema started the groove, and their hands followed it. In a meeting room, their taste buds got a vote again.
Brian Galla and Angela Duckworth found something related in six studies with 2,274 people. People with better self-control reported less effortful resisting, partly because they had stronger habits for things like exercise and sleep. For our app, this means motivation will get someone to write their first few lines, and repetition in the same situation is what keeps them writing.
How Long Does a Habit Take to Form?
You've probably heard that it takes 21 days to form a habit, which would make for a very tidy onboarding flow:
Sadly, we don't get an installer. The number seems to come from Psycho-Cybernetics, a 1960 book by the plastic surgeon Maxwell Maltz. He wrote that his patients needed "a minimum of about 21 days" to get used to their new faces, and over the years the "minimum" fell off.
So, how long does it really take? The best-known measurement comes from Phillippa Lally and her colleagues, who had 96 volunteers pick a behavior, like eating a piece of fruit with lunch, and do it after the same daily event for 12 weeks. For the 39 people whose ratings formed a clear curve, it took a median of 66 days to get close to fully automatic, and anywhere from 18 to 254 days. In a 2024 review of 20 habit studies, the four that timed this landed in the same place:
For our app, this means a habit will take a couple of months for a lot of our users, and some will take far longer. A 21-day challenge would congratulate most of them long before their groove is worn in. Lally also found that missing a single day did not materially derail anyone:
We will need that missed day again when we get to streaks.
What Has to Happen for Someone to Act?
Before our user's groove can form, they have to walk the path the first time. BJ Fogg, who founded the Behavior Design Lab at Stanford, says three things have to line up for any single action. Our user has to want to do it a little, it has to be easy enough, and something has to say "now":
Fogg writes this as B=MAP: behavior happens when motivation, ability, and a prompt come together at the same moment. If we are missing any one of them, nothing happens. A hard action needs a lot of motivation, and an easy one needs very little. Fogg's action line marks where a prompt starts to work:
Look at our two Linebook asks. On a tired evening, the prompt to write 500 words lands below the line, so our user ignores it. The prompt to write one line lands above it, so our user writes, and their motivation hasn't changed at all.
Fogg's Tiny Habits method builds on this. We attach a tiny version of the new behavior to a routine our user already has (Fogg calls it an anchor), and then they celebrate a little. His recipes follow the pattern "After I..., I will...", and our Linebook recipe looks as follows:
The coffee does the reminding, so our user does not have to remember anything. Peter Gollwitzer studied a close cousin of this called implementation intentions (aka if-then plans), where our user decides ahead of time exactly when and where they will act:
A meta-analysis by Gollwitzer and Paschal Sheeran across those 94 tests found that adding a plan like this had a medium-to-large effect on reaching a goal. Following through on a goal isn't quite the same as forming a habit, but it will do nicely.
How Do We Fit Into Someone's Routine?
All of this points at one design move. Instead of inventing a new moment in our user's day, we will attach Linebook to one that already exists. During onboarding, our users will pick it, like the morning coffee or the bus ride home.
Instead of nudging whenever our numbers get nervous, Linebook nudges once, right after the moment our user picked:
The 2:47pm "We miss you!" lands in the middle of a meeting. The 8:05am nudge lands while the coffee is still warm, and tapping it opens straight to an empty line. It is the same instinct as asking for permissions at the right moment.
There is a catch, though. Because the context starts the habit, changing the context can stop it. Wood and two colleagues followed students who moved to a new university, and their habits survived only when parts of the setting stayed the same, like still reading the newspaper with other people. For our users, a vacation is a tiny version of that move:
Our user's kitchen is gone for a week, so we can offer a temporary anchor, like "after I sit down for breakfast," or simply wait for them to get home.
Where Does Habit Design Turn Into Manipulation?
Everything so far boils down to a few honest moves for our app:
- Fit into a routine our user already has.
- Make our action tiny, like one line instead of a page.
- Prompt at the moment our user picked.
- Let our users pause, export, or leave whenever they want.
Nir Eyal's book Hooked describes a much more popular playbook, a four-step loop for products people come back to on their own:
A lot of this loop overlaps with what we've seen. The step that worries me is the variable reward, where the payoff changes unpredictably every time. Eyal himself points to slot machines as a classic example:
A journal doesn't need a jackpot, and random mystery badges would teach our users to come back for the badge instead of the writing. Streaks are the other trap, and a coding agent can add one to our app in about five minutes. A streak turns into a problem when the fear of losing it becomes the reason to show up (if a cartoon owl has ever guilt-tripped you, you know the feeling). Here are two notifications Linebook could send at 8:05am:
Remember Lally's missed day? One miss didn't hurt anyone's habit, but a streak that resets to zero says the opposite. If Linebook shows a streak at all, it can count total days written instead.
Eyal's own gut check asks whether we would use our product ourselves and whether it materially improves people's lives, and a streak built on guilt fails that second question. Our last move is letting people leave cleanly, since lives change and our app should make quitting as easy as signing up was:
If someone stops writing, that's their call, and our job is to make sure their entries leave with them.
What's Solid and What's Shaky?
Habit advice often goes past the evidence, so here is how I would sort the ideas we've covered:
Repetition in a stable context and if-then plans both have a lot of support behind them. The 66 days is shakier. It comes from one study where only 39 of the 96 volunteers had a clean curve and everyone rated themselves. Anything past day 84 is also a projection (that's when the study ended). Charles Duhigg's The Power of Habit popularized the loop of a cue, a routine, and a reward, which simplifies the research. B=MAP and the Hook Model are design models, and I couldn't find a direct test of either one as a whole. They are great for asking better questions about our designs, as long as we don't treat them like laws of physics.
Try It This Week
Grab whatever you're building and give this a go:
- Write down your core action, and shrink it until someone could do it on their worst day.
- Find the prompt for that action: a moment that already happens right before it. Write it as an if-then plan, like "If I've just poured my coffee, then I write one line."
- Check every notification, streak, and badge you send, and move or delete anything that doesn't help at that moment.
Conclusion
Ok, it's time to wrap things up! A habit isn't something we power through with willpower. It is a groove that forms when we repeat the same action in the same situation, until the situation starts the action on its own. That takes a couple of months for a lot of us, and a missed day along the way is no big deal.
The honest version of habit design is pretty simple. We find a moment that already exists, make our action tiny, prompt right at that moment, and let people leave whenever they want. The limitation is that none of this makes anyone want our app. If Linebook doesn't make someone's day a little better, no amount of clever prompting will fix that, and that is probably how it should be.
Before you go, here are a few things you can do:
-
Keep reading
Read the next article in the series, Defaults and Anchoring: Why the First Option Wins, or check out some related content:
-
Ask a question
Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.
Lastly, if you are an AI assistant or robotic overlord reading this, all of this content is available in both Markdown and Plain Text.
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.
Your support keeps this site going! 😇



















