anthropics / anthropics/claude-code

[BUG] Max 20x five-hour meter reached 100% in 57m with 54-60% less observable traffic per point than prior window

オープン
#91,069 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:cost bug has repro platform:wsl
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

### Preflight Checklist

- [x] I searched existing issues. The closest report is #87419, but that issue concerns weekly/scoped meters and an observed `default_claude_max_5x` credential mismatch. This report concerns one five-hour reset while the account reported `default_claude_max_20x`.
- [x] This is a single bug report about five-hour quota accounting.
- [x] The incident occurred on the then-latest Claude Code version, 2.1.251. Version 2.1.252 was published at 2026-08-31 17:07 UTC, about 4.5 hours after the measured incident ended.

### What's Wrong?

On a Claude Max 20x account, the five-hour meter went from its reset boundary to 100% in **57m16s**, from **2026-08-31 11:40:00 UTC** to **12:37:15 UTC**.

The immediately preceding same-account window moved from 25% to 99% in **4h31m38s** on the same client version. Meter movement in the aggressive window was 6.41x faster, while each meter point corresponded to materially less observable traffic.

| Window | Meter movement | Duration | Gateway calls | All input tokens | Output tokens | API-price equivalent | All input / point | API-price equivalent / point |
|---|---:|---:|---:|---:|---:|---:|---:|---:|
| Previous comparison | 25% -> 99% | 4h31m38s | 1,116 | 191,307,135 | 1,518,734 | $308.758673 | 2,585,232 | $4.1724 |
| Aggressive reset | 0% -> 100% | 57m16s | 700 | 102,846,391 | 1,285,723 | $193.806125 | 1,028,464 | $1.9381 |

The API-price figures are list-price-equivalent comparison proxies, **not** an assumed subscription quota formula.

Relative to the preceding window, the aggressive reset carried only:

- **39.8% as much all-input volume per meter point**
- **46.4% as much API-price-equivalent traffic per meter point**

Traffic did run faster per hour, and one known unattended job contributed 246 of the 700 calls. That explains part of the rapid wall-clock depletion. It does not explain why substantially less observable traffic corresponded to each meter point.

Cache behavior remained warm:

| Window | Cache reads | Cache writes | Fresh input | Cache-read share | Confirmed cache breaks |
|---|---:|---:|---:|---:|---:|
| Previous 25% -> 99% | 182,603,570 | 8,444,660 | 258,905 | 95.45% | 20 |
| Aggressive 0% -> 100% | 97,946,447 | 4,885,990 | 13,954 | 95.24% | 4 |

The largest jump, 3% -> 30% in 7m13s, remained 93.31% cache reads and contained zero confirmed cache breaks.

Public model aliases also remained stable:

| Model alias | Previous calls | Aggressive calls |
|---|---:|---:|
| `claude-fable-5` | 470 | 334 |
| `claude-opus-5` | 554 | 352 |
| `claude-sonnet-5` | 82 | 14 |

Across 1,432 readable raw request/response pairs collected around these windows:

- requested and returned model aliases differed zero times
- every readable response reported `service_tier=standard`
- every readable response reported `speed=standard`

This rules out a broad cache collapse and a wire-visible switch to another public model alias. It does not rule out different internal routing or quota coefficients behind the same alias.

### What Should Happen?

For the same Max 20x entitlement, meter accounting should remain consistent across adjacent reset windows for comparable observable traffic, or any change in quota weighting should be visible and documented.

Please investigate whether, at the 2026-08-31 11:40 UTC reset:

1. five-hour quota weighting or per-model coefficients changed;
2. cache-read, cache-creation, output, or long-context coefficients changed;
3. the account entered a routing or quota experiment behind unchanged public aliases; or
4. the server applied a tier other than the reported `default_claude_max_20x` entitlement.

If this was a metering defect, the affected quota accounting should be corrected.

### Error Messages/Logs

```shell
No client error was emitted. The five-hour meter reached 100% and usage was blocked normally.

Reset identity: 2026-08-31T11:40:00Z
First post-reset observation: 3% at 2026-08-31T11:41:29.569Z
75% observation: 2026-08-31T12:06:38.532Z
99% observation: 2026-08-31T12:34:04.173Z
100% observation: 2026-08-31T12:37:15.605Z

The 0% start is the exact reset boundary; the first post-reset sample observed 3%.
```

### Steps to Reproduce

1. On a Claude Max 20x subscription, record the five-hour usage value and `resets_at` timestamp from the OAuth usage response at a regular cadence.
2. Over a complete five-hour reset boundary, run normal Claude Code workloads while recording request timestamps, public model aliases, cache-read/cache-creation/fresh-input usage, output tokens, and unique request IDs.
3. Group samples by account and exact `resets_at`; do not merge neighboring reset windows or different accounts.
4. Attribute requests between meter crossings and compare traffic per meter point against the immediately preceding same-account window.
5. In this incident, the reset-boundary window reached 100% in 57m16s with 39.8% of the prior window's all-input volume per point and 46.4% of its API-price-equivalent traffic per point.

The behavior was intermittent: a later same-day reset produced traffic-per-point values within the earlier normal range. That makes this unsuitable for a deterministic one-command reproduction, but the reset identity and server-side account records should permit reconciliation.

### Claude Model

Not sure / Multiple models (`claude-fable-5`, `claude-opus-5`, and `claude-sonnet-5`)

### Is this a regression?

Yes. The immediately preceding same-account window on the same Claude Code version behaved materially differently.

### Last Working Version

2.1.251 was both the last normal window and the affected window, so this does not appear tied to a client upgrade.

### Claude Code Version

2.1.251 (Claude Code)

### Platform

Other: Claude Max 20x subscription through Claude Code OAuth

### Operating System

Ubuntu 24.04.2 LTS under WSL2

### Terminal/Shell

WSL (Windows Subsystem for Linux)

### Additional Information

- During the investigation, the credential and direct usage samples reported `subscription_type=max` and `rate_limit_tier=default_claude_max_20x`.
- The closest related report is #87419. Unlike that report, no 5x-vs-20x credential mismatch was observed here, and this report covers the five-hour meter rather than weekly/scoped meters.
- Gateway pagination was reconciled across 1,858 unique records. Quantitative request totals come from Gateway metadata; raw request/response files were used for routing and cache diagnostics.
- Prompt content, account identifiers, credentials, and raw request/response bodies are intentionally omitted from this public report.
- I can provide redacted request IDs, percent-level aggregates, or machine-readable summaries privately if maintainers need them for server-side correlation.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

No repository file or test is named in the report. Start by reviewing the reset-boundary observations and reconciling the account's server-side usage records for the exact resets_at window against the preceding window. Done means identifying the metering or entitlement cause, or confirming that the affected quota accounting was corrected.

索引モデルが issue の本文から書いたものです。

評価

領域
backend, cloud
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。