Manage a Pomodoro focus timer. Use /focus start, /focus break, /focus long, /focus stop, or /focus for current status.
State file: ~/.claude/.pomodoro_state
Notified flag: ~/.claude/.pomodoro_notified
status → show current status (read state file, calculate remaining)start → 25-min work sessionbreak or short → 5-min short breaklong → 15-min long breakstop or reset → stop and clearDelete the notified flag, then write the state file:
rm -f ~/.claude/.pomodoro_notified
printf 'START_TIME=%s\nDURATION=%s\nTYPE=%s\n' "$(date +%s)" "<seconds>" "<type>" \
> ~/.claude/.pomodoro_state
Durations and types:
| Command | TYPE | DURATION |
|---|---|---|
start | work | 1500 |
break / short | short_break | 300 |
long | long_break | 900 |
Confirm to the user: "Focus timer started — 25 min" (or appropriate label).
rm -f ~/.claude/.pomodoro_state ~/.claude/.pomodoro_notified
Confirm: "Focus timer stopped."
Read the state file, source it, compute remaining:
source ~/.claude/.pomodoro_state
remaining=$(( DURATION - ($(date +%s) - START_TIME) ))
Report remaining time and session type. If expired, say "Session complete — start a break with /focus break or a new session with /focus start." If no state file exists, say "No active focus session. Start one with /focus start."