# Block Timer Tracker Claude 5-hour conversation block tracker with visual countdown, expiration warnings, and color-coded indicators to prevent unexpected session terminations. --- ## Metadata **Title:** Block Timer Tracker **Category:** statuslines **Author:** JSONbored **Added:** October 2025 **Tags:** timer, session-block, countdown, 5-hour-limit, warnings, productivity **URL:** https://claudepro.directory/statuslines/block-timer-tracker ## Overview Claude 5-hour conversation block tracker with visual countdown, expiration warnings, and color-coded indicators to prevent unexpected session terminations. ## Content #!/usr/bin/env bash BLOCK TIMER TRACKER FOR CLAUDE CODE MONITORS CLAUDE'S 5-HOUR CONVERSATION BLOCK LIMIT WITH COUNTDOWN READ JSON FROM STDIN read -r input EXTRACT SESSION START TIME AND CURRENT TIMESTAMP session_start=$(echo "$input" | jq -r '.session.startTime // ""') current_time=$(date +%s) CALCULATE ELAPSED TIME IN SECONDS if [ -n "$session_start" ]; then startepoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$sessionstart" +%s 2>/dev/null || echo "$current_time") elapsed=$((currenttime - startepoch)) else elapsed=0 fi 5-HOUR BLOCK = SECONDS BLOCK_LIMIT= remaining=$((BLOCK_LIMIT - elapsed)) CONVERT TO HOURS:MINUTES:SECONDS hours=$((remaining / )) minutes=$(((remaining % ) / 60)) seconds=$((remaining % 60)) CALCULATE PERCENTAGE REMAINING if [ $BLOCK_LIMIT -gt 0 ]; then percent=$((remaining * / BLOCK_LIMIT)) else percent=0 fi COLOR CODES BASED ON TIME REMAINING if [ $percent -gt 50 ]; then # Green: > 2.5 hours remaining COLOR="\[38;5;46m" ICON="✓" elif [ $percent -gt 20 ]; then # Yellow: hours remaining COLOR="\[38;5;226m" ICON="⚠" elif [ $percent -gt 0 ]; then # Red: &2 elif [ $remaining -le 0 ]; then echo "✗ BLOCK EXPIRED: Start new conversation to continue." >&2 fi KEY FEATURES ? Real-time countdown from 5-hour conversation block limit ? Visual progress bar showing time remaining (20-character bar) ? Color-coded indicators: green (>50%), yellow (%), red (&2) for alerts. Check stderr visible in terminal. Test: bash statusline.sh 2>&1 | grep WARNING. Ensure percent calculation under 10 triggers warning. 4) Colors not displaying, showing escape codes instead Solution: Terminal may not support ANSI colors. Test: echo -e '\[38;5;46mGreen\[0m'. Enable color support in terminal settings. For screen/tmux ensure TERM=screen-256color or xterm-256color. 5) Countdown refreshing too slowly or appearing static Solution: Decrease refreshInterval to 1000ms (1 second) in configuration. Verify script executes on each refresh. Check system clock accurate: date. Test manual execution shows changing countdown. TECHNICAL DETAILS Documentation: https://docs.claude.com/en/docs/claude-code/statusline PREVIEW ✓ Block: [████████████████░░░░] 3h 42m 15s (74%) --- Source: Claude Pro Directory Website: https://claudepro.directory URL: https://claudepro.directory/statuslines/block-timer-tracker This content is optimized for Large Language Models (LLMs). For full formatting and interactive features, visit the website.