This commit is contained in:
Daniel Newman 2026-05-15 12:53:11 -04:00
commit bdb23e00d7
3 changed files with 18 additions and 4 deletions

View file

@ -1,5 +1,7 @@
# burn-baby-burn
![burn-baby-burn](burn.png)
> *"Burn, baby, burn — disco inferno."*
>     — The Trammps, 1976, on the subject of API quotas

View file

@ -288,6 +288,16 @@ round_cents() {
awk -v c="$1" 'BEGIN{printf "%.2f", c}'
}
# Format a non-negative integer with thousands-grouping commas (21826 -> 21,826).
fmt_num() {
local n=$1 result=""
while ((n >= 1000)); do
result=$(printf ",%03d%s" $((n % 1000)) "$result")
n=$((n / 1000))
done
printf "%d%s" "$n" "$result"
}
on_interrupt() {
if [[ -n "$claude_pid" ]]; then
kill "$claude_pid" 2>/dev/null || true
@ -367,7 +377,9 @@ done
cost_rounded=$(round_cents "$total_cost")
msg="${CELEBRATIONS[RANDOM % ${#CELEBRATIONS[@]}]}"
printf "\n\n%s\n\n" "$msg"
printf " 🔥 torched %s fire tokens across %s call(s) (target: %s)\n" \
"$burned" "$iteration" "$tokens"
printf " 💰 spent \$%s\n\n" "$cost_rounded"
burned_fmt=$(fmt_num "$burned")
tokens_fmt=$(fmt_num "$tokens")
printf "\n\n 🔥 torched %s tokens across %s call(s) (target: %s) • 💰 spent \$%s 💵💵💵\n\n" \
"$burned_fmt" "$iteration" "$tokens_fmt" "$cost_rounded"
printf " %s\n\n" "$msg"

BIN
burn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB