# Lines Per Minute Tracker Real-time coding velocity monitor tracking lines added/removed per minute with productivity scoring and daily output projection for Claude Code sessions. --- ## Metadata **Title:** Lines Per Minute Tracker **Category:** statuslines **Author:** JSONbored **Added:** October 2025 **Tags:** productivity, velocity, coding-speed, lines-per-minute, output-tracking **URL:** https://claudepro.directory/statuslines/lines-per-minute-tracker ## Overview Real-time coding velocity monitor tracking lines added/removed per minute with productivity scoring and daily output projection for Claude Code sessions. ## Content #!/usr/bin/env bash LINES PER MINUTE PRODUCTIVITY TRACKER FOR CLAUDE CODE CALCULATES CODING VELOCITY AND PRODUCTIVITY METRICS READ JSON FROM STDIN read -r input EXTRACT VALUES linesadded=$(echo "$input" | jq -r '.cost.totallines_added // 0') linesremoved=$(echo "$input" | jq -r '.cost.totallines_removed // 0') totaldurationms=$(echo "$input" | jq -r '.cost.totaldurationms // 1') CALCULATE DURATION IN MINUTES (AVOID DIVISION BY ZERO) if [ "$totaldurationms" -gt 0 ]; then durationminutes=$(echo "scale=2; $totalduration_ms / " | bc) else duration_minutes= # Prevent division by zero fi CALCULATE NET LINES (ADDED - REMOVED) netlines=$((linesadded - lines_removed)) CALCULATE TOTAL CHANGED LINES (ADDED + REMOVED) totalchanged=$((linesadded + lines_removed)) CALCULATE LINES PER MINUTE if (( $(echo "$duration_minutes > 0" | bc -l) )); then addedpermin=$(echo "scale=1; $linesadded / $durationminutes" | bc) removedpermin=$(echo "scale=1; $linesremoved / $durationminutes" | bc) netpermin=$(echo "scale=1; $netlines / $durationminutes" | bc) totalpermin=$(echo "scale=1; $totalchanged / $durationminutes" | bc) else addedpermin=0 removedpermin=0 netpermin=0 totalpermin=0 fi PRODUCTIVITY SCORING BASED ON TOTAL CHANGES PER MINUTE if (( $(echo "$totalpermin > 50" | bc -l) )); then PROD_COLOR="\[38;5;46m" # Green: High productivity (>50 lines/min) PROD_ICON="🚀" PROD_RATING="HIGH" elif (( $(echo "$totalpermin > 20" | bc -l) )); then PROD_COLOR="\[38;5;226m" # Yellow: Medium productivity ( lines/min) PROD_ICON="📝" PROD_RATING="MED" else PROD_COLOR="\[38;5;75m" # Blue: Low/steady productivity ( 0" | bc -l) )); then dailyprojection=$(echo "scale=0; $netper_min * " | bc) else daily_projection=0 fi RESET="\[0m" FORMAT OUTPUT WITH NET LINES INDICATOR if [ $net_lines -lt 0 ]; then netdisplay="${netlines}" net_label="(refactoring)" else netdisplay="+${netlines}" net_label="(growth)" fi OUTPUT STATUSLINE echo -e "${PRODICON} ${PRODRATING}: ${PRODCOLOR}${totalpermin} L/min${RESET} | +${addedpermin} -${removedpermin} | Net: ${netdisplay} ${netlabel} | 📅 ${dailyprojection} L/day" KEY FEATURES ? Real-time lines per minute calculation for added, removed, and net changes ? Productivity scoring based on total change velocity (high >50 L/min, medium , low totallinesadded. This is EXPECTED for refactoring/cleanup sessions. Script correctly labels as '(refactoring)'. If unexpected, verify you're looking at correct session - multi-file refactors often have more deletions than additions. 4) Productivity rating stuck at LOW despite high activity Solution: Productivity rating is based on TOTAL changes (added + removed), not net lines. Thresholds: 50 = HIGH. Check totalpermin calculation: (linesadded + linesremoved) / duration_minutes. Adjust thresholds if your baseline velocity differs. 5) bc: command not found when calculating velocity Solution: Install bc: brew install bc (macOS), apt install bc (Linux). Alternative: use integer math with awk: awk -v added=$linesadded -v dur=$durationminutes 'BEGIN {print added/dur}' - loses decimal precision but works without bc. TECHNICAL DETAILS Documentation: https://docs.claude.com/en/docs/claude-code/statusline PREVIEW 🚀 HIGH: L/min | + -7.1 | Net: + (growth) | 📅 21, L/day --- Source: Claude Pro Directory Website: https://claudepro.directory URL: https://claudepro.directory/statuslines/lines-per-minute-tracker This content is optimized for Large Language Models (LLMs). For full formatting and interactive features, visit the website.