{"slug": "prints-out-claude-code-and-codex-monthly-usage-every-1-minute-on-powershell", "title": "Prints out Claude Code and Codex monthly usage every 1 minute on PowerShell", "summary": "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.", "body_md": "| while ($true) { | |\n| $data = npx -y -q ccusage monthly --by-agent --json | ConvertFrom-Json | |\n| Clear-Host | |\n| Write-Host \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')`n\" | |\n| $data.monthly[0].agents | | |\n| Where-Object { $_.agent -eq \"claude\" -or $_.agent -eq \"codex\" } | | |\n| ForEach-Object { [PSCustomObject]@{ agent = $_.agent; totalCost = \"`$ {0:N2}\" -f $_.totalCost } } | | |\n| Format-Table -AutoSize | |\n| Start-Sleep -Seconds 60 | |\n| } |\n\n| 2026-07-21 15:14:06 | |\n| agent totalCost | |\n| ----- --------- | |\n| claude $ 8.42 | |\n| codex $ 4.34 |", "url": "https://wpnews.pro/news/prints-out-claude-code-and-codex-monthly-usage-every-1-minute-on-powershell", "canonical_source": "https://gist.github.com/sjeon87/6f0fe958549d8daf756ad5ebbe43c7e3", "published_at": "2026-07-21 06:14:24+00:00", "updated_at": "2026-07-21 06:27:32.648470+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Claude Code", "Codex"], "alternates": {"html": "https://wpnews.pro/news/prints-out-claude-code-and-codex-monthly-usage-every-1-minute-on-powershell", "markdown": "https://wpnews.pro/news/prints-out-claude-code-and-codex-monthly-usage-every-1-minute-on-powershell.md", "text": "https://wpnews.pro/news/prints-out-claude-code-and-codex-monthly-usage-every-1-minute-on-powershell.txt", "jsonld": "https://wpnews.pro/news/prints-out-claude-code-and-codex-monthly-usage-every-1-minute-on-powershell.jsonld"}}