claude-code - 💡(How to fix) Fix [FEATURE] 使用量ログにアカウント識別子の追加 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…
GitHub stats
anthropics/claude-code#48205Fetched 2026-04-15 06:30:12
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3
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

概要

~/.claude/usage.jsonl の各エントリに、アカウント識別子 (メールアドレスまたはアカウントID)を追加してほしい。

背景・動機

採算集計の理由から複数アカウントで利用している。同一マシンで切り替えて利用している場合、 現状のログではどちらのアカウントのクォータを消費したか区別できない。

ccusage などのツールはこのログを集計に利用しているが、 アカウント単位の内訳を出すことが現状では不可能。

提案内容

各ログエントリに account フィールドを追加する:

{ "timestamp": "...", "model": "claude-sonnet-4-5", "inputTokens": 1234, "outputTokens": 567, "account": "[email protected]" // ← 追加 }

ユースケース

  • 複数アカウントを同一マシンで使用する場合のクォータ追跡
  • アカウント別コスト帰属の把握
  • ccusage 等のツールがアカウント別フィルタリングを 実装できるようになる(ログフォーマット変更のみで対応可能)

補足

アカウント情報はCLIの認証セッションに既に存在するため、 追加のAPIコールは不要なはず。

関連 Issue

  • #32104 — Bedrock環境でのusage.jsonlへのユーザー識別子追加要求 (チーム設定・Bedrock固有の文脈だが方向性は近い)
  • #19906 — /usage コマンドへのログイン中メールアドレス表示要求 (UI表示の話だが動機は共通)

Proposed Solution

各エントリに account フィールド(メールアドレスまたはアカウントID)を追加する。

{ "timestamp": "...", "model": "claude-sonnet-4-5", "inputTokens": 1234, "outputTokens": 567, "account": "[email protected]" }

アカウント情報はCLIの認証セッションに既に存在するため、 追加のAPIコールは不要なはず。 値の形式(メールアドレス/アカウントID)は実装者判断に委ねる。

Alternative Solutions

No response

Priority

Low - Nice to have

Feature Category

Developer tools/SDK

Use Case Example

No response

Additional Context

No response

extent analysis

TL;DR

Add an account field to each entry in the ~/.claude/usage.jsonl file to track account-specific quota usage.

Guidance

  • Identify the authentication session in the CLI to retrieve the account information (email address or account ID) without requiring an additional API call.
  • Modify the logging mechanism to include the account field in each log entry, following the proposed format: { "timestamp": "...", "model": "claude-sonnet-4-5", "inputTokens": 1234, "outputTokens": 567, "account": "[email protected]" }.
  • Consider the format of the account field value (email address or account ID) and decide on a consistent implementation.
  • Review related issues (#32104 and #19906) for similar context and direction.

Example

{
  "timestamp": "2023-02-20T14:30:00Z",
  "model": "claude-sonnet-4-5",
  "inputTokens": 1234,
  "outputTokens": 567,
  "account": "[email protected]"
}

Notes

The proposed solution assumes that the account information is already available in the CLI's authentication session, eliminating the need for an additional API call. The implementation details, such as the format of the account field value, are left to the developer's discretion.

Recommendation

Apply the proposed workaround by adding the account field to each log entry, as it provides a straightforward solution to track account-specific quota usage without requiring significant changes to the existing system.

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] 使用量ログにアカウント識別子の追加 [1 participants]