Include rate_limits data in hook inputs (Stop, Notification)

Resolved 💬 1 comment Opened Mar 25, 2026 by uneedcomms-judy Closed Mar 25, 2026

Feature Request

Summary: Include rate_limits data (five_hour/seven_day usage percentages) in hook inputs, especially Stop and Notification hooks.

Problem

The statusLine feature provides rate_limits data with used_percentage and resets_at for both 5-hour and 7-day windows. However, statusLine only runs in CLI terminal mode — it does not fire when Claude Code runs as a VS Code extension (entrypoint claude-vscode).

This is because the statusLine command is invoked from within the CLI's React terminal UI rendering loop (useEffect/useCallback), which is not active in VS Code extension mode.

Meanwhile, hooks (Stop, Notification, PreToolUse, PostToolUse) do fire correctly in VS Code extension mode. But none of the hooks currently include rate_limits in their stdin input.

Why This Matters

Third-party tools (e.g., menu bar usage monitors) that display rate limit usage currently rely on statusLine and therefore only work in CLI mode. Users who primarily use Claude Code through VS Code, Cursor, or Antigravity extensions cannot benefit from these tools.

The rate limit data already exists internally (ww7() in the codebase), and hooks already execute in all environments — the missing piece is simply passing the data through.

Proposed Solution

Include rate_limits in the JSON stdin payload for Stop (and ideally all hook types):

{
  "session_id": "...",
  "transcript_path": "...",
  "cwd": "...",
  "rate_limits": {
    "five_hour": {
      "used_percentage": 45.2,
      "resets_at": 1738425600
    },
    "seven_day": {
      "used_percentage": 12.0,
      "resets_at": 1738857600
    }
  }
}

Alternative

Make statusLine also execute in VS Code extension mode, since the underlying claude binary already has the data and the command execution infrastructure (hooks) works fine.

Environment

  • Claude Code v2.1.83
  • macOS, VS Code extension via Antigravity (VS Code fork)
  • Verified: hooks fire in claude-vscode entrypoint, statusLine does not

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗