Skip to content

Claude responses report the prompt doubled on ~0.3% of calls since 2026-11-04 — usage and billing #5392

Open

Description

@doomslayer2k

Describe the bug

About 0.3% of Claude model calls come back with a usage block whose prompt side — input, cache read and cache write — is twice the prompt that was sent. Output tokens are normal, and the next call reads true again. The response's billing block carries the doubled numbers too, so the extra tokens look billed.

The CLI trusts that count. When it crosses the auto-compaction threshold, a background compaction starts on a session that is really 30–60% full (#5393; a cancelled one leaves "Compacting conversation…" stuck: #5394).

Frequency: 105 of 35,749 Claude calls in 5 days on one machine (0.29%), in 43 sessions; one session had 13 in 30 minutes. None in 59,660 Claude calls in the week before 2026-11-04 ~22:00Z. GPT and Grok: 0 of ~3,300.

Extensions: not relevant — the doubled count is already in the response as the runtime's own wire log records it, before any extension sees it.

Wanted labels: area:models, type: Bug.

Affected version

Runtime 1.0.102-0.unstable.r41779900948.gf482387 (desktop app 1.1.35). The previous runtime build had it too after the onset, so it does not follow a CLI release.

Steps to reproduce

Not deterministic.

  1. Run a long agentic task on Claude Opus 5.5 (100K–400K context).
  2. Compare consecutive parent session.usage_record / assistant.usage events.
  3. Occasionally one call reports a prompt ≈ the previous prompt + the next one.

Example, three consecutive main-agent calls: prompt_tokens 117,276 → 246,058 → 127,596; the middle one has cached_tokens 236,376. Its request body is the same size as its neighbours'.

Expected behavior

Usage, and billing, report the prompt that was sent.

Additional context

App version         1.1.35
OS                  Windows 10 Enterprise 26H2 (build 26300.9711)
Architecture        AMD64
Copilot CLI         copilot-sdk-runtime-1.0.102-0.unstable.r41779900948.gf482387

Wire-log excerpts for two captured calls are available on request.

In-depth investigation

The shape, over 105 doubled calls (p10 / median / p90):

Measure p10 median p90
spike ÷ (previous + next prompt) 0.99 1.00 1.01
spike cache read ÷ next call's cache read 1.94 1.99 2.00
request body ÷ previous request body 1.00 1.01 1.02
duration ÷ neighbours' mean 0.33 1.08 3.11

Output is produced once, at the normal rate (median 10.6 ms/token against 10.4 / 9.8 for the neighbours). Only the prompt-side accounting doubles.

One request, no retry. Two doubled calls were captured live from the runtime's own wire log ([rust:model_wire] response): one Wire request per response, no retry or failure line, normal durations (3.1 s and 3.9 s). prompt_tokens 246,058 and cached_tokens 236,376 are already doubled in the response, and so is the service-computed billing block (copilot_usage cache read 236,376, total_nano_aiu 10,066,120,000). The event log copies those numbers exactly. Caveat: the log is the response as the wire layer decoded it, so summing two usage events inside one stream cannot be excluded from here — but that would also have had to double the billing block.

The onset is a moment in time:

Period Phantoms / Claude calls Rate
2026-10-28 → 11-04 22:00Z (older runtimes) 0 / 59,660 0%
11-04 22:00Z → 11-05 01:08Z (previous build) 1 / 632 0.16%
after 11-05 01:08Z (current build) 104 / 35,117 0.30%

The first one is 2026-11-04 22:21:43Z, on the previous runtime build, three hours before the current one was installed.

Where: Opus 5.5 104 / 33,227; Haiku 5.5 1 / 917; Sonnet 5.5 0 / 1,595 (mostly sub-agent calls). Main agent 0.48%, sub-agents 0.11%. It clusters by session. Every Claude call used the same encoding, transport and /v1/messages endpoint; prompt size, gap since the previous call, cache-write size and previous output size show no strong effect.

Cost on this machine: ~726 AI credits in 5 days for prompt tokens never sent (half the prompt-side cost of each doubled call).

A lead, unverified: many responses now carry input_transformations (thinking_dropped / prefix_binding_mismatch).

Activity

  1. added
    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loading
    area:modelsModel selection, availability, switching, rate limits, and model-specific behavior
    and removed on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:context-memoryContext window, memory, compaction, checkpoints, and instruction loadingarea:modelsModel selection, availability, switching, rate limits, and model-specific behavior

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions