cd /news/developer-tools/prints-out-claude-code-and-codex-mon… · home topics developer-tools article
[ARTICLE · art-66515] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Prints out Claude Code and Codex monthly usage every 1 minute on PowerShell

A developer shared a PowerShell script that prints Claude Code and Codex monthly usage every minute, showing costs of $8.42 and $4.34 respectively.

read1 min views5 publishedJul 21, 2026
| while ($true) { | |
| $data = npx -y -q ccusage monthly --by-agent --json | ConvertFrom-Json | |

| Clear-Host | |

| Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')`n" | |
| $data.monthly[0].agents | | |
| Where-Object { $_.agent -eq "claude" -or $_.agent -eq "codex" } | | |
| ForEach-Object { [PSCustomObject]@{ agent = $_.agent; totalCost = "`$ {0:N2}" -f $_.totalCost } } | | |
| Format-Table -AutoSize | |
| Start-Sleep -Seconds 60 | |

| } |

| 2026-07-21 15:14:06 | | | agent totalCost | | | ----- --------- | | | claude $ 8.42 | | | codex $ 4.34 |

── more in #developer-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/prints-out-claude-co…] indexed:0 read:1min 2026-07-21 ·