Troubleshooting Abnormal LLM Token Consumption After November 2026
This article explains why token consumption can spike even when usage patterns stay the same, focusing on incomplete context auto-compaction, prefix cache invalidation, sub-task context bloat, and differences between monitoring and billing metrics. It outlines a five-step investigation method—aligning metrics, establishing baselines, adding telemetry, running controlled reproductions, and confirming root causes—followed by practical optimization advice such as raising compaction thresholds, protecting cache prefixes, minimizing sub-task context, sharding context with retrieval, improving observability, and setting cost budgets.
Troubleshooting Abnormal LLM Token Consumption After November 2026
1. Symptom Overview: Why the Usage Curve Suddenly Rises
Many teams using AI coding tools have reported that token consumption has increased noticeably at roughly the same usage intensity. The typical symptoms fall into four categories:
- Shift in share: One model’s share of total consumption jumped from around 20% to roughly 50%, even though the business scenarios did not change accordingly.
- Rapid quota depletion: A quota that used to support several hours of sessions was exhausted within twenty minutes.
- Frequent compaction: Dozens of automatic context compactions occurred in a single day, triggered by both the main task and multiple sub-tasks.
- Little space freed after compaction: The context size before and after compaction differed only slightly—for example, about 240,000–250,000 tokens before compaction and still 140,000–160,000 tokens afterward.
Together, these symptoms make it tempting to assume the tool is broken. From an engineering perspective, however, a more common explanation is the combined effect of context management, caching strategy, and measurement methodology. The following sections break this down layer by layer.
2. Root Cause Analysis: Four High-Probability Causes
2.1 Incomplete Context Auto-Compaction
The trigger threshold for auto-compaction is usually a fixed value (for example, around 240,000 tokens). The problem is that compaction algorithms generally rely on summary-based rewriting: they keep the task goal, key conclusions, and recent fragments while discarding intermediate steps. If the summarization model prefers to “keep more rather than less,” more than 60% of the context may remain after compaction.
More importantly, the compaction action itself consumes tokens: the content being compacted must be sent to the model as input to generate a summary. This overhead often goes unnoticed by users but is still billed. If the main task compacts a dozen times a day and each sub-task compacts a dozen times as well, the cumulative “compaction tax” can be substantial.
Illustrative pseudocode can express this compounding effect:
Cost per compaction ≈ context length before compaction (input) + summary output lengthTotal daily cost ≈ normal request cost + Σ(cost per compaction) + repeated input cost from cache invalidation
2.2 Hidden Amplification from Cache Hit Rate Changes
The low cost of multi-turn conversations depends heavily on prefix caching: when identical prefix tokens hit the cache, both billing and latency drop significantly. Auto-compaction, however, rewrites the context prefix, invalidating the cache that would otherwise have been reusable. Even if the content “looks about the same” after compaction, the cache cannot be reused as long as the prefix bytes differ.
This creates a vicious cycle: the context grows → compaction is triggered → the cache is invalidated → the input cost per request rises → the threshold is reached sooner → compaction happens again. This explains why “usage habits haven’t changed, but consumption is visibly dropping.”
2.3 Sub-Task Context Bloat
When a main task spawns multiple sub-tasks, the total input volume multiplies if each sub-task inherits the full context instead of a trimmed one. Three sub-tasks each compacting a dozen times indicates that their context size is already approaching that of the main task. Common causes include:
- Sub-tasks copy the complete history during initialization;
- Sub-tasks communicate through shared context without boundary trimming;
- Raw logs and file contents returned by tool calls enter the context directly without truncation.
2.4 Differences in Measurement and Billing Rules
Different models and versions may measure input, output, cache hits, and compaction summaries differently. If the monitoring dashboard estimates by “number of requests” while the bill is settled by “tokens,” a mismatch appears: “it feels unchanged, but the bill has doubled.” In addition, tiered pricing for long contexts and separate billing for cache writes and reads can amplify the discrepancy.
3. Investigation Methodology: A Five-Step Path from Symptoms to Evidence
- Align metrics: First confirm whether monitoring metrics and billing metrics are consistent, unify them at the token level, and distinguish four categories: input, output, cache hits, and summary generation.
- Establish a baseline: Select normal sessions from one week and record three baselines: average input length per turn, number of compactions, and cache hit rate.
- Add telemetry: Instrument both the client and the gateway to log context length per request, whether compaction occurred, context length before and after compaction, and cache hit ratio.
- Run controlled reproductions: Fix the task script and run ten rounds each under three configurations—“auto-compaction disabled,” “higher threshold,” and “trimmed sub-task context”—then compare the consumption curves.
- Confirm attribution: If disabling compaction significantly reduces consumption, the main cause is compaction and cache invalidation; if trimming sub-task context produces a clear drop, the main cause is the context inheritance strategy.
4. Optimization Recommendations: Bringing Consumption Back Under Control
- Raise the compaction threshold and improve the summarization strategy: Make summaries keep only goals, constraints, conclusions, and to-dos; explicitly discard intermediate reasoning and duplicate logs; set an upper limit on summary length.
- Protect the cache prefix: Place stable, unchanging system prompts and project conventions at the very front of the context, and put volatile content at the end to reduce cache invalidation caused by prefix rewriting.
- Minimize sub-task context: Sub-tasks should inherit only necessary fragments; truncate and structurally summarize tool results instead of injecting large raw text directly.
- Shard context and use retrieval: Move long history to object storage or vector retrieval and recall it on demand rather than stuffing everything into the window.
- Improve observability: Set thresholds in monitoring and alerting for “token consumption per task,” “number of compactions,” and “cache hit rate,” with automatic alerts on anomalies.
- Cost budgets and quota policies: Set budget caps by task type and degrade to a trimmed mode when the cap is exceeded, so a single anomaly does not drain the overall quota.
5. Conclusion
“Abnormal consumption” is usually not a single defect but the combined result of compaction strategy, caching mechanisms, sub-task context management, and measurement methodology. Developers should first unify their metrics, then complete attribution through telemetry, reproduction, and controlled experiments, and finally reduce costs systematically with four measures: threshold tuning, prefix protection, context minimization, and observability. This approach both explains sudden usage spikes and brings the cost of AI coding tools back onto a predictable, governable engineering track.
