Follow Discord
Sweep 06 Nov 2026 · 01:32Z Build v2.1.319 537 read Stable v2.1.311 Latest v2.1.318 Next v2.1.319 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.267 ·

New scriptable session-usage API ($.session.usage)

A new scripting API, $.session.usage, exposes context, rate-limit, and cost data to plugins and scripts

Use it now Notable New Features
JSON All of v2.1.267
Use it nowTier: how much it should matter to you
5Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
SDKArea: what it touches
New FeaturesKind: in v2.1.267,
What probably matters to youSection of the release
What

A new function called $.session.usage is now available for scripting and plugin code. It returns details about the current session, including:

  • context-window usage (how many tokens are used, the size of the window, and the percentage full)
  • rate-limit windows (five_hour, seven_day, and spend_limit), each with a percent used and when it resets
  • the current session's cost in US dollars
Why

This lets plugins and other scripts built on top of Claude Code read the same usage and cost figures Claude Code itself tracks, instead of guessing or parsing them from elsewhere. That makes it possible to build custom status lines, dashboards, or automations that react to how close a session is to its context or rate limits.

See this entry in the whole of v2.1.267 →

Feedback