Install command
Not provided
Claude Code daily usage quota tracker showing percentage of daily limit consumed with visual progress bar, time remaining, and budget pacing indicators.
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
8/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
# Daily Usage Percentage Tracker for Claude Code
# Tracks progress toward daily usage limits
# Read JSON from stdin
read -r input
# Extract session cost
session_cost=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
# Daily usage tracking file (resets at midnight)
USAGE_DIR="${HOME}/.claude-code-usage"
mkdir -p "$USAGE_DIR"
# Get current date for daily reset
current_date=$(date +%Y-%m-%d)
USAGE_FILE="${USAGE_DIR}/daily-${current_date}.usage"
# Initialize usage file if doesn't exist
if [ ! -f "$USAGE_FILE" ]; then
echo "0" > "$USAGE_FILE"
fi
# Read cumulative daily usage
daily_usage=$(cat "$USAGE_FILE")
# Update with current session cost (simple addition)
# Note: This is per-session tracking, may need deduplication for accuracy
updated_usage=$(echo "$daily_usage + $session_cost" | bc)
echo "$updated_usage" > "$USAGE_FILE"
# CONFIGURABLE: Set your daily budget limit (default $10/day)
DAILY_LIMIT=10.00
# Calculate percentage of daily limit used
if (( $(echo "$DAILY_LIMIT > 0" | bc -l) )); then
usage_percentage=$(echo "scale=1; ($updated_usage * 100) / $DAILY_LIMIT" | bc)
else
usage_percentage=0
fi
# Convert to integer for comparisons
usage_percentage_int=$(echo "$usage_percentage / 1" | bc)
# Cap percentage at 100 for display (can exceed in practice)
if [ $usage_percentage_int -gt 100 ]; then
display_percentage=100
OVERFLOW=true
else
display_percentage=$usage_percentage_int
OVERFLOW=false
fi
# Calculate remaining budget
remaining=$(echo "$DAILY_LIMIT - $updated_usage" | bc)
# Color coding based on usage percentage
if [ $usage_percentage_int -lt 50 ]; then
USAGE_COLOR="\033[38;5;46m" # Green: <50% used
USAGE_ICON="✓"
USAGE_STATUS="ON TRACK"
elif [ $usage_percentage_int -lt 80 ]; then
USAGE_COLOR="\033[38;5;226m" # Yellow: 50-80% used
USAGE_ICON="⚠"
USAGE_STATUS="PACING HIGH"
elif [ $usage_percentage_int -lt 100 ]; then
USAGE_COLOR="\033[38;5;208m" # Orange: 80-100% used
USAGE_ICON="⏰"
USAGE_STATUS="NEAR LIMIT"
else
USAGE_COLOR="\033[38;5;196m" # Red: >100% used (over budget)
USAGE_ICON="✗"
USAGE_STATUS="OVER BUDGET"
fi
# Build progress bar (20 characters wide)
bar_filled=$(( display_percentage / 5 )) # Each char = 5%
bar_empty=$(( 20 - bar_filled ))
if [ $bar_filled -gt 0 ]; then
bar=$(printf "█%.0s" $(seq 1 $bar_filled))$(printf "░%.0s" $(seq 1 $bar_empty))
else
bar="░░░░░░░░░░░░░░░░░░░░"
fi
# Calculate hours remaining in day for pacing
current_hour=$(date +%H)
hours_remaining=$((24 - current_hour))
# Pacing indicator (are we on track for 24-hour period?)
expected_percentage=$(( (24 - hours_remaining) * 100 / 24 ))
if [ $usage_percentage_int -gt $expected_percentage ] && [ $hours_remaining -gt 0 ]; then
PACING="📈 ahead of pace"
elif [ $usage_percentage_int -lt $expected_percentage ] && [ $hours_remaining -gt 0 ]; then
PACING="📉 below pace"
else
PACING=""
fi
# Format remaining budget
if (( $(echo "$remaining > 0" | bc -l) )); then
remaining_display="\$${remaining} left"
else
remaining_display="\$0.00 left"
fi
RESET="\033[0m"
# Output statusline
if [ "$OVERFLOW" = true ]; then
echo -e "${USAGE_ICON} Daily: ${USAGE_COLOR}${bar}${RESET} ${usage_percentage}% | ${USAGE_STATUS} | ${remaining_display}"
else
echo -e "${USAGE_ICON} Daily: ${USAGE_COLOR}${bar}${RESET} ${usage_percentage}% | ${remaining_display} ${PACING}"
fi{
"statusLine": {
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/daily-usage-percentage-tracker.sh",
"refreshInterval": 2000
}
}{
"statusLine": {
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/statuslines/daily-usage-percentage-tracker.sh",
"refreshInterval": 2000
}
}
Extended version with session ID tracking to prevent duplicate cost additions
#!/usr/bin/env bash
# Enhanced Daily Usage Tracker with Session Deduplication
input=$(cat)
session_cost=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
session_id=$(echo "$input" | jq -r '.session_id // ""')
USAGE_DIR="${HOME}/.claude-code-usage"
mkdir -p "$USAGE_DIR"
current_date=$(date +%Y-%m-%d)
USAGE_FILE="${USAGE_DIR}/daily-${current_date}.usage"
SESSION_FILE="${USAGE_DIR}/daily-${current_date}.sessions"
# Initialize files if don't exist
if [ ! -f "$USAGE_FILE" ]; then
echo "0" > "$USAGE_FILE"
fi
if [ ! -f "$SESSION_FILE" ]; then
touch "$SESSION_FILE"
fi
# Check if session already tracked
if [ -n "$session_id" ] && grep -q "^$session_id:" "$SESSION_FILE" 2>/dev/null; then
# Session already tracked, don't add again
daily_usage=$(cat "$USAGE_FILE")
else
# New session, add cost and track session
daily_usage=$(cat "$USAGE_FILE")
updated_usage=$(echo "$daily_usage + $session_cost" | bc 2>/dev/null || echo "$daily_usage")
echo "$updated_usage" > "$USAGE_FILE"
if [ -n "$session_id" ]; then
echo "$session_id:$session_cost" >> "$SESSION_FILE"
fi
fi
DAILY_LIMIT=${DAILY_USAGE_LIMIT:-10.00}
if (( $(echo "$DAILY_LIMIT > 0" | bc -l 2>/dev/null || echo "0") )); then
usage_percentage=$(echo "scale=1; ($daily_usage * 100) / $DAILY_LIMIT" | bc 2>/dev/null || echo "0")
else
usage_percentage=0
fi
usage_percentage_int=$(echo "$usage_percentage / 1" | bc 2>/dev/null || echo "0")
if [ $usage_percentage_int -lt 50 ]; then
USAGE_COLOR="\033[38;5;46m"
USAGE_ICON="✓"
elif [ $usage_percentage_int -lt 80 ]; then
USAGE_COLOR="\033[38;5;226m"
USAGE_ICON="⚠"
elif [ $usage_percentage_int -lt 100 ]; then
USAGE_COLOR="\033[38;5;208m"
USAGE_ICON="⏰"
else
USAGE_COLOR="\033[38;5;196m"
USAGE_ICON="✗"
fi
bar_filled=$((usage_percentage_int / 5))
bar_empty=$((20 - bar_filled))
if [ $bar_filled -gt 0 ]; then
bar=$(printf "█%.0s" $(seq 1 $bar_filled))$(printf "░%.0s" $(seq 1 $bar_empty))
else
bar="░░░░░░░░░░░░░░░░░░░░"
fi
remaining=$(echo "$DAILY_LIMIT - $daily_usage" | bc 2>/dev/null || echo "$DAILY_LIMIT")
if (( $(echo "$remaining > 0" | bc -l 2>/dev/null || echo "0") )); then
remaining_display="$${remaining} left"
else
remaining_display="$0.00 left"
fi
RESET="\033[0m"
echo -e "${USAGE_ICON} Daily: ${USAGE_COLOR}${bar}${RESET} ${usage_percentage}% | ${remaining_display}"
Configurable daily budget limit via environment variable
#!/usr/bin/env bash
# Daily Usage Tracker with Custom Budget Limit
DAILY_LIMIT=${DAILY_USAGE_LIMIT:-10.00}
input=$(cat)
session_cost=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
USAGE_DIR="${HOME}/.claude-code-usage"
mkdir -p "$USAGE_DIR"
current_date=$(date +%Y-%m-%d)
USAGE_FILE="${USAGE_DIR}/daily-${current_date}.usage"
if [ ! -f "$USAGE_FILE" ]; then
echo "0" > "$USAGE_FILE"
fi
daily_usage=$(cat "$USAGE_FILE" 2>/dev/null || echo "0")
updated_usage=$(echo "$daily_usage + $session_cost" | bc 2>/dev/null || echo "$daily_usage")
echo "$updated_usage" > "$USAGE_FILE"
if (( $(echo "$DAILY_LIMIT > 0" | bc -l 2>/dev/null || echo "0") )); then
usage_percentage=$(echo "scale=1; ($updated_usage * 100) / $DAILY_LIMIT" | bc 2>/dev/null || echo "0")
else
usage_percentage=0
fi
usage_percentage_int=$(echo "$usage_percentage / 1" | bc 2>/dev/null || echo "0")
if [ $usage_percentage_int -lt 50 ]; then
USAGE_COLOR="\033[38;5;46m"
USAGE_ICON="✓"
elif [ $usage_percentage_int -lt 80 ]; then
USAGE_COLOR="\033[38;5;226m"
USAGE_ICON="⚠"
elif [ $usage_percentage_int -lt 100 ]; then
USAGE_COLOR="\033[38;5;208m"
USAGE_ICON="⏰"
else
USAGE_COLOR="\033[38;5;196m"
USAGE_ICON="✗"
fi
bar_filled=$((usage_percentage_int / 5))
bar_empty=$((20 - bar_filled))
if [ $bar_filled -gt 0 ]; then
bar=$(printf "█%.0s" $(seq 1 $bar_filled))$(printf "░%.0s" $(seq 1 $bar_empty))
else
bar="░░░░░░░░░░░░░░░░░░░░"
fi
remaining=$(echo "$DAILY_LIMIT - $updated_usage" | bc 2>/dev/null || echo "$DAILY_LIMIT")
if (( $(echo "$remaining > 0" | bc -l 2>/dev/null || echo "0") )); then
remaining_display="$${remaining} left"
else
remaining_display="$0.00 left"
fi
RESET="\033[0m"
echo -e "${USAGE_ICON} Daily: ${USAGE_COLOR}${bar}${RESET} ${usage_percentage}% | ${remaining_display} (limit: $${DAILY_LIMIT})"
Complete setup script with usage directory creation and bc verification
#!/bin/bash
# Installation script for Daily Usage Percentage Tracker
mkdir -p .claude/statuslines
# Check for bc (required for floating point calculations)
if ! command -v bc &> /dev/null; then
echo "Installing bc for floating point calculations..."
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install bc
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt-get install -y bc || sudo yum install -y bc
else
echo "Please install bc manually: https://www.gnu.org/software/bc/"
fi
fi
# Create usage directory
mkdir -p ~/.claude-code-usage
echo "Usage directory created: ~/.claude-code-usage"
cat > .claude/statuslines/daily-usage-percentage-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/daily-usage-percentage-tracker.sh
# Add to settings.json
if [ ! -f .claude/settings.json ]; then
echo '{"statusLine":{"type":"command","command":"$CLAUDE_PROJECT_DIR/.claude/statuslines/daily-usage-percentage-tracker.sh","refreshInterval":2000}}' > .claude/settings.json
else
jq '.statusLine = {"type":"command","command":"$CLAUDE_PROJECT_DIR/.claude/statuslines/daily-usage-percentage-tracker.sh","refreshInterval":2000}' .claude/settings.json > .claude/settings.json.tmp
mv .claude/settings.json.tmp .claude/settings.json
fi
echo "Daily Usage Percentage Tracker installed successfully!"
echo "Note: Set custom daily limit: export DAILY_USAGE_LIMIT=25.00 (default: $10/day)"
echo "Usage files stored in: ~/.claude-code-usage/"
Verify cost.total_cost_usd field exists: echo '$input' | jq .cost.total_cost_usd. Check usage file exists: cat ~/.claude-code-usage/daily-$(date +%Y-%m-%d).usage. Ensure bc is installed: which bc. Script uses simple addition - may need session deduplication for accuracy across multiple statusline updates. Verify file is writable: touch ~/.claude-code-usage/test && rm ~/.claude-code-usage/test.
Default DAILY_LIMIT is $10.00. Configure your actual limit in script: DAILY_LIMIT=25.00 (for $25/day budget) or export DAILY_USAGE_LIMIT=25.00. Verify limit calculation: usage_percentage = (updated_usage * 100) / DAILY_LIMIT. Check usage file value matches expected spending: cat ~/.claude-code-usage/daily-$(date +%Y-%m-%d).usage.
Script uses date-based filenames: daily-YYYY-MM-DD.usage. Each new day creates new file automatically. Old files remain for history. Check current file: ls ~/.claude-code-usage/daily-*.usage. If date command timezone incorrect, reset may occur at wrong time. Verify: date +%Y-%m-%d. Check system timezone: timedatectl (Linux) or systemsetup -gettimezone (macOS).
Pacing compares actual usage % vs expected % based on hours elapsed. Formula: expected = (24 - hours_remaining) * 100 / 24. At noon (12 hours), expected is 50%. If actual usage is 40%, shows 'below pace'. Adjust logic if you have non-24-hour daily windows. Verify current_hour calculation: date +%H. Check hours_remaining calculation: hours_remaining=$((24 - current_hour)).
Remaining = DAILY_LIMIT - updated_usage. If negative, script displays '$0.00 left' and OVER BUDGET status. Verify DAILY_LIMIT setting matches your actual budget. Check updated_usage calculation: cat ~/.claude-code-usage/daily-$(date +%Y-%m-%d).usage. bc arithmetic: echo '$DAILY_LIMIT - $updated_usage' | bc. Ensure bc is working: echo '10.00 - 4.50' | bc (should return 5.50).
Script adds session_cost every update - can over-count if same session updates multiple times. For accuracy, track by unique session_id and update (don't add) session totals. Use enhanced version with session deduplication. Alternative: integrate with official usage API if available. Current implementation optimized for real-time awareness, not perfect accounting. Check session_id exists: echo '$input' | jq .session_id.
Verify usage_percentage calculation: usage_percentage=$(echo "scale=1; ($updated_usage * 100) / $DAILY_LIMIT" | bc). Check bar_filled calculation: bar_filled=$((usage_percentage_int / 5)) (each char = 5%). Test: usage=50%; bar_filled=$((50 / 5)); echo $bar_filled (should be 10). Verify Unicode block characters work: echo '█░'.
Check home directory writable: touch ~/test && rm ~/test. Verify ~/.claude-code-usage directory exists: mkdir -p ~/.claude-code-usage. Check directory permissions: ls -ld ~/.claude-code-usage. Ensure script has permission to create files: touch ~/.claude-code-usage/test && rm ~/.claude-code-usage/test. Check disk space: df -h ~.
Show that Daily Usage Percentage 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/daily-usage-percentage-tracker)Daily Usage Percentage Tracker - Statuslines side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Claude Code daily usage quota tracker showing percentage of daily limit consumed with visual progress bar, time remaining, and budget pacing indicators. 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 | Claude 5-hour conversation block tracker with visual countdown, expiration warnings, and color-coded indicators to prevent unexpected session terminations. Open dossier | Multi-provider AI performance dashboard with context occupancy tracking, truncation warnings, TTFT latency, tokens/min rate, and model comparison 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-25 | 2025-10-25 | 2025-10-23 | 2025-10-23 |
| 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. | ✓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. | ✓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. | ✓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. | ✓Reads the Claude Code statusline JSON from stdin (model, token usage, context occupancy) and renders it in the local terminal; it does not send data off-machine. |
| Prerequisites |
|
|
|
|
| Install | — | — | — | — |
| Config | | | | |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.