{"slug": "slothlog-why-i-built-an-offline-ai-powered-timesheet-generator-for-lazy", "title": "SlothLog: Why I Built an Offline, AI-Powered Timesheet Generator for Lazy Developers", "summary": "A developer built SlothLog, an open-source, offline timesheet generator that scans local git commits across multiple repositories, clusters activity by ticket identifier, estimates session durations, and uses Google Gemma 2 2B via Ollama to turn terse commit messages into professional work summaries. The tool offers a CLI with scan and CSV export commands plus a web dashboard with hour steppers and copy buttons, keeping company code local rather than sending it to cloud services.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady](https://dev.to/challenges/hacktoberfest-week3-2026-10-19)*\n\nEvery Friday afternoon at 4:30 PM, an invisible cloud of collective dread descends upon software engineering teams: **logging our hours into Jira, Azure DevOps, or corporate time trackers.**\n\nYou open your tracking tool, stare at a blank grid of empty days, and begin the painful archaeological dig through your week:\n\nThe result? Developers either spend 45 minutes of precious Friday time reconstructing history, or they guess haphazardly, slapping `8.0h - General Development` across every day of the week.\n\nI wanted to be **completely, unapologetically lazy**. \n\nSo I built **SlothLog** (🦥): an offline, privacy-first developer utility that inspects your local git commits across multiple repositories, clusters activity by ticket identifier, estimates work session duration, and synthesizes executive-ready timesheet summaries using **Google Gemma 2 2B** running locally via **Ollama**.\n\nWith SlothLog:\n\n`python cli.py scan`.` AB#4920`, `PROJ-104`, `#12`) and session bursts.`\"fix bug\"`, `\"wip typo\"`, `\"more changes\"`) into clean, professional work notes (`\"Refactored invoice calculation engine and added VAT reverse charge support\"`).\nHere is SlothLog in action running locally with its utilitarian dark dashboard:\n\nThe web dashboard features an interactive date selector, hour stepper (`+` / `-` 0.25h), tracked repository manager, and single-click copy buttons with instant toast confirmations:\n\n```\n+---------------------------------------------------------------------------------------+\n| 🦥 SlothLog    Offline AI Timesheets for Lazy Developers    [Gemma 2 2B] [Sentry Active]|\n+---------------------------------------------------------------------------------------+\n| [ Total Logged: 7.00 h ]    [ Clustered Tickets: 3 ]    [ Effort Saved: ~45 mins ]    |\n+---------------------------------------------------------------------------------------+\n| [AB#4920] billing-service                                             [-] 3.25h [+]  |\n| \"Refactored invoice calculation engine, added VAT reverse charge support for European |\n|  B2B invoices, and implemented idempotency tests.\"                                    |\n| [ 3 underlying commits ]                                                              |\n| [📋 Copy for Jira / DevOps]   [📄 Copy Summary]                                       |\n+---------------------------------------------------------------------------------------+\n| [PROJ-104] portal-frontend                                            [-] 2.50h [+]  |\n| \"Implemented OAuth2 PKCE login flow callback and added refresh token rotation.\"       |\n| [📋 Copy for Jira / DevOps]   [📄 Copy Summary]                                       |\n+---------------------------------------------------------------------------------------+\n```\n\nIf you prefer staying in the terminal:\n\n``` bash\n$ python cli.py scan --date 2026-10-20\n\nScanning 2 repositories for date: 2026-10-20...\n\nGenerated Timesheet:\nDate       | Repo            | Ticket              | Hours | Summary\n-----------+-----------------+---------------------+-------+------------------------------------------------------------\n2026-10-20 | billing-service | AB#4920             | 3.25h | Refactored invoice calculation engine, added VAT reverse...\n2026-10-20 | portal-frontend | PROJ-104            | 2.50h | Implemented OAuth2 PKCE login flow callback...\n2026-10-20 | billing-service | General Maintenance | 1.25h | Upgraded dependencies, cleaned up unused imports...\n\nTotal Hours: 7.00h\n```\n\nYou can also export to standard CSV with `python cli.py export -o timesheet.csv` for HR and payroll imports.\n\nTurn your git commits into honest, sensible timesheets — without leaking company code to the cloud.\n\nEvery Friday at 4:30 PM, the same ritual happens across engineering teams:\n\n`git log`, scroll frantically through branch names, and end up roughly guessing numbers to hit 8 hours a day.\nMost of us waste 30 to 45 minutes every week doing this archaeological reconstruction. And while modern AI tools can summarize text, **pasting internal commit messages and proprietary code into third-party cloud APIs is a fast track to an unpleasant chat with Infosec**.\n\n**SlothLog** fixes this by staying completely local:\n\nThe full open-source codebase is hosted on GitHub:\n\n👉 [https://github.com/alessiobianchini/slothlog](https://github.com/alessiobianchini/slothlog)\n\nSlothLog was designed with a strict **anti-overengineering** philosophy: no heavy orchestrators (no LangChain, no LlamaIndex), no external cloud dependencies, and zero telemetry bloat.\n\nThe core engine inspects local git histories using native `git log --format=%H|%aI|%an|%ae|%s --date-order`. Commits are grouped by ticket identifier:\n\n`AB#\\d+` or `#\\d+`\n`[A-Z]+-\\d+`\n`gh-\\d+`\n`General Maintenance`\nTo estimate time accurately without snooping or spyware, SlothLog uses a **session clustering algorithm**:\n\nEnterprise developers cannot send proprietary commit messages, internal function names, or company ticket contents to third-party closed AI APIs. Privacy is paramount.\n\nSlothLog queries **Google Gemma 2 2B** via Ollama on `localhost:11434`. Gemma 2 2B is the ideal model for this task: ultra-lightweight, extremely fast on standard laptops, and remarkably proficient at concise extractive summarization without conversational filler.\n\nHere is the exact prompt that produces crisp results:\n\n```\nprompt = f\"\"\"You are a concise engineering assistant. Summarize these git commit messages into a single professional timesheet accomplishment bullet (1-2 sentences max).\nDo not mention commit hashes, dates, or conversational filler. Focus on what was delivered or solved.\n\nTicket: {ticket_id}\nCommits:\n{formatted_commits}\n\nExecutive Summary:\"\"\"\n```\n\nIf Ollama is not running or offline, SlothLog activates a **graceful deterministic fallback**, generating clean formatted summaries from the raw commits so you are never blocked.\n\nTo monitor the local AI execution and observe system health, I instrumented SlothLog with **Sentry SDK's Agent & GenAI Tracing**:\n\n```\nwith sentry_sdk.start_span(op=\"gen_ai.chat\", description=f\"Ollama synthesis: {ticket_id}\") as span:\n    span.set_data(\"ai.model_id\", \"gemma2:2b\")\n    span.set_data(\"ai.model_provider\", \"ollama\")\n    span.set_data(\"ai.prompt_tokens\", res.get(\"prompt_eval_count\", 0))\n    span.set_data(\"ai.completion_tokens\", res.get(\"eval_count\", 0))\n    span.set_data(\"ai.total_tokens\", total_tokens)\n    span.set_data(\"ai.cost\", 0.0) # Local open-source inference is free!\n```\n\nEvery synthesis run tracks token throughput, inference latency, and error states. Even better: Sentry confirms that our AI cost is **\\$0.00**.\n\nOpen innovation is the entire reason SlothLog can exist.\n\nIn a corporate environment, developer codebases are strictly confidential. Proprietary APIs from closed vendors pose serious privacy, compliance, and IP risks:\n\nWith open-weight models like **Google Gemma 2**, the paradigm shifts:\n\nOpen-weight AI gives power back to individual builders.\n\nThis entire project — from architecture design and specification to TDD implementation, Sentry tracing, and frontend build — was developed using **Antigravity** pair-programming.\n\nYou can inspect the complete design spec and step-by-step TDD verification transcript in the project repository:\n\n`docs/superpowers/specs/2026-10-20-slothlog-design.md`` docs/superpowers/plans/2026-10-20-slothlog.md`\nLet's calculate the sloth economics:\n\n**Manual Timesheet Archaeologist**:\n\nThat's **98.8% time saved**, 39 extra hours per year spent building actual software (or taking a well-deserved nap). Sloths everywhere rejoice.\n\nI am officially entering SlothLog into the following categories for **Hacktoberfest Open-Source AI Challenge Week 3**:\n\n`gemma2:2b` via Ollama for privacy-preserving, offline commit summarization without API fees.`render.yaml`) with auto-detected environment variables and demo data seeding for instant one-click deployment.`gen_ai.chat` spans measuring prompt/completion token metrics, latency, and \\$0.00 cost telemetry.", "url": "https://wpnews.pro/news/slothlog-why-i-built-an-offline-ai-powered-timesheet-generator-for-lazy", "canonical_source": "https://dev.to/alessio_bianchini/slothlog-why-i-built-an-offline-ai-powered-timesheet-generator-for-lazy-developers-2mak", "published_at": "2026-10-21 13:06:14+00:00", "updated_at": "2026-10-21 13:09:58.667514+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "large-language-models", "ai-products"], "entities": ["SlothLog", "Google", "Gemma 2 2B", "Ollama", "Jira", "Azure DevOps", "Hacktoberfest"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/slothlog-why-i-built-an-offline-ai-powered-timesheet-generator-for-lazy", "markdown": "https://wpnews.pro/news/slothlog-why-i-built-an-offline-ai-powered-timesheet-generator-for-lazy.md", "text": "https://wpnews.pro/news/slothlog-why-i-built-an-offline-ai-powered-timesheet-generator-for-lazy.txt", "jsonld": "https://wpnews.pro/news/slothlog-why-i-built-an-offline-ai-powered-timesheet-generator-for-lazy.jsonld"}}