What you're doing
Every browser gives each website a small private store called localStorage. A page can write text into it and read it back later. It has no expiry date, so it's still there after you close the browser. It only holds text, so a list of sessions gets turned into text (JSON) on the way in and back into a list on the way out.
Three limits to know before you rely on it:
- It lives in one browser on one device. Your phone's history and your laptop's are separate.
- A private or incognito window clears it when the last private tab closes.
- It isn't for passwords or anything secret, and it can't share data between people. That needs a server and a database, which comes later in the track.
Steps
Start from a clean save
Terminalcd study-timer git statusGit should say there's nothing to commit. If not, commit what you have first (lesson 3), so you can always get back here.
Plan the change
Start
claude --permission-mode planand ask:Type into Claude CodeWhen a focus round finishes, save it: the date, the time it ended and how many minutes it lasted. Keep only the last ten in the browser's localStorage, newest first, and show them in a list under the timer. Add a "Clear history" button. Also add a test mode, turned on by adding ?test to the address, where a focus round lasts 10 seconds and a break lasts 5. Make a plan first.Check the plan, then build
Look for three things in the plan: where the list is saved, how it's turned into text and back, and what happens when there are already ten entries. Change anything that's unclear, then approve it.
Commit and push
localStorage works most reliably on a real web address, and opening a file straight from your disk can behave differently from browser to browser. So test on your live link:
Type into Claude Codecommit these changes with a descriptive message and push themGive GitHub Pages a minute to update.
Prove it survives a refresh
Open your GitHub Pages link with
?teston the end, likehttps://jordanlee.github.io/study-timer/?test. Let two focus rounds finish. Reload the page. Close the tab, open the link again. The two sessions should still be listed.Look at the stored data yourself
In Chrome, open DevTools (F12 on Windows and Linux, Cmd + Option + I on a Mac), go to Application, expand Local Storage under Storage, and click your site. You'll see the key your timer uses and its value: your sessions, as text. Other browsers have the same thing under a different name.
Check the limit of ten
Still in test mode, let eleven rounds finish. The list should show ten, and the oldest one should be gone. If it shows eleven, tell Claude Code what you saw and have it fix the trimming.
Exercise
Proof of doneMake the study timer remember your last ten sessions, and prove it on your live link.
You're done when
- After a reload, and after closing and reopening the tab, your finished sessions are still listed.
- An eleventh session pushes the oldest one off the list.
- You found your saved sessions in DevTools under Local Storage.
- The change is committed and pushed, and the live link has it.
Sources
Read on October 4, 2026.
- MDN, Window: localStorage: saved across browser sessions with no expiry, cleared at the end of a private session, text only, one store per site, may fail for pages opened from a file.
- MDN, Web Storage API.
- MDN, JSON.stringify: turning a list into text.
- Chrome DevTools, View and edit local storage: Application, Storage, Local Storage; and Open Chrome DevTools for the keyboard shortcuts.
- Choose a permission mode: plan mode.