ccworktime
v0.0.5
Published
Calculate your Claude Code work time from session logs
Maintainers
Readme
ccworktime
Calculate how much time you've spent working with Claude Code, based on your local session logs.
Install
Homebrew (macOS / Linux)
brew install ShahadIshraq/tap/ccworktimeDownload binary
Grab the latest binary from GitHub Releases:
# macOS (Apple Silicon)
curl -fsSL https://github.com/ShahadIshraq/ccworktime/releases/latest/download/ccworktime-darwin-arm64.tar.gz | tar xz
sudo mv ccworktime-darwin-arm64 /usr/local/bin/ccworktime
# macOS (Intel)
curl -fsSL https://github.com/ShahadIshraq/ccworktime/releases/latest/download/ccworktime-darwin-x64.tar.gz | tar xz
sudo mv ccworktime-darwin-x64 /usr/local/bin/ccworktime
# Linux (x64)
curl -fsSL https://github.com/ShahadIshraq/ccworktime/releases/latest/download/ccworktime-linux-x64.tar.gz | tar xz
sudo mv ccworktime-linux-x64 /usr/local/bin/ccworktime
# Windows (x64, PowerShell)
Invoke-WebRequest -Uri https://github.com/ShahadIshraq/ccworktime/releases/latest/download/ccworktime-windows-x64.zip -OutFile ccworktime.zip
Expand-Archive ccworktime.zip -DestinationPath .
Move-Item ccworktime-windows-x64.exe "$env:LOCALAPPDATA\Microsoft\WindowsApps\ccworktime.exe"npm (requires Node.js >= 18)
npx ccworktimeOr install globally:
npm install -g ccworktimeUsage
ccworktime [options]| Flag | Description | Default |
|------|-------------|---------|
| --today | Show today's work time | (default) |
| --yesterday | Show yesterday's work time | |
| --week | Show current week (Mon–Sun) | |
| --month | Show current month | |
| --from <YYYY-MM-DD> | Start date | today |
| --to <YYYY-MM-DD> | End date | today |
| --pause <minutes> | Inactivity gap to split sessions | 10 |
| --overlap merge\|accumulate | Cross-project overlap handling | merge |
| --project <path> | Filter to a project directory (repeatable) | |
| --no-subagents | Exclude subagent (Task tool) activity | |
| --claude-dir <path> | Override ~/.claude directory | |
| --version, -v | Show version number | |
| --help, -h | Show help message | |
Examples
# Today's total
ccworktime
# All of February
ccworktime --from 2026-02-01 --to 2026-02-28
# This week, one project only
ccworktime --week --project ~/workspace/myapp
# Tighter session gap, accumulate overlaps
ccworktime --pause 5 --overlap accumulate
# Yesterday, no subagent time
ccworktime --yesterday --no-subagentsSample Output
╭─────────────────────────────────────────────╮
│ Claude Code Work Time Report │
│ Period: 2026-03-03 to 2026-03-03 │
╰─────────────────────────────────────────────╯
┌──────────────┬────────────┬───────────────────────────────────┐
│ Date │ Duration │ Work Blocks │
├──────────────┼────────────┼───────────────────────────────────┤
│ 2026-03-03 │ 3h 02m │ 09:15 - 11:29 (2h 14m) │
│ │ │ 14:00 - 14:48 (0h 48m) │
├──────────────┼────────────┼───────────────────────────────────┤
│ Total │ 3h 02m │ 2 blocks across 1 days │
└──────────────┴────────────┴───────────────────────────────────┘Colors are shown in TTY terminals. Set
NO_COLOR=1to disable.
How It Works
- Reads JSONL conversation logs from
~/.claude/ - Extracts message timestamps per project
- Clusters timestamps into work blocks using the pause threshold
- Merges (or accumulates) overlapping blocks across projects
- Reports total focused work time per day
Requirements
- Claude Code installed and used at least once
- Node.js >= 18 (only for npm/npx — Homebrew and binary installs need no runtime)
License
MIT
