What the evidence actually says
The claim that a habit takes 21 days is a misreading. It originated with the plastic surgeon Maxwell Maltz, who observed in 1960 that patients took about 21 days to adjust to a changed appearance — an observation about adaptation, not habit formation, which was repeated until it became received wisdom.
The most cited empirical study, by Phillippa Lally and colleagues in 2009, found a median of 66 days for a behaviour to become automatic, with a range from 18 to 254 days across participants and behaviours. Simple actions such as drinking a glass of water automated quickly; more demanding ones took far longer.
The useful conclusion is that the timescale is long and highly variable, and that expecting automaticity in three weeks sets people up to conclude they have failed at the point where the process is barely underway.
Designing a habit that sticks
Behaviour is easier to change by altering context than by applying willpower. Making a desired action easier — laying out running clothes, keeping a book on the pillow — and an unwanted one harder — removing an app, keeping snacks out of the house — is consistently more effective than intending harder.
Implementation intentions are among the best-supported techniques: specifying when and where in advance, in the form "when situation X arises, I will do Y". The specificity is what does the work, because it removes the moment of deciding. Attaching a new habit to an existing routine uses the same mechanism.
Start smaller than feels worthwhile. A two-minute version performed consistently establishes the pattern, and the pattern is the hard part — scaling up an established habit is comparatively easy, whereas an ambitious version abandoned in week two establishes nothing.
Streaks, lapses and what to track
Streaks are motivating and carry a specific risk: when a long streak breaks, the loss can feel like a reason to abandon the habit entirely, which is disproportionate. The Lally study found that a single missed day had no measurable effect on eventual automaticity — one lapse genuinely does not matter, and the rule that generalises is simply never to miss twice.
Track the behaviour rather than the outcome where you can. Whether you exercised is under your control and observable daily; what you weigh is influenced by many things and fluctuates for reasons unrelated to effort. Tracking things you do not control converts a good week into an apparent failure.
Keep the number of simultaneous habits small — one or two at a time is realistic, and attempting five usually results in none. Records here are stored in your browser's local storage on this device, so nothing is uploaded, and clearing browsing data removes them.