Simple yet effective AI power timesheet
--- title: "Auto Timesheet Desktop — Your AI-Powered Work Log That Writes Itself, Locally" published: true description: "A Windows desktop app that silently watches what you work on all day and uses a local Gemma LLM (via LM Studio) to generate a professional timesheet — no cloud, no subscriptions,

--- title: "Auto Timesheet Desktop — Your AI-Powered Work Log That Writes Itself, Locally" published: true description: "A Windows desktop app that silently watches what you work on all day and uses a local Gemma LLM (via LM Studio) to generate a professional timesheet — no cloud, no subscriptions, no privacy trade-offs." tags: hacktoberfest, python, ai, opensource
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
Auto Timesheet Desktop is a Windows background agent that silently tracks everything you do on your computer all day — which apps you focus on, which Excel spreadsheets you edit, which web forms you submit, and which emails you send — then, at the end of the day, feeds those raw activity logs to a locally running Gemma LLM (via LM Studio) to generate a clean, structured, professional daily timesheet in seconds.
The person who gets to be lazier: Anyone who has to fill in a daily or weekly timesheet manually. Consultants, freelancers, corporate employees, finance teams — anyone who ends the day trying to remember what they actually worked on for the last 8 hours.
At end-of-day (manually triggered or scheduled), the app sends the raw.txt activity log to the local Gemma model with a carefully engineered prompt. Gemma reads the log and produces a structured JSON timesheet with:
If LM Studio is offline, a smart heuristic fallback analyzer (no LLM required) parses the raw logs using timestamps and classifies every event into the same structured format.
Result: A fully filled-in, exportable timesheet that took zero manual effort.
Here's what the end-to-end flow looks like in a real session:
1. The app runs silently in the system tray all day.
Raw activity log captured for a real morning session:
[06:34:37] [WINDOW] chrome.exe | Gmail - Google Chrome | 3s [06:37:01] [WINDOW] chrome.exe | Inbox (78) - Gmail | 144s [06:39:09] [FILE_EXCEL] RENAMED_OR_MOVED | first book to write.xlsx [06:40:59] [WINDOW] EXCEL.EXE | first book to write - Excel | 108s [06:42:20] [WINDOW] chrome.exe | Untitled form - Google Forms | 18s [06:45:59] [WINDOW] chrome.exe | ChatGPT | 54s [06:48:53] [WINDOW] LM Studio.exe | LM Studio | 108s Enter fullscreen mode Exit fullscreen mode 2. Click "Generate Timesheet with Gemma" — done in ~15 seconds.
The Gemma model reads the log and returns:
{ "date": "2026-10-26", "summary": "Morning session covered email review, spreadsheet editing (first book to write.xlsx), online form administration, AI research via ChatGPT, and local model setup in LM Studio.", "total_hours_tracked": 1.4, "entries": [ { "project": "Email & Communications", "category": "Communication & Email", "start_time": "06:34", "end_time": "06:38", "duration_minutes": 5 }, { "project": "Spreadsheet Management", "category": "Documentation & Excel", "start_time": "06:38", "end_time": "06:41", "duration_minutes": 12, "artifacts": [ "first book to write.xlsx" ] }, { "project": "Web Operations & Forms", "category": "Admin & Forms", "start_time": "06:41", "end_time": "06:43", "duration_minutes": 6 }, { "project": "Online Research & AI", "category": "Research & Web", "start_time": "06:43", "end_time": "06:47", "duration_minutes": 5 }, { "project": "Local AI & Model Setup", "category": "Development", "start_time": "06:47", "end_time": "06:50", "duration_minutes": 15, "artifacts": [ "LM Studio" ] } ] } Enter fullscreen mode Exit fullscreen mode 3. Export to Excel.xlsx, JSON, or copy a Markdown table — one click.
🔗 GitHub: https://github.com/YOUR_USERNAME/Auto_time_sheet (Replace with your actual repository URL before publishing)
Auto_time_sheet/ ├── main.py # Entry point (GUI + headless + --analyze modes) ├── config.py # Settings manager ├── requirements.txt ├── tracker/ │ ├── activity_manager.py # Orchestrates all trackers │ ├── window_monitor.py # Win32 API active window + idle detection │ ├── file_monitor.py # Watchdog-based Excel file event listener │ ├── web_receiver.py # HTTP server for browser extension events │ └── logger.py # Writes activity_YYYY-MM-DD.txt +.jsonl ├── analyzer/ │ ├── prompt_builder.py # Packages raw logs for Gemma prompt │ ├── gemma_client.py # LM Studio OpenAI-compatible API client │ └── json_parser.py # JSON repair + smart heuristic fallback ├── ui/ │ ├── app.py # Main window │ ├── timesheet_view.py # Timesheet cards, category pills, export │ ├── activity_view.py # Real-time event stream feed │ ├── settings_view.py # LM Studio config, model auto-detect │ └── tray_icon.py # Windows system tray support ├── browser_extension/ # Manifest V3 Chrome/Edge extension │ ├── manifest.json │ ├── background.js │ ├── content.js # Captures forms + Gmail/Outlook sent │ └── popup.html / popup.js └── data/ ├── logs/ # activity_YYYY-MM-DD.txt (gitignored) ├── timesheets/ # timesheet_YYYY-MM-DD.json (gitignored) └── settings.example.json # Template config for new users Enter fullscreen mode Exit fullscreen mode Tech Stack Layer Technology Language Python 3.10+ GUI CustomTkinter (dark mode, rounded cards) Window tracking Win32 API via ctypes / pywin32 File monitoring watchdog Browser integration Chrome/Edge Manifest V3 Extension (JS) LLM inference Gemma 2 via LM Studio (local OpenAI-compatible API) Fallback analysis Custom rule-based heuristic log classifier Export openpyxl (Excel), JSON, Markdown clipboard System tray pystray + Pillow How I Built It The open-source AI at the core: Google Gemma 2 via LM Studio The AI backbone is Gemma 2 — Google's open-weight language model family — running 100% locally through LM Studio, which exposes an OpenAI-compatible API endpoint at http://localhost:1234/v1.
No OpenAI account. No Anthropic subscription. No API key. Zero dollars spent on inference.
The key engineering challenge was prompt engineering for structured output. Gemma models don't natively support a separate system role in their chat template, so I pack system instructions and user task into one combined user message:
def build_combined_gemma_prompt ( date_str, raw_log_text ): """ Single combined prompt — max compatibility with Gemma chat templates. """ sys_prompt, user_prompt = build_gemma_prompt ( date_str, raw_log_text ) return f " { sys_prompt } \n\n ======================================== \n TASK: \n { user_prompt } " Enter fullscreen mode Exit fullscreen mode The prompt carefully guards against common Gemma failure modes:
Because LM Studio can be offline — or Gemma's JSON can be malformed — I built a complete standalone heuristic classifier ( generate_fallback_timesheet() in json_parser.py ):
The parse_timesheet_json() repair layer handles trailing commas, unquoted keys, JS-style comments, and unescaped newlines before falling back to heuristics.
Web activity is captured via a Manifest V3 Chrome/Edge extension that:
Events are POST -ed to a local Python HTTP server ( web_receiver.py, port 58432) running in a daemon thread inside the main app.
A closed API would have killed this project before it started — not technically, but ethically.
Your daily activity log is deeply personal. It contains:
Sending that to a commercial cloud API means handing your full workday to a third party to store, process, and potentially train on. With GDPR, HIPAA, and NDA obligations in most professional environments, that is a non-starter for lawyers, accountants, healthcare administrators, consultants, and anyone working with confidential client data.
Open-weight local models like Gemma 2 make state-of-the-art structured reasoning available on a modest laptop with zero data leaving the machine. LM Studio democratizes that capability without requiring users to manage Python inference environments.
Open model + open inference runtime = privacy-preserving AI that is genuinely usable by people whose jobs require confidentiality. That's what made this project possible — and that's what a closed API never could have provided.
(Optional — add your DevRelay session recording here with the agent_session tag, or remove this section)
I tested this on a real morning session (06:30–07:30) covering email, Excel, Google Forms, ChatGPT, and LM Studio:
Across a 5-day work week that's 50 minutes saved — and the quality is objectively higher because it captures exact timestamps and every task, including the ones you'd normally forget to log.
# 1. Clone the repo git clone https://github.com/manik-dev-sudo/Auto_time_sheet.git cd Auto_time_sheet # 2. Install dependencies pip install -r requirements.txt # 3. Download LM Studio, load any Gemma model, click Start Server # 4. Run python main.py Enter fullscreen mode Exit fullscreen mode See the full README for browser extension setup, CLI options ( --headless, --analyze ), and configuration details.