A Small Tool for Tracking Attention
A Small Tool for Tracking Attention
Most time-tracking tools want you to categorize your day into buckets before you've even decided what the day is for. I wanted something dumber: a single function that logs a timestamp and a label, and a query that turns those timestamps into a rough shape of a week.
The whole tool
function logAttention(label) {
const entries = JSON.parse(localStorage.getItem("attention") || "[]");
entries.push({ label, at: Date.now() });
localStorage.setItem("attention", JSON.stringify(entries));
}
function summarize(entries) {
const byLabel = {};
for (const { label } of entries) {
byLabel[label] = (byLabel[label] || 0) + 1;
}
return byLabel;
}
That's it. No dashboard, no server, no account. I run logAttention("writing") from the browser console when I sit down to write, and once a week I glance at summarize() in the same console. The friction of typing it by hand is the feature -- it keeps the tool from becoming another thing to maintain.
Why this instead of an app
Every tracking app I've tried outlives its usefulness the moment the UI becomes the thing I'm managing. A function I can read in ten seconds has no UI to manage. It just tells the truth about where the week went.