claude-code - 💡(How to fix) Fix [FEATURE] Expose session metadata (rate limits, token usage, status) to a common local source across all surfaces

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

The statusLine hook gives CLI users access to rate limit and session metadata, but the VS Code extension, Desktop App, and API surfaces have no equivalent. Teams running agents across mixed surfaces — which is the norm in enterprise — have no unified way to monitor what's happening.

What exists today

CLI: statusLine hook writes to a local file. Tools like abtop can read it. VS Code extension: nothing Desktop App: nothing (see #41456) API: nothing Related issues: #41456, #50863, #50286, #40965

Proposed Solution

Write a common local file or socket that all surfaces contribute to — rate limit windows, token usage, session state. The format already exists (abtop-rate-limits.json). The ask is for all surfaces to write to it, not just the CLI.

Why it matters at enterprise scale Teams need to know when agents are hitting quota, filling context, or stalling — regardless of which surface they're using. This is table stakes for observability and is the kind of instrumentation that will matter as Claude usage scales inside organizations.

Even individual users would want to have this level of observability that can help reduce unnecessary input/output token churn.

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

API and model interactions

Use Case Example

I am creating a multi-agent workflow in VS Code locally running on a Python Framework (LangChain / LangGraph. I want to "tune" the agent prompts for token conservation and track inference quality vs generated tokens. This tuning can itself be an agentically-tuned first-line FinOps defense against releasing token-gobbling flows at scale, enabling experimentation with caching and memory before it ever hits the hyperscaler.

Additional Context

No response

extent analysis

TL;DR

Implement a unified logging mechanism for all surfaces (CLI, VS Code extension, Desktop App, and API) to write rate limit and session metadata to a common local file or socket.

Guidance

  • Identify the existing format (abtop-rate-limits.json) and ensure all surfaces can write to it in a consistent manner.
  • Consider implementing a socket-based approach for real-time updates, in addition to writing to a local file.
  • Develop a strategy for handling concurrent writes from multiple surfaces to the common file or socket.
  • Evaluate the need for additional metadata, such as surface-specific identifiers, to facilitate unified monitoring and debugging.

Example

No code snippet is provided due to the lack of specific technical details in the issue.

Notes

The proposed solution requires careful consideration of the implementation details, such as file format, socket protocol, and concurrency handling, to ensure a unified and reliable logging mechanism.

Recommendation

Apply a workaround by implementing a common logging mechanism, as the issue highlights the need for a unified approach to monitoring and debugging across different surfaces. This will provide a foundation for future enhancements and improvements.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Expose session metadata (rate limits, token usage, status) to a common local source across all surfaces