Automatic session time tracking. Records start time at session begin, calculates duration on logout. Zero manual effort — just start working and say "logout" when done.
Automatically tracks how long each Claude Code session lasts. Works across all projects and terminals.
You don't need to do anything. It's fully automatic.
Contains this instruction at the top:
At the very start of every session, run:
echo $(date -u +%Y-%m-%dT%H:%M:%SZ) > ~/.claude/.session_start
The session-logging skill has a "Step 0" that:
~/.claude/.session_startDuration (hrs) to the Session Log in NotionTime Spent (hrs) if applicable| Database | Property | Type |
|---|---|---|
| AI Session Log | Duration (hrs) | number |
| AI Learning Pool | Time Spent (hrs) | number |
| AI Learning Pool | Started | date |
| AI Learning Pool | Completed | date |
This skill is passive — it activates automatically via:
No trigger word needed. If you want to manually check elapsed time mid-session:
To check elapsed time without logging out:
START=$(cat ~/.claude/.session_start 2>/dev/null)
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
python3 -c "
from datetime import datetime
start = datetime.fromisoformat('${START}'.replace('Z','+00:00'))
end = datetime.fromisoformat('${NOW}'.replace('Z','+00:00'))
mins = round((end - start).total_seconds() / 60)
hrs = round(mins / 60, 1)
print(f'已工作: {mins} 分钟 ({hrs} 小时)')
"
No setup needed. Since CLAUDE.md is at ~/CLAUDE.md (global), every new terminal/project automatically gets time tracking. The session-logging skill is also global.
Just: