rate_limits field never populated in statusLine/hook input JSON (v2.1.278)
Description
The rate_limits field is consistently null / absent in the JSON payload sent to both statusLine commands and hook scripts. The comment in the generated statusline.sh template says this works in v2.1.251+, but it does not appear in v2.1.278.
Steps to reproduce
- Configure a
statusLinecommand insettings.jsonthat logs its input JSON to a file, e.g.:
``sh``
#!/bin/bash
INPUT=$(cat)
echo "$INPUT" >> /tmp/sl_input.json
- Run any Claude Code session.
- Inspect
/tmp/sl_input.json:
{
"session_id": "...",
"version": "2.1.278",
"cost": { ... },
"context_window": { ... },
...
}
rate_limits is not present in the payload at all (not null — simply absent).
Expected behavior
The generated statusline.sh template references the following fields and the inline comment promises they are populated server-side:
FIVE_H_USED=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
WEEK_USED=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')
SPEND_USED=$(echo "$input" | jq -r '.rate_limits.spend_limit.used_percentage // empty')
Comment in the template:
The $500/month allowance is a Claude apps gateway spend limit, reported server-side via rate_limits.spend_limit (Claude Code v2.1.251+)
All three fields should be included in the statusline/hook input payload.
Actual behavior
rate_limits is never present. The monthly spend progress bar (mo ██████░░ 77%) coded in statusline.sh never renders because SPEND_USED is always empty.
The usage is visible at https://claude.ai/code#settings/usage (showing $386 / $500, 77%), so the data exists server-side.
Environment
- Claude Code version: 2.1.278
- OS: macOS 25.6.0 (Darwin)
- Shell: zsh
statusLine.refreshInterval: 1 (so the command fires every second)- Hooks also call the same statusline script —
rate_limitsabsent in both hook and statusLine contexts