A five-minute tab lifetime is perfect for a search result and terrible for the docs page you check every twenty minutes. Nobody wants to write a rule for every site, so TabTTL learns the lifetimes itself, on the device, with a deliberately boring algorithm.
Record one thing
For each site, TabTTL records how long you were away from a tab before you came back to it. It stores the registrable domain (github.com, whether it was www. or gist.), a duration and a timestamp. The URL, title and content of the page are never stored.
What gets recorded depends on how you come back:
| You… | Recorded |
|---|---|
| come back while it's counting down | time away, minus paused time |
| reopen it after it expired | twice its lifetime: it clearly needed more |
| flip back within 10 seconds | nothing: that's tab-hopping, not returning |
| use a private window | nothing, ever |
Turn it into a lifetime
Keep the last 20 observations from the last 30 days. Once there are at least three:
- Take the 75th percentile: the time within which you came back in three of four cases.
- Add a 25 % margin, so coming back a little later than usual still works.
- Round up to whole minutes and cap the result at four hours.
Example: you came back to github.com after 8, 12, 20 and 4 minutes. Sorted: 4, 8, 12, 20. The 75th percentile is 12; plus 25 % is 15 minutes.
The rule that makes it safe
Learning can only make a lifetime longer. If the learned value is shorter than your default, TabTTL ignores it. So the worst a bad estimate can do is keep a tab around a bit longer, which is exactly what TabTTL did before it learned anything.
Explicit choices still win: a lifetime set for one tab beats a site rule, which beats the learned value, which beats the default. The popup always says which one applies ("18m · learned") and why.
Why not something smarter?
I went with a percentile because it can be explained in one sentence, and that matters when software closes things for you. The settings page shows exactly what was learned, per site, with a button to forget it. You can't do that honestly with a model you can't explain.