A lightweight Windows productivity tracker built with C# / .NET 8, SQLite, and WinAPI.
TimeMachine.Agent monitors active applications, detects idle time, stores activity sessions locally, and analyzes focus and distraction patterns.
The project was built to explore Windows system APIs, local data persistence, REST API integration, and productivity analytics.
- 🖥️ Tracks the currently active Windows application
- ⌨️ Detects user idle time through WinAPI
- 💾 Stores activity sessions locally in SQLite
- 🧠 Detects deep-focus sessions and distractions
- 🔄 Merges short application switches using a grace period
- 📊 Generates productivity reports directly in the console
- 🐙 Fetches public GitHub activity through the GitHub REST API
| Key | Report |
|---|---|
S |
General activity overview — active/idle time and top applications |
F |
Focus analysis — deep-work sessions and focus score |
P |
Pattern analysis — switching behavior and peak productivity |
D |
Distraction analysis — short sessions and frequent switches |
G |
GitHub activity — today's public events |
TimeMachine.Agent uses configurable thresholds to classify activity:
- Deep work: sessions longer than 20 minutes
- Short distraction: sessions shorter than 90 seconds
- Idle detection: configurable timeout
- Grace period: prevents brief app switches from unnecessarily splitting sessions
- Focus score: calculated from recorded activity patterns
This allows raw window activity to be transformed into higher-level productivity metrics.
- C#
- .NET 8
- Microsoft.Data.Sqlite
- WinAPI (
user32.dll) - GitHub REST API
- SQLite
- Git / GitHub
Activity is stored locally in SQLite.
Stores application activity:
start_tsend_tsduration_msapppidwindow_titleexe_pathis_idle
Stores retrieved GitHub activity:
gh_event_idgh_typerepocreated_tspayload_json
- Windows 10/11
- .NET 8 SDK
- Visual Studio 2022 or another .NET-compatible IDE
- Clone the repository:
git clone https://github.com/DayDreamingg-g/TimeMachine.Agent.git- Open
TimeMachine.Agent.slnx. - Restore dependencies and build the project.
- Run
TimeMachine.Agent.
GitHub integration is optional and may require a GitHub token depending on API usage.
This project gave me practical experience with:
- interacting with native Windows APIs from C#
- designing persistent local storage with SQLite
- processing time-series activity data
- consuming REST APIs
- implementing configurable analytics logic
- structuring a standalone .NET application
The core tracking and analytics functionality is implemented.
Future improvements may include:
- graphical desktop interface
- visual productivity charts
- configuration UI
- exportable reports
- automated tests
Oleksandr — DayDreamingg-g
Computer Science student focused on software development and cybersecurity.