Install command
Not provided
Claude 5-hour conversation block tracker with visual countdown, expiration warnings, and color-coded indicators to prevent unexpected session terminations.
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
0
78
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as source-backed.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
No package verification flag provided.
Checksum metadata
No checksum provided for downloaded artifact.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Not provided
Config snippet
Provided
Copy snippet
Provided
Prerequisites
6 to clear
Platforms
1 listed
Difficulty
5/100
Adoption plan
Current risk score 16/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes are present.
Verify package integrity metadata
No package verification/checksum metadata.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (5/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are present.
Optional in this preset
Package integrity metadata is missing.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
5/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are available.
verify
Package integrity metadata is missing.
rollout
Install payload is available.
No required blockers for this timeline preset.
Prerequisite readiness
6 prerequisites to line up before setup.
Safety & privacy surface
1 safety and 1 privacy notes across 1 risk area. Review closely: credentials & tokens.
#!/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
start_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$session_start" +%s 2>/dev/null || echo "$current_time")
elapsed=$((current_time - start_epoch))
else
elapsed=0
fi
# 5-hour block = 18000 seconds
BLOCK_LIMIT=18000
remaining=$((BLOCK_LIMIT - elapsed))
# Convert to hours:minutes:seconds
hours=$((remaining / 3600))
minutes=$(((remaining % 3600) / 60))
seconds=$((remaining % 60))
# Calculate percentage remaining
if [ $BLOCK_LIMIT -gt 0 ]; then
percent=$((remaining * 100 / BLOCK_LIMIT))
else
percent=0
fi
# Color codes based on time remaining
if [ $percent -gt 50 ]; then
# Green: > 2.5 hours remaining
COLOR="\033[38;5;46m"
ICON="✓"
elif [ $percent -gt 20 ]; then
# Yellow: 1-2.5 hours remaining
COLOR="\033[38;5;226m"
ICON="⚠"
elif [ $percent -gt 0 ]; then
# Red: < 1 hour remaining
COLOR="\033[38;5;196m"
ICON="⚠"
else
# Expired
COLOR="\033[38;5;160m"
ICON="✗"
fi
RESET="\033[0m"
# Progress bar (20 chars)
bar_filled=$((percent / 5))
bar_empty=$((20 - bar_filled))
bar=""
for ((i=0; i<bar_filled; i++)); do bar+="█"; done
for ((i=0; i<bar_empty; i++)); do bar+="░"; done
# Format time display
if [ $remaining -gt 0 ]; then
time_display=$(printf "%dh %02dm %02ds" $hours $minutes $seconds)
else
time_display="EXPIRED"
fi
# Build statusline
echo -e "${COLOR}${ICON} Block: [${bar}] ${time_display} (${percent}%)${RESET}"
# Warning messages (stderr for alerts)
if [ $percent -le 10 ] && [ $percent -gt 0 ]; then
echo "⚠ WARNING: Less than 30 minutes remaining in conversation block!" >&2
elif [ $remaining -le 0 ]; then
echo "✗ BLOCK EXPIRED: Start new conversation to continue." >&2
fi{
"statusLine": {
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/block-timer-tracker.sh",
"refreshInterval": 1000
}
}{
"statusLine": {
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/block-timer-tracker.sh",
"refreshInterval": 1000
}
}
Extended version with configurable block limit via environment variable
#!/usr/bin/env bash
# Block Timer Tracker with Custom Block Limit
# Configure via BLOCK_LIMIT_SECONDS environment variable (default: 18000 = 5 hours)
BLOCK_LIMIT=${BLOCK_LIMIT_SECONDS:-18000}
input=$(cat)
session_start=$(echo "$input" | jq -r '.session.startTime // ""')
current_time=$(date +%s)
if [ -n "$session_start" ]; then
start_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$session_start" +%s 2>/dev/null || date -d "$session_start" +%s 2>/dev/null || echo "$current_time")
elapsed=$((current_time - start_epoch))
else
elapsed=0
fi
remaining=$((BLOCK_LIMIT - elapsed))
hours=$((remaining / 3600))
minutes=$(((remaining % 3600) / 60))
seconds=$((remaining % 60))
if [ $BLOCK_LIMIT -gt 0 ]; then
percent=$((remaining * 100 / BLOCK_LIMIT))
else
percent=0
fi
if [ $percent -gt 50 ]; then
COLOR="\033[38;5;46m"
ICON="✓"
elif [ $percent -gt 20 ]; then
COLOR="\033[38;5;226m"
ICON="⚠"
elif [ $percent -gt 0 ]; then
COLOR="\033[38;5;196m"
ICON="⚠"
else
COLOR="\033[38;5;160m"
ICON="✗"
fi
RESET="\033[0m"
bar_filled=$((percent / 5))
bar_empty=$((20 - bar_filled))
bar=""
for ((i=0; i<bar_filled; i++)); do bar+="█"; done
for ((i=0; i<bar_empty; i++)); do bar+="░"; done
if [ $remaining -gt 0 ]; then
time_display=$(printf "%dh %02dm %02ds" $hours $minutes $seconds)
else
time_display="EXPIRED"
fi
echo -e "${COLOR}${ICON} Block: [${bar}] ${time_display} (${percent}%)${RESET}"
if [ $percent -le 10 ] && [ $percent -gt 0 ]; then
echo "⚠ WARNING: Less than ${BLOCK_LIMIT} seconds remaining!" >&2
elif [ $remaining -le 0 ]; then
echo "✗ BLOCK EXPIRED: Start new conversation to continue." >&2
fi
Enhanced version with configurable warning thresholds at different time intervals
#!/usr/bin/env bash
# Block Timer with Multiple Warning Thresholds
WARN_50_PERCENT=${WARN_50_PERCENT:-true}
WARN_25_PERCENT=${WARN_25_PERCENT:-true}
WARN_10_PERCENT=${WARN_10_PERCENT:-true}
BLOCK_LIMIT=18000
input=$(cat)
session_start=$(echo "$input" | jq -r '.session.startTime // ""')
current_time=$(date +%s)
if [ -n "$session_start" ]; then
start_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$session_start" +%s 2>/dev/null || date -d "$session_start" +%s 2>/dev/null || echo "$current_time")
elapsed=$((current_time - start_epoch))
else
elapsed=0
fi
remaining=$((BLOCK_LIMIT - elapsed))
hours=$((remaining / 3600))
minutes=$(((remaining % 3600) / 60))
seconds=$((remaining % 60))
if [ $BLOCK_LIMIT -gt 0 ]; then
percent=$((remaining * 100 / BLOCK_LIMIT))
else
percent=0
fi
if [ $percent -gt 50 ]; then
COLOR="\033[38;5;46m"
ICON="✓"
elif [ $percent -gt 20 ]; then
COLOR="\033[38;5;226m"
ICON="⚠"
elif [ $percent -gt 0 ]; then
COLOR="\033[38;5;196m"
ICON="⚠"
else
COLOR="\033[38;5;160m"
ICON="✗"
fi
RESET="\033[0m"
bar_filled=$((percent / 5))
bar_empty=$((20 - bar_filled))
bar=""
for ((i=0; i<bar_filled; i++)); do bar+="█"; done
for ((i=0; i<bar_empty; i++)); do bar+="░"; done
if [ $remaining -gt 0 ]; then
time_display=$(printf "%dh %02dm %02ds" $hours $minutes $seconds)
else
time_display="EXPIRED"
fi
echo -e "${COLOR}${ICON} Block: [${bar}] ${time_display} (${percent}%)${RESET}"
# Multiple warning thresholds
if [ "$WARN_50_PERCENT" = "true" ] && [ $percent -le 50 ] && [ $percent -gt 25 ]; then
echo "⚠ 50% remaining: ~2.5 hours left" >&2
fi
if [ "$WARN_25_PERCENT" = "true" ] && [ $percent -le 25 ] && [ $percent -gt 10 ]; then
echo "⚠ 25% remaining: ~1.25 hours left" >&2
fi
if [ "$WARN_10_PERCENT" = "true" ] && [ $percent -le 10 ] && [ $percent -gt 0 ]; then
echo "⚠ 10% remaining: ~30 minutes left" >&2
fi
if [ $remaining -le 0 ]; then
echo "✗ BLOCK EXPIRED: Start new conversation to continue." >&2
fi
Complete setup script with date command verification
#!/bin/bash
# Installation script for Block Timer Tracker
mkdir -p .claude/statuslines
# Verify date command supports epoch conversion
if ! date +%s &> /dev/null; then
echo "Error: date command does not support epoch conversion"
exit 1
fi
# Test date parsing (macOS vs Linux)
TEST_DATE="2025-10-23T10:00:00Z"
if date -j -f "%Y-%m-%dT%H:%M:%SZ" "$TEST_DATE" +%s &> /dev/null; then
echo "macOS date format detected"
elif date -d "$TEST_DATE" +%s &> /dev/null; then
echo "Linux date format detected"
else
echo "Warning: Date parsing may not work correctly on this system"
fi
cat > .claude/statuslines/block-timer-tracker.sh << 'SCRIPT_EOF'
#!/usr/bin/env bash
# Paste the full statusline script from the primary example above before running this installer.
SCRIPT_EOF
chmod +x .claude/statuslines/block-timer-tracker.sh
# Add to settings.json
if [ ! -f .claude/settings.json ]; then
echo '{"statusLine":{"type":"command","command":"$CLAUDE_PROJECT_DIR/.claude/statuslines/block-timer-tracker.sh","refreshInterval":1000}}' > .claude/settings.json
else
jq '.statusLine = {"type":"command","command":"$CLAUDE_PROJECT_DIR/.claude/statuslines/block-timer-tracker.sh","refreshInterval":1000}' .claude/settings.json > .claude/settings.json.tmp
mv .claude/settings.json.tmp .claude/settings.json
fi
echo "Block Timer Tracker installed successfully!"
echo "Note: Script refreshes every 1 second to show real-time countdown."
Check session.startTime exists in JSON input: echo '$input' | jq .session.startTime. Verify date parsing: macOS (date -j -f '%Y-%m-%dT%H:%M:%SZ' '2025-10-23T10:00:00Z' +%s) or Linux (date -d '2025-10-23T10:00:00Z' +%s). On Linux use -d instead of -j flag. Test date parsing: echo '2025-10-23T10:00:00Z' | xargs -I {} date -j -f '%Y-%m-%dT%H:%M:%SZ' {} +%s (macOS) or date -d {} +%s (Linux).
Verify BLOCK_LIMIT=18000 (5 hours in seconds). Check percent calculation: echo $((remaining * 100 / BLOCK_LIMIT)). Ensure remaining time calculated correctly from session start. Test: remaining=$((18000 - 9000)); percent=$((remaining * 100 / 18000)); echo $percent (should be 50). Verify bar_filled calculation: bar_filled=$((percent / 5)) (each char = 5%).
Warnings output to stderr (>&2) for alerts. Check stderr visible in terminal. Test: bash statusline.sh 2>&1 | grep WARNING. Ensure percent calculation under 10 triggers warning: if [ $percent -le 10 ] && [ $percent -gt 0 ]. Verify warning condition logic. Check terminal emulator displays stderr output.
Terminal may not support ANSI colors. Test: echo -e '\033[38;5;46mGreen\033[0m'. Enable color support in terminal settings. For screen/tmux ensure TERM=screen-256color or xterm-256color. Verify echo -e flag is used for escape sequence interpretation. Check terminal emulator color support settings.
Decrease refreshInterval to 1000ms (1 second) in configuration: {"refreshInterval": 1000}. Verify script executes on each refresh. Check system clock accurate: date. Test manual execution shows changing countdown: Run script multiple times with different current_time values. Verify Claude Code is calling script on each refresh interval.
This indicates elapsed time exceeds BLOCK_LIMIT. Check elapsed calculation: elapsed=$((current_time - start_epoch)). Verify start_epoch is correct (not future time). Add protection: if [ $remaining -lt 0 ]; then remaining=0; fi. Check system clock is accurate and not set to future time.
Verify terminal supports Unicode characters. Test: echo '█░'. Check terminal font includes block characters. Some terminals require UTF-8 locale: export LANG=en_US.UTF-8. Alternative: Use ASCII characters: # for filled, - for empty. Verify echo command supports Unicode output.
Verify integer division is working correctly: echo $((100 * 50 / 100)) (should be 50). Check remaining and BLOCK_LIMIT are numeric: echo "$remaining" | grep -E '^[0-9]+$'. Ensure BLOCK_LIMIT > 0 before division. Test calculation: percent=$((remaining * 100 / BLOCK_LIMIT)). Check for integer overflow if values are very large.
Show that Block Timer Tracker - Statuslines is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/statuslines/block-timer-tracker)Block Timer Tracker - Statuslines side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Claude 5-hour conversation block tracker with visual countdown, expiration warnings, and color-coded indicators to prevent unexpected session terminations. Open dossier | Claude Code statusline that reads the active model identifier from session input and displays real-time token usage as a percentage of the context window, with green/yellow/red color-coded warnings. Open dossier | A Claude Code statusline script (bash) that reads cost.total_duration_ms from the statusline JSON on stdin via jq, converts it to elapsed minutes, and renders a 20-character progress bar, a percent-used figure, and a countdown against a 300-minute (5-hour) ceiling, with green/yellow/red ANSI color coding at the 50%. Open dossier | Time-tracking statusline showing elapsed session duration, tokens per minute rate, and estimated cost with productivity metrics Open dossier |
|---|---|---|---|---|
| Next steps | ||||
| Trust | ||||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trust | Package not verified | Package not verified | Package not verified | Package not verified |
| Source provenance | Source-backed | Source-backed | Source-backed | Source-backed |
| Submitter | — | — | — | — |
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Brand | — | — | — | — |
| Category | statuslines | statuslines | statuslines | statuslines |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | JSONbored | JSONbored | JSONbored | JSONbored |
| Added | 2025-10-23 | 2025-10-16 | 2025-10-25 | 2025-10-01 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | ✓Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session. | ✓Reads session JSON from stdin and writes formatted text to stdout only; does not modify files or make network calls. | ✓The installation example runs package-manager commands with elevated privileges (brew install jq, sudo apt-get/yum install jq) and writes an executable script plus statusLine config into .claude/. Review it before running. The installation example overwrites the statusLine key in .claude/settings.json (via a jq rewrite and mv), which replaces any existing statusline configuration. The statusline command executes on every refresh (refreshInterval 1000ms) and shells out to jq and seq each time. | ✓Runs as a Claude Code statusline command on every refresh and depends on the local shell environment; a failure only affects status rendering, not your session. |
| Privacy notes | ✓Reads the Claude Code statusline JSON from stdin (model, workspace path, token usage) and renders it in the local terminal; it does not send data off-machine. | ✓Processes token counts and model identifiers from the local Claude Code session input; no data is sent externally. | ✓The enhanced example writes per-session timestamp files keyed by session_id into ~/.claude-code-windows on local disk; these persist until manually deleted. The script parses the statusline JSON Claude Code passes on stdin (session_id, cost.total_duration_ms); it stays local and makes no network calls. | ✓Reads the Claude Code statusline JSON from stdin (model, workspace path, token usage) and renders it in the local terminal; it does not send data off-machine. |
| Prerequisites |
|
|
|
|
| Install | — | — | — | — |
| Config | | | | |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Source-backed guides for putting this to work.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.