How to build a daily streak people can trust
A flame is the easy part. Decide what a day means, what counts, and who fixes the day your servers went down.
9 minutes read
On this page
The short answer
Build a daily streak from verified completions assigned to a clearly defined calendar day. Count each eligible day once, keep enough history to explain the result, and choose a policy for travel, late events, outages and missed days before launch. A rolling twenty-four-hour timer is a different promise.
- Count a useful completion, not an app open or a timer left running.
- Choose a project calendar or a user calendar explicitly; they serve different products.
- Preserve action identities and eligible-day history so retries cannot inflate progress.
- Treat freezes, repairs and outages as product rules with auditable consequences.
Three interactive streak cases show midnight, the repeated hour when daylight saving time ends, and a retried lesson.
Illustrative calendar · America/New_York
A day is not always 24 hours.
In America/New_York, these completions belong to consecutive calendar dates. A UTC-date counter would put them on the same date. Decide and document whose calendar the program follows.
Decide whether the behavior should be daily
A streak makes a particular promise: doing this again tomorrow matters. That is sensible for language practice or a small daily exercise. It is a strange promise for filing an expense report, renewing insurance or checking a quarterly forecast. Before choosing a flame icon, ask whether a user who gets the full value of your product would naturally use it on consecutive days. If the answer is no, show a useful history or a weekly goal instead.
Then define the smallest completion that still delivers value. For a learning app, opening a lesson is not the same as finishing one. For a writing app, typing a character and deleting it should not count as meaningful work merely because it is easy to measure. Your event should describe the result you want the product to help people achieve. If you reward a proxy, people may learn the proxy.
Keep the daily threshold understandable. A person should know what to do without opening a rules page every morning. If different activities count, say so in the interface and explain partial progress. Keep the accomplishment separate from the reward attached to it. A lesson remains completed even if a bonus rule is paused, and a failed reward delivery should not erase the learning history.
Choose what a day means
There are two common promises. A shared project calendar says everyone's day ends at the same project midnight. That can fit a venue, a scheduled community or a competition that deliberately uses one clock. A personal calendar says the day ends at the person's local midnight. That is often easier to understand for an individual daily practice. Neither choice is universally correct, but silently switching between them is a bug.
A rolling timer is another model entirely. Twenty-four hours since the previous completion does not mean consecutive calendar days. Someone can finish a lesson just before midnight, then another just after midnight, and satisfy two dates in very little elapsed time. If your promise is daily practice, that may be acceptable. If you require a minimum spacing between sessions, write that additional condition explicitly instead of hiding it inside the word daily.
A completed date, a missed date and a protected date have different meanings in the example streak history.
Illustrative product design
Keep the gap visible, even when you protect the run.
- COMPLETED DATEPractice happened
The verified completion belongs to a particular calendar day.
- MISSED DATENo completion
A gap remains in the practice history. It does not become a fabricated lesson.
- PROTECTED DATEA policy covered it
If supported, a freeze or repair has its own reason and reward consequences.
Example semantics to decide before launch. Lurk's current Streak starter does not install freeze or repair behavior.
Store the actual completion instant and the time zone used to interpret it. A fixed offset such as UTC minus five is not a full time-zone policy. Named zones carry daylight-saving rules. The Temporal time-zone guide explains why exact instants and wall-clock times differ, including ambiguous and missing local times. Use a maintained date-time implementation; do not calculate tomorrow by blindly adding a fixed number of seconds to local midnight.
Travel adds a product decision, not just a library call. If the user changes their zone after completing a day, does that reinterpret old history or affect future days only? Could repeated zone changes earn extra days? A defensible starting policy is to preserve the day assigned to past completions and apply a controlled change to future eligibility. The exact policy can differ. What matters is that it is written, visible and testable.
Keep the facts that explain the number
A single integer is a poor source of truth for a streak. It tells you the result but cannot explain how you got there. Keep the verified action identity, the completion instant, the eligible date, the calendar policy, and any later correction. From eligible dates you can derive the consecutive run. The interface may cache the current count, but support needs a history that can distinguish a missing event from a correctly rejected duplicate.
For a lesson, use the server's durable completion record as the underlying fact. If a mobile client uploads offline work, decide how the server establishes that the work happened and which timestamp it trusts. An arbitrary client-supplied date can become a way to rewrite history. A strict server-arrival policy is simpler, but can punish honest offline use. Choose deliberately and describe the tradeoff to the person using the app.
| Fact to retain | Question it answers |
|---|---|
| Stable completion identity | Have we already counted this actual lesson? |
| Verified completion instant | When did the trusted system say it happened? |
| Eligible date and calendar | Which day did our published policy count? |
| Policy version | Which rules applied when it counted? |
| Correction linked to the original | Why does today's history differ from the first decision? |
Separate a duplicate action from another valid action on the same date. A retry should resolve to the original decision. A second completed lesson may deserve its ordinary lesson reward while leaving the streak day unchanged. If you put all deduplication at the user-and-date level, you can accidentally suppress legitimate work. If you put none there, several completions can masquerade as several days.
Also separate the visible streak from the bonus schedule. Imagine a bonus every seventh eligible day. Two concurrent completions must not both claim that milestone. The operation that recognizes the milestone and records its award needs a consistent boundary. After a correction, specify whether an already-used bonus is reversed, left alone or reviewed. A design that only handles an increasing counter has not answered those questions.
Define freezes, repairs and outages separately
A freeze covers an eligible gap under a rule the person could understand in advance. A repair changes a streak after a gap. Outage protection addresses a failure the service caused. These mechanisms may lead to a similar number on screen, but they have different reasons and permissions. Keep those reasons in the history so a support operator can explain what happened without inventing a story.
Duolingo reported that result when it expanded freeze capacity. It is a useful example of testing flexibility, not a forecast for another product. Do not treat an association between long streaks and committed learners as causal evidence, and do not import someone else's effect size into your revenue model. Your daily task, audience and failure costs are different.
For a freeze, decide when it must be available, when it is consumed, whether it covers a whole date, and whether using it earns the same bonus as actual practice. A reasonable policy may preserve the run without pretending a lesson happened. Tell the person that distinction. A blank date with a freeze marker is more honest than a fabricated completion.
For an outage, decide how you identify affected people and the unavailable interval. Duolingo has described protecting streaks during site issues, which illustrates why service failures deserve explicit treatment. Your implementation still needs its own policy and evidence. A repair should record who approved it, which dates changed, and whether rewards changed too. Never make an unexplained direct edit the normal support procedure.
Test the calendar cases before the animation
Add a late-arrival example that crosses a reward milestone. Suppose a verified completion from yesterday arrives after today's work has already been processed. Will the historical run be recomputed? Will a previously missed bonus become due? Could a later correction remove eligibility for something the person has already used? There is no single correct policy for every product, but the consequences must agree. Letting the display silently recompute while the reward ledger follows a different history creates a support problem that no animation can explain.
Consider the ordinary no-event case as well. A streak may appear current immediately after yesterday's completion, still be alive during today's eligible window, and become broken only when that window closes. If your implementation updates the counter only when another event arrives, the read path still needs to represent the current state accurately. The label might say completed yesterday, today still open, or missed yesterday. A raw stored number does not tell the user which situation applies.
Before release, rehearse one support conversation from beginning to end. A person says they practiced before midnight but lost their streak. The operator should be able to find the verified completion, see which calendar assigned its date, identify a delayed delivery or rejected duplicate, and explain the published policy. If a correction is justified, the operator should use a constrained action with a recorded reason. The person should then see a coherent result without needing to reinstall the app or argue about a screenshot.
Treat the exit from a streak as part of the interface too. Keep the best run, total useful work or history available if those measures help the user. Invite a fresh start without presenting a missed day as a moral failure. Measure whether people return after a break as well as whether they protect an existing run. A mechanism that increases short-term checking but makes a missed day feel unrecoverable may be solving the wrong problem.
Write a compact set of examples that everyone can read. Include one ordinary consecutive day, a repeated request, two different completions on one day, a gap, the daylight-saving transition, and a time-zone change. Add offline or late delivery if the product supports it. For each example, specify the eligible dates, the visible count and the rewards. These are three outputs, not one.
Cross midnight
Use two verified instants on opposite sides of the chosen calendar boundary. Confirm they count as separate days under a calendar-day policy, even if they are close together.
Repeat the clock hour
Use both instances of the repeated autumn hour in a zone with daylight saving. They are distinct instants, but the same local date should not earn a second streak day.
Race the milestone
Submit concurrent eligible completions and inspect the final day history and milestone receipt. A successful response alone does not establish that only one bonus was awarded.
Repair a real gap
Apply the proposed support policy in a test environment. Confirm that the corrected display, retained history and reward consequences all agree.
Show the result in the interface as well as the test runner. Let someone see a completion arrive late, refresh during a retry, and open the app after midnight. The screen should explain pending work and the next eligible date without inventing certainty. A server that counted correctly can still feel broken if the client shows yesterday's cached number with no explanation.
A timeline contrasts daily practice with weekly, monthly and less frequent useful returns.
Choose an implementation that matches the promise
You can build a narrow streak yourself if you are prepared to own the calendar, identity, correction and support behavior. You can also buy a service that already models the behavior you need. Compare those responsibilities directly. Our build-or-buy guide gives you an operational pilot; the Trophy comparison examines a product with documented personal-time-zone streaks and freeze behavior.
Lurk's current Streak starter uses a project time zone. It creates a draft setup for a qualifying daily event and a target reward. It does not currently install a personal-calendar freeze or repair system. The Streak recipe is a useful starting point when the project-calendar promise fits; the presence of a freeze design in the broader gallery is not evidence that the feature is ready.
Illustrative daily completionDraft
Whena trusted qualifying event arrivesLimitonce per day in the chosen calendarDocount one day of progress
Treat that sentence as a specification to verify, not a shortcut around the edge cases. Have an agent inspect the current operations, draft only the supported behavior, and call out any essential gap before a person approves it. Keep the user's useful achievement visible even when a streak ends. The product should help someone return after a bad day, not make their previous work feel as though it disappeared.
Plan it with your agent
Paste this to your coding agent. It reads this post and checks what is supported in your project, using these recipes as references. Nothing goes live until you say yes.
- Claude Code
- Cursor
- Codex
- Grok
- Grok Build
- Meta Muse
- Dots
- OpenClaw
- Hermes Agent
Questions people ask
Should a daily streak use UTC or the user's time zone?
Use the calendar that matches the promise. A personal daily practice often needs the user's local calendar; a shared event may deliberately use one project calendar. Explain the boundary and test time-zone changes.
Is a daily streak the same as a twenty-four-hour timer?
No. Consecutive calendar days can be only minutes apart across midnight, while a rolling timer measures elapsed time. Choose the behavior explicitly and avoid mixing the two.
How do I prevent duplicate streak rewards?
Keep a stable identity for each verified action and count an eligible date once. Make milestone recognition and award recording consistent under retries and concurrent requests.
Should a freeze count as completed practice?
That is a product policy, but preserving a run does not require inventing a completion. Show covered gaps separately and specify whether they count toward reward milestones.
What happens if my app is down at midnight?
Define an outage policy before launch, retain evidence of the affected interval and record any corrections. Support should be able to explain which dates changed and whether rewards changed.
Does Lurk support freezes and repairs today?
The current Streak starter uses the project calendar and does not install freeze or repair behavior. Review the supported starter and any additional requirements before choosing it for a personal daily habit.
Sources
More posts to read
Bring them back
Should you build your own rewards API?
The balance is easy. The second request, the refund and the support ticket are where the decision lives.
Bring them back
Get trial users to a second useful session
The welcome email is rarely the whole problem. Find the unfinished job, then make the return worth it.