{"slug": "show-hn-prompt-to-vibe-code-a-zero-dependency-offline-study-timer", "title": "Show HN: Prompt to vibe-code a zero-dependency offline study timer", "summary": "Affan, founder of Threshyr, published a Show HN guide for building a zero-dependency offline study timer as a single index.html file using Claude Code, Codex, or Cursor. The guide supplies a copy-paste prompt specifying courses, a start/stop timer, tasks, a timesheet, daily and weekly totals, and CSV export, with all data stored in localStorage under one JSON key and durations calculated from Date.now() timestamps rather than setInterval counters. The timer runs offline by double-clicking the file, requires no account, server, or framework, and keeps study data in the browser.", "body_md": "I'm Affan, the founder of Threshyr. I build time trackers for a living, so I'm biased. But building a basic study timer yourself is a great first vibe coding project. It's small, useful, and you'll finish it in one sitting.\n\nThis guide walks you through building one with Claude Code, Codex, or Cursor. You'll get a copy-paste prompt, a step-by-step loop, and an honest look at where a DIY tracker stops being enough.\n\n## \n[What You'll Build](#what-youll-build)\n\nA single-page study timer that can:\n\n- **Hold a list of courses:** Add, rename, and color-code your subjects.\n- **Start and stop a timer for a course:** Run real-time tracking with a large clock.\n- **Save every session:** Automatically records date, duration, and associated coursework tasks.\n- **Show today's and this week's totals per course:** Visual progress bars for instant feedback.\n- **Export your log to CSV:** Clean backup of all your recorded study hours.\n\nIt's one file, it runs offline, and your data stays in your browser. No account, no server, and zero cost.\n\n## \n[Step 1: Pick a Setup That Works in Any AI Tool](#step-1-pick-a-setup-that-works-in-any-ai-tool)\n\nAsk the AI for one `index.html` file with plain JavaScript and `localStorage`. \n\nThere is nothing to install and no framework (like React or Vue) to debug, and every modern AI coding model handles vanilla web code exceptionally well. Storing state locally also keeps your study data private on your own machine.\n\n## \n[Step 2: Open Your Tool in an Empty Folder](#step-2-open-your-tool-in-an-empty-folder)\n\nPick the AI coding environment you prefer:\n\n- **Claude Code:** Create an empty folder, open your terminal inside it, and run`claude` .\n- **Codex CLI:** Same workflow. Open the folder in your terminal and run`codex` .\n- **Cursor:** Open the empty folder in Cursor, then press`Cmd+I` (or`Ctrl+I` ) to open the Composer / Agent chat panel.\n\nIf you'd rather skip the terminal, tools like **Windsurf**, **Lovable**, or **Bolt** work just as well. Simply paste the exact same prompt into their chat interface.\n\n## \n[Step 3: Paste the Starter Prompt](#step-3-paste-the-starter-prompt)\n\nClick the copy button on the prompt block below and paste it directly into your AI coding tool:\n\n```\nBuild a study time tracker as a single file called index.html (HTML, CSS and vanilla JavaScript only, no frameworks, no build step, no external requests). It must work offline by double-clicking the file.\n\nFeatures:\n1. Courses: add, rename and delete courses. Each course has a name and a color.\n2. Timer: pick a course, press Start, press Stop. Show a large running clock (HH:MM:SS). Only one timer can run at a time. If the page is refreshed while the timer is running, the timer must keep counting correctly (store the start timestamp, not a counter).\n3. Tasks: each course can have tasks (title, done checkbox). When starting the timer I can optionally pick a task to attach the session to.\n4. Timesheet: a table of all saved sessions with date, course, task, start time and duration. I can delete or edit a session's duration.\n5. Totals: show time studied today and this week, per course and overall, with simple horizontal bars (no chart library).\n6. Export: a button that downloads the timesheet as a CSV file.\n\nData and technical rules:\n- Store everything in localStorage under one key, as JSON. Handle an empty or corrupted state without crashing.\n- Use Date.now() timestamps, not setInterval counters, to calculate durations.\n- Clean, minimal dark UI, responsive, large readable text, keyboard accessible.\n- Keep the code in clearly commented sections: state, storage, timer logic, rendering, event handlers.\n\nWhen done, explain how to open it and list any assumptions you made.\n```\n\n## \n[Step 4: Open and Test It](#step-4-open-and-test-it)\n\nDouble-click `index.html` to open it in your browser, and run this quick validation checklist:\n\n1. **Add two courses** (e.g.,*Biochemistry* and*Organic Chemistry* ).\n2. **Start the timer** , wait ten seconds, and click stop.\n3. **Verify the timesheet:** Confirm the session shows up in the table with the correct duration and course color.\n4. **Test persistence:** Start the timer, refresh the browser page, and verify that the clock continues ticking without resetting to zero.\n\nIf something breaks, paste the exact error or describe what you saw back to the AI. Don't try to fix the code manually. Simply prompt: *\"When I refresh while the timer is running, the clock resets to zero. Please fix this by computing elapsed time from the saved start timestamp.\"* and let the AI patch it.\n\n## \n[Step 5: Improve It with Small Prompts](#step-5-improve-it-with-small-prompts)\n\nOnce the core timer works, add features one prompt at a time. Small, atomic prompts break code far less often than large feature dumps:\n\n- *\"Add a Pomodoro mode: 25 minutes of focus, 5 minutes of break, with an audio beep at the end.\"*\n- *\"Add a daily study goal in hours and display a circular progress ring.\"*\n- *\"Add a dark/light theme toggle in the top corner that remembers my preference in localStorage.\"*\n- *\"Add a 7-day bar chart showing study hours per day for the current week.\"*\n\n## \n[Step 6: Keep Your Code and Data Safe](#step-6-keep-your-code-and-data-safe)\n\n- **Version control:** Commit to Git (or create a duplicate copy of`index.html` ) after every working feature so you can roll back if the AI breaks something.\n- **Back up data:** Use the CSV export button regularly. Clearing your browser cache or site cookies wipes`localStorage` .\n- **Code review:** Ask the AI to audit its own code:*\"Review this index.html for memory leaks, edge cases in timer calculations, and localStorage quota limits.\"*\n\n## \n[Where a DIY Tracker Runs Out](#where-a-diy-tracker-runs-out)\n\nA weekend vibe-coding project is fun and educational, but browser-based timers carry natural limitations:\n\n- **Requires manual discipline:** It depends on you remembering to switch tabs and click Start and Stop for every reading session or lecture.\n- **Storage volatility:** Clearing browser history or private browsing mode wipes your entire semester of logs unless you manually export CSV files.\n- **No OS integration:** It doesn't sit in your macOS menu bar or Windows system tray, meaning you have to keep a browser tab open alongside heavy PDF readers and study apps.\n- **Zero device sync:** Hours logged on your laptop won't reflect on your desktop without manually merging spreadsheets.\n- **Maintenance overhead:** As your exam prep scales, you spend study time debugging web code instead of learning coursework.\n\nFor a weekend experiment, a DIY tracker is great. For a high-stakes semester of MCAT, USMLE, Bar Exam, or thesis research, you need dedicated, reliable desktop software.\n\n## \n[If You'd Rather Not Maintain It: Threshyr Edu](#if-youd-rather-not-maintain-it-threshyr-edu)\n\n[Threshyr Edu](https://threshyr.com/edu) is a native desktop application designed specifically for university students, researchers, and professional exam candidates. It is **100% free forever**, requires no account or credit card, and stores all coursework and study logs securely on your own computer.\n\nKey features include:\n\n- **Course budgeting:** Set weekly target hours per course and track syllabus completion against lecture credit hours.\n- **Integrated task timers:** Click start directly on coursework cards so your task board and timesheet never drift apart.\n- **Zero distractions:** Runs natively on your desktop with zero notifications, social feeds, or phone proximity distractions.\n- **Complete offline privacy:** Powered by a local SQLite database that never uploads your study habits to the cloud.\n\nIt is available right now with one-click install:\n\nBuild your own for the fun of it, or let Threshyr Edu handle the tracking so you can focus on mastering your coursework.\n\n#### Written by [Affan Bajwa](https://www.linkedin.com/in/affan-bajwa-ab835111a/)\n\nFounder of Threshyr. Passionate about local-first software architecture, developer productivity, and building privacy-first tools for knowledge workers.\n\n### Get Threshyr Edu\n\nFree forever on the Microsoft Store and Mac App Store. No account, no ads, no payment details.\n\n### Related Articles\n\n### Credit Hours vs Reality: Auditing How Much Time Your Degree Actually Takes\n\nUniversities claim that every credit hour requires 2–3 hours of outside study. Here is how to audit your real coursework hours using Threshyr Edu timesheets.\n\n[Affan Bajwa](https://www.linkedin.com/in/affan-bajwa-ab835111a/)7 min read\n\n### Why Med and Law Students Are Ditching Gamified Phone Timers for Desktop Tracking\n\nWhy studying for the USMLE, Bar Exam, or MCAT demands moving away from gamified mobile timers toward distraction-free desktop tracking with Threshyr Edu.\n\n[Affan Bajwa](https://www.linkedin.com/in/affan-bajwa-ab835111a/)7 min read", "url": "https://wpnews.pro/news/show-hn-prompt-to-vibe-code-a-zero-dependency-offline-study-timer", "canonical_source": "https://threshyr.com/blogs/how-to-vibe-code-your-own-study-time-tracker", "published_at": "2026-10-05 06:48:00+00:00", "updated_at": "2026-10-05 07:19:35.282472+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "generative-ai"], "entities": ["Affan", "Threshyr", "Claude Code", "Codex", "Cursor", "Windsurf", "Lovable", "Bolt"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-prompt-to-vibe-code-a-zero-dependency-offline-study-timer", "markdown": "https://wpnews.pro/news/show-hn-prompt-to-vibe-code-a-zero-dependency-offline-study-timer.md", "text": "https://wpnews.pro/news/show-hn-prompt-to-vibe-code-a-zero-dependency-offline-study-timer.txt", "jsonld": "https://wpnews.pro/news/show-hn-prompt-to-vibe-code-a-zero-dependency-offline-study-timer.jsonld"}}