我太懶得記錄時間,於是打造了 Time Tracker AI 2.0 自動時間追蹤器
I Built an zero touch or automatic AI Time Tracker Because I Was Too Lazy to Track My Time 💀
作者因不想手動記錄時間,打造了 Time Tracker AI 2.0,一款以零操作記錄為目標的自動化 Windows AI 時間追蹤器。程式會在背景記錄應用程式及網站活動、分類任務,並提供時間軸和生產力分析。模糊活動可選用 Gemma 模型系列分類;截圖視覺分析則需設定 Ollama 服務,並可排除敏感應用程式。
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady.
What I Built
Recently, I was reading The Now Habit, a book about overcoming procrastination. It discussed something surprisingly simple: track where your time goes before trying to change how you spend it.
Makes sense, right? So I decided to start tracking my time on paper, following one of the examples in the book.
And then I did what any dedicated procrastinator would do.
I procrastinated on tracking my procrastination. 💀
Think about it. I was trying to stop wasting time, but the very first step required me to remember to write things down every time I switched tasks. Open a notebook, write down the task, note the time, remember to stop the timer, start another one…
Bro, I needed a project manager just to manage the process of managing my time.
So naturally, instead of doing the sensible thing and simply writing things down, I spent my time building an entire application to do it for me. 😂
Meet Time Tracker AI 2.0 — an automatic, AI-powered Windows time tracker built around one rule:
Zero steps to record your time. Your computer does the tracking; you do your thing.
It quietly observes what I'm doing on my computer, records activity, identifies applications and websites, classifies tasks, builds a timeline, calculates productivity metrics, and alerts me when my actions don't match my plans.
No manually starting timers. No reconstructing my entire day from memory at midnight. No spreadsheet that I enthusiastically create and abandon three days later.
What can it actually do?
1. Automatic activity tracking
The tracking engine continuously monitors my active Windows application, window title, activity duration, and idle periods in the background.
Automatically records application usage without requiring manual timers.
Detects idle periods based on keyboard and mouse activity, without recording the actual keys I type.
Tracks when applications change and merges consecutive observations into longer activity records.
Supports starting, pausing, resuming, and stopping tracking.
Protects against duplicate tracking processes and includes recovery mechanisms for interrupted observations.
The raw observation loop runs at approximately one-second intervals. The application combines those observations into useful records rather than presenting every second as a separate task.
2. Automatic browser and website tracking
An application name alone doesn't tell me much. Spending an hour in Chrome could mean studying Python, watching chess videos, browsing Reddit, or falling into a YouTube rabbit hole.
Time Tracker AI tracks browser activity and attributes it to individual websites.
It supports Chrome, Edge, Brave, Opera, Opera GX, Vivaldi, and Firefox through Windows accessibility automation and fallback title parsing.
It can associate browser activity with website domains and page titles without requiring a dedicated browser extension. Captured URLs are sanitized to remove query parameters and fragments.
The objective is to understand not just which application I opened, but what I was actually doing inside it.
3. Two-layer smart activity recognition
Raw activity records aren't very useful until they have context.
The application uses a rule-based classification pipeline first. It checks manual corrections, URL rules, website domains, application names, and window-title patterns in priority order.
For more ambiguous activity, optional AI-assisted classification using the Gemma model family can provide richer descriptions and categories.
The result is a structured activity record rather than a long list of cryptic executable names.
I can also create custom categories and rules, adjust how applications and websites are classified, and correct mistakes directly from the timeline.
The system includes built-in categories for coding and development, research and learning, communication, utilities and system activity, entertainment, social browsing, uncategorized activity, and idle gaps.
4. Privacy-aware screenshot analysis
Sometimes an application title doesn't tell the whole story.
The project includes an optional vision-analysis path for ambiguous windows. When the configured Ollama vision service is available, screenshots can be analyzed to provide additional context about the activity.
A sensitive-application blacklist suppresses screenshot processing for configured windows and applications, including password managers, authentication tools, banking-related windows, and other sensitive contexts.
The vision functionality is optional. Core time recording doesn't require an AI vision model to be running.
5. A timeline that makes sense
Recording thousands of observations is easy. Turning them into a readable story of the day is the harder part.
The interactive timeline groups related observations into sessions and helps distinguish between different kinds of activity.
It includes:
- Clustered View: A cleaner, human-readable view of longer sessions.
- Detailed View: A granular view of the underlying observations.
- Search and category filters.
- Timeline zoom controls and chronological navigation.
- Session details, including duration, application, title, website, and confidence information.
- Warnings for uncertain classifications.
- Manual editing of session descriptions and categories.
- Custom rules that make future classification more consistent.
Manual corrections are saved so that corrected classifications can take precedence over automatic classifications when the timeline is loaded again.
6. Productivity analytics and reports
This is where all that tracking becomes useful.
The dashboard provides an overview of focused work, productive work, distraction time, and daily goal progress, including comparisons against the previous day.
The analytics section lets me investigate my activity across today, yesterday, the last seven days, the last 30 days, this week, this month, and custom date ranges.
It includes:
- Productivity and focus metrics.
- Distraction-time breakdowns.
- Hourly activity visualizations and focus-versus-distraction patterns.
- App usage and website-domain breakdowns.
- Top Interruptors, which help identify applications and idle gaps associated with fragmented work.
- A calculated Productivity Score.
- Comparisons across different dates and reporting periods.
Instead of guessing whether I spent the day productively, I can inspect the data and see where my time actually went.
7. Time blocking, focus sessions, and goals
Tracking what happened is only half the problem. I also need to compare it with what I intended to do.
The time-blocking system lets me schedule a task, specify its start time and duration, and assign a target category.
I can:
- Create, edit, duplicate, shift, and delete time blocks.
- Choose quick durations such as 25, 50, or 90 minutes, or set a custom duration.
- Detect overlapping blocks before saving.
- Start a focus session associated with a planned block.
- Review plan adherence and see how much of the scheduled period matched the intended activity.
- Set daily targets for work, focus, study, and distraction limits.
The important distinction is that a planned task and a recorded task aren't treated as the same thing. The tracker can compare what I intended to do with what actually happened.
8. Smart Windows notifications and accountability
This is one of my favourite features because it helps close the gap between making a plan and following it.
Time Tracker AI can generate native Windows notifications for:
- Upcoming and starting time blocks.
- Sustained activity that doesn't match the planned task.
- Prolonged idle periods.
- Missed-activity gaps that may need to be filled in after returning to the computer.
The notifications support relevant actions, such as starting a focus session, snoozing an alert, skipping a block, opening the planner, reviewing activity, or switching tasks.
It also includes configurable notification preferences, idle thresholds, notification sounds, quiet hours, and a notification history.
The notification logic includes grace periods, cooldowns, and suppression rules to reduce unnecessary alerts.
If I return after being away for a long time, the application can offer a recovery prompt so I can manually add activity that wasn't recorded. It doesn't need to pretend it knows exactly what happened while I was gone.
The aim is accountability without turning my desktop into a notification factory.
9. An AI productivity coach
The project includes an AI Coach for questions about my day.
It supports structured queries about productivity summaries, distractions, focus, goals, time blocks, and activity breakdowns. These common questions can be answered using metrics obtained directly from the local database.
For more open-ended questions, the application can use an available Ollama language model, with verified activity metrics supplied as context.
If the model isn't available, supported requests can return a deterministic summary of the available data instead.
The purpose isn't to let a chatbot invent productivity statistics. It's to make the information already collected easier to understand and act on.
The coach also has suggested prompts and navigation actions that can take me directly to relevant parts of the application.
10. A floating desktop widget
I don't want to keep opening my dashboard just to check my active session.
The floating mini-widget stays on top of other windows and provides a compact view of my tracking status.
It displays the active task, elapsed session time, and daily progress. It supports expanded and compact layouts, tracking controls, task editing, and saved window positioning.
That means I can keep it visible while coding, browsing documentation, or working in a terminal without constantly switching away from what I'm doing.
11. Data export, settings, and recovery
The application also includes the less glamorous features that make a real tool usable.
- CSV exports: Download detailed activity records or summaries of application and website usage for a selected date range.
- Settings: Configure notification behaviour, quiet hours, idle thresholds, and other preferences.
- Profile management: Edit the local user profile.
- Autostart: Optionally launch the application when logging in to Windows.
- Local diagnostics: Inspect database-related information to help troubleshoot the tracker.
- Persistent storage: Keep observations, activity classifications, time blocks, goals, notifications, settings, and reports in SQLite.
- Recovery mechanisms: Audit and repair certain interrupted or unfinished observations.
12. A standalone Windows application
I didn't want the final product to be just another development server that needed to be opened in a browser.
The project combines a Python backend, a React and TypeScript interface, FastAPI, SQLite, and PyWebView into a dedicated Windows desktop application.
It includes a custom desktop title bar, minimize and maximize controls, window management, a single-instance mechanism, and lifecycle handling for closing the application while tracking is active.
The project also has Windows packaging and installer scripts, desktop and Start Menu shortcuts, an uninstaller, and support for opening the application through notification actions.
The intended experience is a proper desktop application rather than a website I have to remember to open.
Demo
Demo video: https://youtu.be/XNiH-a5P9Zg?si=oiFGwKcNzyiUlEWK
Code
GitHub repository: Time Tracker AI 2.0
The project is built primarily with Python, React, TypeScript, FastAPI, SQLite, and PyWebView.
How I Built It
The architecture separates the Windows tracking engine from the API, database, AI-assisted interpretation, and desktop interface. The tracking engine collects observations, the database stores them, the backend calculates metrics and handles classification, and the frontend presents the results.
Where AI fits in
I use Ollama-compatible models, including the Gemma model family, for optional AI-powered activity interpretation and related features. The project also contains a Llama 3.2 configuration for open-ended AI Coach queries.
The Gemma-related paths support text interpretation, optional vision analysis, and natural-language productivity summaries, depending on their configuration and availability.
I deliberately kept deterministic logic at the centre of the application. Recording an observation, calculating a duration, checking a scheduled time block, or aggregating a report doesn't inherently require an LLM.
AI is used where interpretation can add value. Rules and database calculations handle the tasks that are better suited to deterministic logic.
This hybrid design also means that losing access to a model doesn't have to stop the core tracker.
Why Does Open Innovation Matter?
I'm a student, and I don't have an unlimited budget for building software.
I want to experiment with AI, build real projects, and keep iterating. But sending every classification and analysis request to an expensive closed API can make experimentation costly, particularly for a product that runs continuously.
Open-weight models give me more flexibility.
With an appropriate local model and compatible hardware, I can run inference without paying a per-token fee to a hosted API. I can experiment with different models, control the configuration, and decide which operations actually benefit from AI.
Cloud-hosted model options are useful too, but they can require network access and may have different costs or authentication requirements. The important part is being able to choose how each feature is implemented.
Open models also let me learn by exploring how inference fits into a real application instead of treating an AI API as a magic box.
For someone building independently on a student budget, that freedom matters. It lowers the cost of experimentation and makes it easier to turn an idea into something practical.
The Lazy Payoff
The Lazy Payoff
The biggest payoff is that I no longer have to remember to start and stop timers every time I switch tasks. Earlier, I'd start a timer, move to another task, and completely forget to stop the original one. Suddenly, my two-hour coding session somehow lasted six hours. My time tracking was tracking fiction. 💀
Now I can sit down to code, research a topic, or watch a tutorial, and the tracker records the activity in the background. Later, I can inspect the timeline, review my productivity, find interruptions, export the data, and compare my actual behaviour against the schedule I made.
And when I plan to spend an hour studying but drift into unrelated activity, the application can help me notice that mismatch before the end of the day.
It's not going to magically cure my procrastination. Unfortunately, no amount of Python can guarantee that I won't find a new way to waste three hours.
But it removes one excuse: I can't procrastinate on tracking my time when the tracking happens automatically.
I started this project because I wanted to build a habit from The Now Habit. Somewhere along the way, that simple attempt turned into a much larger experiment in Windows automation, data analysis, AI, and product development.
The project is still evolving, but that is the idea behind Time Tracker AI 2.0: make tracking effortless, make the data useful, and make it easier to notice when my actions don't match my intentions.
And hopefully, spend less time building increasingly elaborate systems to help me stop wasting time.
Although, looking at this project, I may need to build a tracker for the time I spend building trackers. 💀
Prize Categories
Best Use of Gemma
The project uses the Gemma model family for optional AI-powered activity interpretation and related analysis paths. Rather than sending every observation to an AI model, I combine model-assisted interpretation with deterministic tracking, classification rules, and local analytics.
That hybrid approach lets AI add context where it's useful while keeping core tracking and reporting functional without constant model inference.
Best Use of GitHub Copilot
GitHub Copilot helped me understand unfamiliar code, explore implementation ideas, debug errors, and refine features while building this project as a student.
It made development faster and helped me learn along the way, but testing and fixing things when they broke was still on me! 🚀
But it removes one excuse: I can't procrastinate on tracking my time when the tracking happens automatically.
I started this project because I wanted to build a habit from The Now Habit. Somewhere along the way, that simple attempt turned into a much larger experiment in Windows automation, data analysis, AI, and product development.
The project is still evolving, but that is the idea behind Time Tracker AI 2.0: make tracking effortless, make the data useful, and make it easier to notice when my actions don't match my intentions.
And hopefully, spend less time building increasingly elaborate systems to help me stop wasting time.
Although, looking at this project, I may need to build a tracker for the time I spend building trackers. 💀
Prize Categories
Best Use of Gemma
The project uses the Gemma model family for optional AI-powered activity interpretation and related analysis paths. Rather than sending every observation to an AI model, I combine model-assisted interpretation with deterministic tracking, classification rules, and local analytics.
That hybrid approach lets AI add context where it's useful while keeping core tracking and reporting functional without constant model inference.
Best Use of GitHub Copilot
GitHub Copilot helped me throughout the process of turning this idea into a working application.
As a student, I'm still learning how to design and maintain larger software projects. Building a system that combines Windows APIs, background processes, a database, a backend, a React interface, AI integrations, and desktop packaging meant dealing with plenty of unfamiliar code and concepts.
Copilot helped me think through implementation approaches, understand existing code, explore unfamiliar functions, and translate ideas into concrete code changes. It was also useful when working through errors, refining implementations, and understanding how different parts of the application fit together.
One of the biggest benefits was being able to investigate why something worked instead of blindly copying a solution. Understanding why matters when multiple components need to communicate reliably.
AI-assisted development wasn't a magic button, either. Suggestions still needed to be inspected, tested, and debugged. Sometimes a fix introduced a new issue, or the initial diagnosis turned out to be wrong. That meant iterating: understand the problem, explore a solution, implement it, and verify the result.
For me, Copilot was less about generating an entire application with one prompt and more about accelerating the development and learning process. It helped me work through unfamiliar technical challenges while learning about software architecture, debugging, integration, and product development along the way.
The biggest lesson was that AI assistance is most useful when it helps you understand and improve your work, not when you stop questioning its output.
來源:DEV Community · dev.to








