can you change the status line so I can see the Usage credits of the month?
- User
can you change the status line so I can see the
Usage creditsof the month? Assistant· claude-opus-5
Done —
~/.claude/statusline-command.shnow shows month-to-date usage credits:Claude Opus 5 [████████░░░░░░░░] 52% · credits $1,034.10With a spend cap configured it renders
credits $1,034.10/$2,000.00 (52%). Your account hasmonthly_limit: null(unlimited), so only the spent amount shows. Old script backed up atstatusline-command.sh.bak;settings.jsonalready pointed here, so no config change was needed.Where the number comes from: the statusline JSON Claude Code feeds to the script only carries
rate_limits.five_hour/seven_day— no credits field. So the script reads Claude Code's own cached/api/oauth/usagepayload from~/.claude.json(.cachedUsageUtilization.utilization.spend, falling back to.extra_usagefor the older schema). No network call, no token handling, ~15 ms per render.The one caveat: that cache is refreshed only when Claude Code fetches usage (opening
/usage,/status,/usage-credits), not on a timer — so it can go stale. Rather than hide that, the script appends the age once it's over 30 minutes old (). Run to force a refresh. Restart or reload to see it in this session.