tmux Pomodoro

A break timer in your status bar. The Pomodoro technique is 25 minutes of focused work, a 5-minute break, and a longer break after four rounds. Your tmux status bar is the one place you look all day, which makes it a good home for the countdown.

Two working setups below: the tmux-pomodoro-plus plugin if you already use TPM, or a 40-line shell script with no dependencies. Then what to actually do with the five minutes.

01 PLUGIN OR SCRIPT

tmux-pomodoro-plus

  • +Pause, skip, restart and a timer menu
  • +Long break after a set number of rounds
  • +Desktop notifications and sound on macOS and Linux
  • ~Needs TPM; takes over prefix p by default

DIY script

  • +One file, plain bash, nothing to install
  • +Focus and break switch automatically
  • +Easy to change: it's your code
  • ~No pause or long breaks unless you add them

02 OPTION A: TMUX-POMODORO-PLUS

olimorris/tmux-pomodoro-plus is the maintained fork of the original tmux-pomodoro plugin. Install it with TPM: add the plugin line above the run line, then press prefix I to fetch it.

# ~/.tmux.conf
set -g @plugin 'olimorris/tmux-pomodoro-plus'

set -g @pomodoro_mins 25                 # focus length
set -g @pomodoro_break_mins 5            # short break
set -g @pomodoro_intervals 4             # rounds before a long break
set -g @pomodoro_long_break_mins 15      # long break
set -g @pomodoro_granularity 'on'        # show 24:59 instead of 25m
set -g @pomodoro_notifications 'on'      # desktop notification when a timer ends
set -g @pomodoro_interval_display '[%s/%s]'

set -g status-interval 1                 # redraw every second for the live countdown
set -g status-right '#{pomodoro_status} %H:%M'

run '~/.tmux/plugins/tpm/tpm'
KeysAction
prefix pStart, or pause and resume, a Pomodoro or break
prefix PCancel
prefix _Skip the current Pomodoro or break
prefix eRestart the Pomodoro
prefix C-pOpen the timer menu
prefix M-pSet a custom duration

Watch the key clash

prefix p is tmux's default for "previous window". If you use it, move the toggle with set -g @pomodoro_toggle 'y'; the menu and custom-time keys follow the toggle key (prefix C-y, prefix M-y), and none of the three is bound in a default tmux. On Linux, notifications need notify-send (package libnotify-bin).

03 OPTION B: A 40-LINE SCRIPT

The script keeps its state in two tmux user options (@pomodoro_mode and @pomodoro_end, a Unix timestamp), so it needs no temp files and the timer survives detaching. The status bar calls it every second; when a focus block ends it shows a message and starts the break, and when the break ends it clears itself. Save it as ~/.tmux/pomodoro.sh and run chmod +x ~/.tmux/pomodoro.sh.

#!/usr/bin/env bash
# ~/.tmux/pomodoro.sh  start | break | stop | status
WORK_MIN=${POMODORO_WORK_MIN:-25}
BREAK_MIN=${POMODORO_BREAK_MIN:-5}

now() { date +%s; }
get() { tmux show-option -gqv "@pomodoro_$1"; }
put() { tmux set-option -gq "@pomodoro_$1" "$2"; }

case "$1" in
  start)
    put mode focus
    put end $(( $(now) + WORK_MIN * 60 ))
    ;;
  break)
    put mode break
    put end $(( $(now) + BREAK_MIN * 60 ))
    ;;
  stop)
    tmux set-option -gqu @pomodoro_mode
    tmux set-option -gqu @pomodoro_end
    ;;
  status)
    mode=$(get mode)
    [ -z "$mode" ] && exit 0
    left=$(( $(get end) - $(now) ))
    if [ "$left" -le 0 ]; then
      if [ "$mode" = focus ]; then
        tmux display-message -d 5000 "Pomodoro done. Take a ${BREAK_MIN}-minute break."
        "$0" break
      else
        tmux display-message -d 5000 "Break over. Back to it."
        "$0" stop
      fi
      exit 0
    fi
    printf '%s %02d:%02d' "$mode" $(( left / 60 )) $(( left % 60 ))
    ;;
esac

Wire it into ~/.tmux.conf:

set -g status-interval 1
set -g status-right '#[fg=colour208]#(~/.tmux/pomodoro.sh status)#[default] %H:%M'

bind P run-shell '~/.tmux/pomodoro.sh start'   # prefix P: start 25 minutes
bind O run-shell '~/.tmux/pomodoro.sh stop'    # prefix O: stop the timer

# Optional: different lengths
set-environment -g POMODORO_WORK_MIN 50
set-environment -g POMODORO_BREAK_MIN 10
  • Reload (how), press prefix P, and focus 24:59 appears on the right of the status bar.
  • P and O are unbound in a default tmux, so nothing is overwritten.
  • Status commands only run while a client is attached. Detach mid-Pomodoro and the timer keeps its end time; when you reattach it catches up, switching to the break or clearing itself.
  • display-message -d needs tmux 3.2 or newer. On older versions drop -d 5000.
  • Want a sound? Add afplay /System/Library/Sounds/Glass.aiff & (macOS) or paplay (Linux) next to each display-message.

For colours, separators and other segments, see customizing the tmux status bar.

04 WHAT TO DO IN YOUR 5-MINUTE BREAK

The timer is the easy part. A break spent on Slack or a news tab is just more screen time with a different tab, and you come back as tired as you left. Five minutes is enough for three things that actually reset you:

1. Stand up and move

Walk to refill your water, stretch your shoulders and the back of your neck, roll your wrists. Getting out of the chair is the point.

2. Rest your eyes

Look at something at least 6 metres (20 feet) away for 20 seconds or more, ideally out of a window. Your eyes have been focused at arm's length for 25 minutes.

3. Breathe on purpose

Two minutes of slow breathing is the quickest way to come down from a tense debugging session. Pick one of the two patterns below.

TechniquePatternHow long
Box breathingIn for 4, hold for 4, out for 4, hold for 44 to 6 rounds, about 1.5 minutes
4-7-8In through the nose for 4, hold for 7, out through the mouth for 84 rounds; start with fewer if the hold feels long

If you'd like the counts in front of you rather than in your head, keep a printed sheet next to the keyboard. Our sister site has box breathing and 4-7-8, one page you can print, with a few other techniques for when those don't suit you.

The long break

After four rounds, take 15 to 30 minutes away from the desk. A short walk outside does more than anything you can do in the chair. Start a long build or a test suite before you go, and let tmux's silence alerts tell you it's done when you're back.

05 MAKING IT STICK

  • Start the timer with the task, not before it. Bind it to the same habit that opens your work, for example starting it right after you attach to the project's session.
  • Use breaks while machines work. Kick off the slow thing (a build, a deploy, a coding agent's long task) at the end of a focus block. If you run agents in tmux, set up alerts for when Claude Code is waiting so a break doesn't leave it stuck on a prompt.
  • Don't fight the length. 25/5 is a starting point. Many programmers settle on 50/10 for deep work; change two numbers and keep going.
  • Count rounds, not hours. The plugin's [%s/%s] display makes "four rounds before lunch" a target you can see.
TmuxAI Logo

AI Powered, Non-Intrusive Terminal Assistant

TmuxAI enhances your terminal with AI-powered commands, automation, and contextual awareness while preserving your existing workflow. It's open-source, privacy-focused, and can be used with any terminal emulator.

curl -fsSL https://get.tmuxai.dev | bash