worklog
Input
$ARGUMENTS = optional date (20260318 or 2026-03-18) or week for weekly summary.
Step 0 — Auto-setup Hook
Check if the worklog hook is already installed. This step runs silently unless installation is needed.
0a. Read current settings
Read ~/.claude/settings.json. If it doesn't exist, treat it as {}.
0b. Check for existing hook
Look for a UserPromptSubmit hook whose command contains worklog. If found, skip to Step 1.
0c. Install the hook
- Create
~/.claude/hooks/directory if it doesn't exist - Copy the hook script from this skill's directory (
worklog/hooks/log-prompt.sh) to~/.claude/hooks/worklog.sh - Make it executable:
chmod +x ~/.claude/hooks/worklog.sh - Read the current
~/.claude/settings.json(or start from{}) - Merge this hook configuration into the existing settings, preserving all existing hooks and settings:
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/worklog.sh",
"timeout": 5
}
]
}
]
}
}
Important: If hooks.UserPromptSubmit already has entries, append to the array — do not replace.
- Write the updated settings back to
~/.claude/settings.json - Inform the user: "Worklog hook installed. It will start capturing prompts from
~/Code/work/projects in your next session."
Step 1 — Determine Target Date(s)
Parse $ARGUMENTS:
- Empty → today's date (
YYYYMMDD) week→ last 7 days (today through 6 days ago)- Date string → normalize to
YYYYMMDD(acceptYYYY-MM-DDorYYYYMMDD)
Step 2 — Read Raw Entries
For each target date, read ~/.claude/worklog/YYYYMMDD.md.
If no file exists for the requested date(s), inform the user that there are no entries and stop.
Step 3 — Organize and Present
Group entries by:
- Project (the value between backticks in each entry)
- Feature/task — infer macro-level tasks by analyzing prompt similarity within each project
Present the organized summary in this format:
# Worklog — YYYY-MM-DD
## project-name | Feature/Task Description
- **HH:MM** — Brief description derived from the prompt
- **HH:MM** — Another entry
## other-project | Another Feature
- **HH:MM** — Description
For /worklog week, use this format:
# Weekly Worklog — YYYY-MM-DD to YYYY-MM-DD
## YYYY-MM-DD (Day)
### project-name | Feature
- **HH:MM** — Description
---
## YYYY-MM-DD (Day)
...
Guidelines for organizing
- Preserve all timestamps exactly as recorded
- Derive concise descriptions from the raw prompt text (clean up, don't invent)
- Group related prompts into features/tasks based on semantic similarity
- Name features descriptively (e.g., "Payment Refunds", "UI Fixes", "API Migration")
Step 4 — Offer to Save
Use AskUserQuestion to ask the user:
- Save (Recommended) — Overwrite the raw file with the organized version
- Keep raw — Leave the original file unchanged
- Copy — Save organized version as
YYYYMMDD-organized.mdalongside the original
For weekly summaries, offer to save as week-YYYYMMDD.md.