An AI worklog takes your raw git commits and transforms them into a structured record of work: tasks categorized by type, hours estimated from commit patterns, and descriptions rewritten for non-technical audiences. You can build this yourself by piping git log output into an LLM, or use a purpose-built tool that combines commit data with IDE activity tracking to produce worklogs automatically.
Why This Matters
A git log is not a worklog. A git log is a reverse-chronological list of code changes with developer-facing messages like "fix null check in OrderValidator" and "refactor payment retry to use strategy pattern." A worklog is a structured document that tells a manager, client, or auditor what was accomplished, how long it took, and which project or billing category it falls under.
The gap between the two is significant. A worklog needs:
- Categorization — Is this commit a new feature, a bug fix, a refactor, or infrastructure work?
- Grouping — Which commits belong to the same task or ticket?
- Time estimation — How many hours did this cluster of work represent?
- Plain-language descriptions — What did this accomplish in terms a non-developer understands?
- Billing alignment — Which client, project, or cost center does this charge to?
Traditionally, developers bridge this gap manually every Friday, translating a week of commits into timesheet entries from memory. This is slow, inaccurate, and universally hated. AI can automate most of this translation by reading the commit messages, understanding the context from branch names and file paths, and producing a structured worklog that only needs a quick human review.
Short Answer
Export your git log for the week, feed it to an LLM with a prompt that asks for categorized, time-estimated worklog entries, and review the output. For a hands-off solution, use an IDE plugin like CodeClocker that combines real-time coding activity with AI-powered commit analysis to generate worklogs automatically, complete with actual (not estimated) hours per task.
Step-by-Step
1. Export Your Git History in a Structured Format
Start by pulling your commits into a format that gives the AI enough context to work with. Include timestamps, branch names, and file change stats.
git log --author="$(git config user.name)" --since="last monday" \
--format="COMMIT|%ad|%D|%s" --date=format:"%Y-%m-%d %H:%M" \
--stat --reverse
This produces output with commit metadata and file change statistics:
COMMIT|2026-04-20 09:15||Add database migration for invoice templates
db/migrations/20260420_invoice_templates.sql | 45 +++++++++++++++
1 file changed, 45 insertions(+)
COMMIT|2026-04-20 11:30||Implement invoice template CRUD API endpoints
src/handlers/invoice_template.go | 142 ++++++++++++++++++++++++++++++
src/handlers/invoice_template_test.go | 98 ++++++++++++++++++++
src/routes/api.go | 8 +++
3 files changed, 248 insertions(+)
COMMIT|2026-04-20 15:45|HEAD -> feature/invoice-templates|Add PDF rendering for custom invoice templates
src/services/pdf_renderer.go | 89 +++++++++++++++++++++
src/templates/invoice_default.html | 56 +++++++++++++
2 files changed, 145 insertions(+)
COMMIT|2026-04-21 09:30||Fix currency formatting in multi-locale invoice generation
src/services/invoice_formatter.go | 23 ++++++---
src/services/invoice_formatter_test.go | 41 +++++++++++++++++
2 files changed, 56 insertions(+), 8 deletions(-)
COMMIT|2026-04-21 14:00||Optimize invoice PDF rendering with template caching
src/services/pdf_renderer.go | 34 ++++++++-----
src/services/cache.go | 67 +++++++++++++++++++++
2 files changed, 86 insertions(+), 15 deletions(-)
The file paths and change stats give the AI context that commit messages alone do not provide. A message like "fix currency formatting" becomes more meaningful when the AI can see it touches invoice_formatter.go and adds 41 lines of tests.
2. Feed the Data to an LLM with a Worklog Prompt
Pipe the git output into an LLM with a prompt designed to produce worklog entries. Here is an effective prompt template:
You are generating a developer worklog from git commit history.
For each cluster of related commits, produce a worklog entry with:
- Category: Feature | Bug Fix | Refactor | Infrastructure | Testing | Documentation
- Task summary: One line, written for a non-technical project manager
- Commits included: List the commit messages that belong to this task
- Estimated hours: Based on the commit timestamps and code change volume
- Billable: Yes/No
Group related commits into single tasks. Do not list each commit as a
separate worklog entry.
Here is the git history for the week:
[paste git log output here]
You can run this through any LLM API. Here is a quick command-line approach using the Anthropic API:
#!/bin/bash
AUTHOR="$(git config user.name)"
SINCE="last monday"
LOG=$(git log --author="$AUTHOR" --since="$SINCE" \
--format="COMMIT|%ad|%s" --date=format:"%Y-%m-%d %H:%M" \
--stat --reverse)
curl -s https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d "{
\"model\": \"claude-sonnet-4-6\",
\"max_tokens\": 2048,
\"messages\": [{
\"role\": \"user\",
\"content\": \"Generate a developer worklog from these git commits. Group related commits into tasks. For each task: category (Feature/Bug Fix/Refactor/Infrastructure), one-line summary for a non-technical audience, estimated hours based on timestamps and code volume, and billable status.\n\n${LOG}\"
}]
}" | jq -r '.content[0].text'
3. Review the AI-Generated Worklog
The AI output for the example above would look something like this:
# Weekly Worklog - April 20-21, 2026
## 1. Invoice Template System
**Category:** Feature
**Summary:** Built a complete invoice template system allowing users
to create, edit, and render custom invoice designs as PDFs.
**Commits:**
- Add database migration for invoice templates
- Implement invoice template CRUD API endpoints
- Add PDF rendering for custom invoice templates
**Estimated hours:** 5.5
**Billable:** Yes
## 2. Invoice Currency Fix
**Category:** Bug Fix
**Summary:** Fixed currency formatting issues that caused incorrect
display for invoices generated in non-USD locales.
**Commits:**
- Fix currency formatting in multi-locale invoice generation
**Estimated hours:** 2.0
**Billable:** Yes
## 3. PDF Rendering Performance
**Category:** Refactor
**Summary:** Improved invoice PDF generation speed by adding a
template caching layer, reducing render time for repeat templates.
**Commits:**
- Optimize invoice PDF rendering with template caching
**Estimated hours:** 2.5
**Billable:** Yes
**Total estimated hours:** 10.0
What the AI did well: It grouped the three Monday commits into a single "Invoice Template System" feature rather than listing them separately. It correctly categorized the currency fix as a bug fix and the caching optimization as a refactor. The summaries are written in plain language that a project manager or client can understand.
What needs human review: The time estimates are educated guesses based on commit timestamps and code volume. The AI estimated 5.5 hours for the template feature based on the 9:15 AM to 3:45 PM timestamp span, but the actual time might have been 4 hours with a lunch break in between. Only the developer knows whether Tuesday's two tasks took 2 hours each or 3 and 1. The estimates are a starting point, not a final answer.
4. Enhance with IDE Activity Data
The fundamental limitation of the git-plus-AI approach is that the AI is guessing at hours. It can see that your first commit was at 9:15 and your last was at 3:45, but it cannot see the lunch break, the meeting, or the 30 minutes you spent reading documentation before writing the first line of code.
An IDE plugin like CodeClocker eliminates this guessing by recording your actual development sessions. It knows:
- You were actively coding on the invoice template from 9:10 AM to 12:15 PM (3.1 hours, not the 6.5-hour span between first and last commits)
- You switched to the currency fix at 1:30 PM after lunch and finished at 3:00 PM (1.5 hours)
- You spent 45 minutes reviewing a teammate's PR in the same codebase (no commits, but tracked as active session)
When the AI generates the worklog from this enriched data, the time entries are actual measurements, not estimates. The result is a worklog you can submit to a client or compliance system without disclaimers about approximation.
5. Automate the Pipeline
Once you have a prompt that produces good results, automate the full pipeline: git export, AI processing, and delivery.
#!/bin/bash
# weekly-worklog.sh - Run every Friday at 5 PM via cron
# 0 17 * * 5 ~/bin/weekly-worklog.sh
AUTHOR="$(git config user.name)"
SINCE="last monday"
OUTPUT=~/worklogs/$(date +%Y-%m-%d).md
# Collect commits from all repos
ALL_LOGS=""
for repo in ~/projects/*/; do
[ -d "$repo/.git" ] || continue
project=$(basename "$repo")
log=$(git -C "$repo" log --author="$AUTHOR" --since="$SINCE" \
--format="[$project] %ad | %s" --date=format:"%Y-%m-%d %H:%M" \
--stat --reverse 2>/dev/null)
[ -n "$log" ] && ALL_LOGS+="$log\n\n"
done
# Generate worklog via AI
WORKLOG=$(echo -e "$ALL_LOGS" | curl -s https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d "{
\"model\": \"claude-sonnet-4-6\",
\"max_tokens\": 4096,
\"messages\": [{
\"role\": \"user\",
\"content\": \"Generate a weekly developer worklog from these git commits across multiple projects. Group by project, then by task within each project. Include: category, plain-language summary, estimated hours, billable status. Format as markdown.\n\n$(echo -e "$ALL_LOGS")\"
}]
}" | jq -r '.content[0].text')
echo "$WORKLOG" > "$OUTPUT"
echo "Worklog saved to $OUTPUT"
Every Friday at 5 PM, this script collects your commits from all repos, sends them to Claude for categorization and summarization, and saves the structured worklog to a file. You review it Monday morning, adjust any time estimates, and submit.
Example
Here is a complete before-and-after showing what raw git data looks like versus the AI-generated worklog.
Input: Raw git log for a developer working across two repos
[billing-api] 2026-04-20 09:15 | Add Stripe Connect onboarding flow for marketplace sellers
[billing-api] 2026-04-20 11:30 | Implement payout scheduling for connected accounts
[billing-api] 2026-04-20 14:00 | Write integration tests for Connect onboarding
[billing-api] 2026-04-21 09:45 | Fix webhook signature validation for Connect events
[billing-api] 2026-04-21 11:15 | Add retry logic for failed payout transfers
[billing-api] 2026-04-22 10:00 | Update API docs for marketplace seller endpoints
[admin-portal] 2026-04-22 13:30 | Add seller onboarding status dashboard
[admin-portal] 2026-04-22 16:00 | Implement payout history view with filtering
[admin-portal] 2026-04-23 09:30 | Fix date range picker timezone handling
[admin-portal] 2026-04-23 11:00 | Add CSV export for payout reports
Output: AI-generated worklog
# Weekly Worklog - April 20-23, 2026
**Developer:** Marcus Rodriguez
## billing-api
### Marketplace Seller Payments (Feature)
Built the Stripe Connect integration for marketplace seller onboarding,
including automated payout scheduling for connected accounts.
- Add Stripe Connect onboarding flow for marketplace sellers
- Implement payout scheduling for connected accounts
- Write integration tests for Connect onboarding
**Estimated hours:** 5.0 | **Billable:** Yes
### Payment Reliability Fixes (Bug Fix / Infrastructure)
Fixed webhook validation for Stripe Connect events and added retry
logic to handle transient payout failures gracefully.
- Fix webhook signature validation for Connect events
- Add retry logic for failed payout transfers
**Estimated hours:** 2.5 | **Billable:** Yes
### API Documentation (Documentation)
Updated public API documentation to cover new marketplace seller endpoints.
- Update API docs for marketplace seller endpoints
**Estimated hours:** 1.5 | **Billable:** Yes
## admin-portal
### Seller Management Dashboard (Feature)
Built admin views for monitoring seller onboarding progress and
reviewing payout history with date filtering and CSV export.
- Add seller onboarding status dashboard
- Implement payout history view with filtering
- Add CSV export for payout reports
**Estimated hours:** 5.0 | **Billable:** Yes
### Dashboard Bug Fix (Bug Fix)
Fixed timezone handling in the date range picker that caused incorrect
date boundaries for users in non-UTC timezones.
- Fix date range picker timezone handling
**Estimated hours:** 1.0 | **Billable:** Yes
---
**Total estimated hours:** 15.0
**Breakdown:** Feature: 10.0h | Bug Fix: 3.5h | Documentation: 1.5h
What the AI inferred correctly: The ten commits were grouped into five logical tasks across two projects. The Stripe Connect commits were recognized as a single feature. The webhook fix and retry logic were grouped as reliability work. The admin portal commits were split between the dashboard feature and a standalone bug fix. Categories and plain-language summaries are accurate.
What required manual adjustment: The AI estimated 15 total hours based on timestamp spans. Marcus actually worked 12.5 hours on these tasks because Tuesday afternoon was spent in a design review (no commits) and Wednesday's documentation took 45 minutes, not 1.5 hours. Marcus adjusted the estimates and added a line item for the 2-hour design review that produced no commits. With IDE tracking, the original time entries would have been accurate and the design review session would have been captured automatically.
Common Mistakes
1. Submitting AI-generated worklogs without review. The AI will occasionally miscategorize a commit, merge two unrelated tasks, or produce a time estimate that is obviously wrong. Always review the output before submitting it to a client, manager, or billing system. The AI handles 80 percent of the work; the human review catches the 20 percent it gets wrong.
2. Using AI time estimates for client invoicing. AI-estimated hours are educated guesses, not measurements. If you bill clients based on these estimates, you will either undercharge (losing revenue) or overcharge (losing trust). For billable work, pair the AI worklog with actual time tracking from an IDE plugin or manual timesheet. Use the AI estimates only as a sanity check.
3. Not providing enough context in the prompt. Feeding the AI bare commit messages produces generic results. Include branch names, file paths, and change stats so the AI can infer project context, distinguish features from fixes, and estimate scope more accurately. The richer the input, the better the worklog.
4. Ignoring non-commit work entirely. An AI worklog generated from git history has the same blind spot as every git-based report: code reviews, meetings, debugging without commits, and planning are invisible. If your worklog only shows committed code, you are systematically underreporting 20 to 40 percent of your work. Add non-commit items manually or use a tool that tracks them automatically.
5. Over-engineering the prompt. A simple prompt that asks for categories, summaries, and time estimates produces better results than a complex prompt with elaborate formatting rules, persona instructions, and multi-step reasoning chains. Start simple. Refine only if the output has consistent problems.
FAQ
Which LLM works best for worklog generation?
Any recent model from Anthropic, OpenAI, or Google works well for this task. The quality depends more on the input data (rich git log with stats versus bare commit messages) and the prompt than on the specific model. Claude and GPT-4 both handle categorization and summarization accurately. For cost efficiency on high-volume automation, Claude Haiku or GPT-4o-mini are sufficient.
Can the AI map commits to Jira tickets or project codes?
Yes, if your commit messages or branch names include ticket references (e.g., PROJ-123 or feature/BILLING-456). Add a line to your prompt: "Extract Jira ticket numbers from commit messages and branch names, and group commits by ticket." The AI will produce ticket-aligned worklog entries that map directly to your project management tool.
How accurate are the AI time estimates?
Typically within 20 to 30 percent of actual time for coding work, based on the assumption that commit timestamp spans roughly correspond to active work. The estimates are systematically less accurate on days with meetings, long debugging sessions, or significant context-switching. They are best used as a starting point for human review, not as final numbers.
Is it safe to send commit history to an external AI API?
Commit messages and file paths may contain proprietary information: project names, feature descriptions, internal system names. Check your company's data policy before sending this data to external APIs. Anthropic and OpenAI offer data processing agreements and do not use API inputs for training by default. For maximum security, use a self-hosted model or a tool like CodeClocker that processes data without sending raw commit content to third-party LLMs.
Can I use this for compliance or audit purposes?
AI-generated worklogs are useful as supporting documentation, but most compliance frameworks (DCAA, SOX, HIPAA) require time records backed by a structured approval workflow, not AI-estimated hours. Use the AI worklog as the first draft that feeds into an automated timesheet system with review and approval steps.
Final Recommendation
Start with the manual approach this Friday: export your git log, paste it into Claude or ChatGPT with the worklog prompt, and compare the output to whatever worklog you would have written from memory. The AI version will be more complete (it does not forget commits) and better structured (consistent categories and formatting). It will also be faster: five minutes of review versus 20 minutes of manual construction.
If the output is useful, automate the pipeline with the cron script. If the time estimates are not accurate enough for your needs, add IDE activity tracking. The combination of real-time session data from an IDE plugin and AI-powered commit analysis produces worklogs that are both comprehensive and precise: every task is categorized, every hour is measured, and the developer spends zero time on manual entry. The AI handles the translation from code changes to business language, while the IDE provides the ground truth on time.
Related Reading
- How to Generate a Timesheet from Git Commits
- Generate a Developer Weekly Report from Git Commits
- Automating Developer Timesheets: Why Manual Time Entry Fails
- How to Create Proof of Work Reports for Client Billing
Generate AI-powered worklogs from your actual coding activity
CodeClocker combines real-time IDE session tracking with AI-powered commit analysis to produce worklogs with accurate hours, task categories, and client-ready descriptions. No manual time entry required.
Start Free Trial