Streaks track the consecutive number of times a Daily has been completed on schedule, or a Habit has been completed within its counter reset frequency.
Earning and Losing Streaks[]

A Daily with a 12-day streak.
A Daily streak begins with a count of one, after you complete a Daily for the first time, increases by one each time the Daily is completed and resets (to zero) whenever the Daily is not complete when cron runs after a day for which it is scheduled (or if it is not checked off in the Record Yesterday's Activities pop-up). If a Daily is not scheduled on a particular day (or if you were resting in the Inn, before the Inn feature was removed), then you do not lose the streak. However, if you do check off a Daily that is not scheduled for a day (or if you were resting in the Inn), you will still gain gold and experience, as well as increase its streak.
There are certain ways to manipulate the streak mechanic to your advantage, as well. For example, a Mage can cast the skill Chilling Frost, which prevents all incomplete Dailies from losing their streak values for one day. The skill does not prevent damage, however. If you play a Rogue you can cast Stealth to prevent a certain number of incomplete, non-challenge Dailies from losing their streaks and avoid the associated damage from them for the day when the skill is used, but the specific Dailies that are bypassed are chosen at random.

A positive-only Habit with a streak of 5.
Habits can have two streaks: one for positive clicks and one for negative. A Habit that is positive-only or negative only will only have one streak. Each streak behaves the same as Daily streaks. Habit streaks begin at one after you click that side (positive or negative) of it for the first time, increases by one each time its side is clicked, and resets to zero whenever the Habit's counter reset frequency is reached.

A Habit with streaks of +3 and -2
Streaks for all tasks, except challenge and group plan tasks, will be reset to zero if you use the Orb of Rebirth to start over.

Streak bonus notification.
Habitica rewards maintaining Daily streaks (but not Habit streaks) with increases in gold rewards and a greater chance of item drops. For each day the streak has been maintained, you earn an ever-increasing streak bonus equal to 1% of the Daily's value (on top of any normal bonuses from Perception, etc.) and the item drop chance subtotal is increased by 1% (see drops for more information about drop chance).
Streaks for your own personal tasks are not visible to others. However, if you are participating in a challenge that contains Dailies or Habits, your streaks for the challenge's Dailies or Habits are visible to other players when they click on your Display Name in the View Progress Of dropdown at the top of the challenge's page.
Streak Achievement[]

Streak Achievement Notification

The streak achievement badge.
Streak achievements only apply to Dailies. There are currently no achievements for maintaining Habit streaks.
If you complete a Daily 21 times consecutively, you earn a Streak Achievement badge. This achievement can stack; you earn a streak achievement for every multiple of 21 achieved on a Daily, so you'll get another streak achievement at 42 consecutive days, a third at 63, and so on. For every instance you earn the Streak Achievement, your base item drop chance bonus subtotal is permanently increased by 0.5%. You do not lose Streak Achievement badge(s) once you have earned them, even if you delete the Daily, eventually lose the streak, or reset your streak using the Orb of Rebirth.
Adjust Streak[]

Adjusting a Daily's streak under Advanced Settings.
Occasionally, you need to reset or adjust your streak counter. Maybe you rebirthed and found it unmotivating to lose all of your streaks.
Perhaps you had a Daily you did consistently before you started using Habitica. Then adjusting the streak counter could be used to give yourself credit for these pre-Habitica Dailies.
To restore the streak counter, select the appropriate Daily or Habit and click on Advanced Settings. Here, you will find one or two text boxes corresponding to the streaks of that task. Set the number for each streak by either typing in a number or using the up and down arrows, then click Save.
Determining Previous Streaks[]
After a streak counter has been reset to zero, there is no way to find out what the streak used to be. If your streaks are important to you, it is recommended that you regularly save a record of them, for example, by writing them down in a text file.

The Data Display Tool is linked in the Developers section of the footer.
The Data Display Tool gives you an easier way to do that. Access the tool from the Developers section of the footer, select Stats and Streaks Backup after entering your User ID and API Token, and follow the page's instructions.
If you have already lost your streaks without having had a chance yet to record them, you can use the Data Display Tool's history sections to estimate your previous streaks.
For Daily streaks, use the Dailies History section and count the number of blue checkmarks before the first red "X". For Habit streaks, use the Habit History section and count the number of positive and/or negative clicks within the Habit's most recent counter reset frequency. More detailed information can be found at the top of the respective pages on the Data Display Tool.

A Daily's history showing a streak of six