[BUG/NEED_CLARIFY] "Reserved" included 22.5%???

Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Sep 30, 2025 · closed Oct 11, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

After update claude sonnet 4.5, claude code CLI include "Reserved" in /context with 22.5%. Can team explain more detail about "Reserved"?

<img width="638" height="257" alt="Image" src="https://github.com/user-attachments/assets/7f54afc6-91bc-4098-aece-1e19769e92ba" />

What Should Happen?

Declare in document offical

Error Messages/Logs

Steps to Reproduce

run /context

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.1 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

5 Comments

mlpassos · 11 months ago

I also found this yesterday and just confirmed it through previoys /context command outputs the information below might be usefull, Claude asked me to "please, file an issue" because this was not a Sonnet 4.5 problem (yeah, I was using Sonnet 4.5 haha)... so here is my two cents with Claude's help, of course:

---

● ## Answer: Reserved is NEW in v2.0.x (not related to Sonnet 4.5 model)

I can provide concrete evidence from session logs that Reserved (45k tokens, 22.5%) was introduced in Claude Code v2.0.x, and is NOT a feature
of the Sonnet 4.5 model.

### Evidence from Actual Session Logs:

#### v1.0.113 (September 13, 2025) - NO Reserved field:

Session ID: 8ae06768-56c9-4e83-b957-bbdf29219ddb
Project: C:/dev/dailytop10
Version: 1.0.113
Model: claude-opus-4-1-20250805

Context Usage: 15k/200k tokens (7%)

├─ System prompt: 3.1k tokens (1.6%)
├─ System tools: 11.5k tokens (5.7%)
├─ Messages: 94 tokens (0.0%)
└─ Free space: 185.3k (92.6%)

❌ NO "Reserved" field exists

Log file: .claude/projects/C--dev-dailytop10/8ae06768-56c9-4e83-b957-bbdf29219ddb.jsonl
Timestamp: 2025-09-13T07:22:43.893Z

---

#### v2.0.5 (October 3, 2025) - WITH Reserved field:

Session ID: 4acdffb8-c7bb-4f07-90c2-c127d81b9fa2
Project: C:/dev/mangapub
Version: 2.0.5
Model: claude-sonnet-4-5-20250929

Context Usage: 81k/200k tokens (40%)

├─ System prompt: 3.0k tokens (1.5%)
├─ System tools: 11.6k tokens (5.8%)
├─ Reserved: 45.0k tokens (22.5%) ← NEW in v2.0.x!
├─ MCP tools: 18.7k tokens (9.3%)
├─ Memory files: 2.5k tokens (1.3%)
├─ Messages: 91 tokens (0.0%)
└─ Free space: 74k (37.0%)

Log file: .claude/projects/C--dev-mangapub/4acdffb8-c7bb-4f07-90c2-c127d81b9fa2.jsonl
Timestamp: 2025-10-03T06:54:10.301Z

---

### What IS "Reserved"?

Based on the label shown in /context output: [autocompact + output tokens], Reserved appears to be:

  1. Auto-compact buffer (~25k tokens) - space needed to summarize conversation when approaching limit
  2. Max output tokens buffer (~15k tokens) - space for Claude's responses (Sonnet 4.5 can generate up to ~8k tokens)
  3. Tool results buffer (~5k tokens) - space for tool execution results

### Impact on Users:

| Metric | v1.0.x | v2.0.x | Change |
|--------|--------|--------|--------|
| Initial context usage (empty session) | ~7-15% | ~40% | +25-33% |
| Free space available | ~85-92% | ~37-60% | -25-55% |
| Reserved overhead | 0 | 45k (22.5%) | +45k |

Consequences:

  • New sessions now start at 40% context usage instead of 7%
  • Auto-compact triggers at ~120-140k tokens instead of ~160-180k
  • Users are forced to /clear conversations much earlier
  • Feels like we lost 45k tokens of our 200k budget

### Timeline:

  • v1.0.113 (Sept 13): No Reserved field ✅
  • v1.0.126 (last 1.x): Likely no Reserved (needs confirmation)
  • v2.0.0 (first 2.x): Reserved introduced ❓
  • v2.0.1-v2.0.5: Reserved present (45k tokens)

Not documented in any v2.0.x changelog entries.

### Related Issues:

This Reserved buffer is causing calculation errors across multiple issues:

  • #8479 - Context display double-counts reserved buffer
  • #8676 - Math doesn't add up correctly
  • #8792 - UI shows 1% remaining when 45% available
  • #8857 - Incorrect context window awareness

All appear to be symptoms of the same root cause: Reserved introduction in v2.0.x.

### Workaround:

Downgrade to v1.0.126 (last stable v1.x) until this is addressed:
```bash
npm install -g @anthropic-ai/claude-code@1.0.126
claude --version # Verify: should show 1.0.126

Requests for Maintainers:

  1. Document what Reserved is and why it requires 45k tokens (22.5%)
  2. Make it configurable via settings:

{
"reservedTokens": 15000,
"reservedPercentage": 7.5,
"disableReserved": true
}

  1. Lazy-allocate Reserved - only reserve when approaching compact threshold (e.g., 70-80%), not upfront in new sessions
  2. Add to changelog if this was intentional

Evidence Available:

I can provide the actual .jsonl session files upon request:

  • v1.0.113 session: 8ae06768-56c9-4e83-b957-bbdf29219ddb.jsonl (NO Reserved)
  • v2.0.5 session: 4acdffb8-c7bb-4f07-90c2-c127d81b9fa2.jsonl (WITH Reserved)

Both sessions were run on the same machine with comparable conditions, showing a clear before/after comparison of the Reserved field introduction.

---
Platform: Windows 11Package Manager: npm global (via nvm4w)Installation Path: C:\nvm4w\nodejs\claudeEvidence Source: Direct comparison of
.claude/projects/*/ session logs

Note: A previous v1.0.113 installation exists via pnpm global but is not being used (npm takes precedence in PATH).

mlpassos · 11 months ago

And Sonnet 4.5 now just asked me to add that, it makes sense initially, but this is for you big fellows at anthropic to find out if your model is really good and just saved the day (you probably already knew all of that). Here is another 2 cents from Sonnet 4.5:

---

### 🚨 Critical Impact: Usage Limits Hit 2-3x Faster in v2.0.x

The Reserved buffer doesn't just reduce available context—it causes significantly more API usage, hitting rate/usage limits much earlier.

#### Why Reserved Increases API Consumption:

v1.x behavior:

  • Auto-compact triggers at ~180k tokens (90% of 200k)
  • Long conversations require 1-2 compactions
  • User can work for extended periods before hitting limits

v2.0.x behavior:

  • Reserved steals 45k upfront
  • Auto-compact triggers at ~120k tokens (60% of 200k)
  • Same conversation now requires 3-5 compactions
  • Each compaction = expensive API call
  • Users hit rate limits 2-3x faster

#### Real-World Impact:

| Scenario | v1.x | v2.0.x | Difference |
|----------|------|--------|------------|
| Context capacity | 185k | 74k | -60% |
| Compactions per long conversation | 1-2 | 3-5 | +150-250% |
| API calls for same work | Baseline | +50-75% | Usage limits 2-3x faster |

#### User Experience:

Before v2.0:
> "I can work for 6-8 hours before hitting daily limits"

After v2.0:
> "I hit limits in 2-3 hours doing the same work - what changed?"

Answer: Reserved forces more frequent auto-compacts, multiplying API usage for identical tasks.

#### This May Explain Recent "Usage Limit" Complaints:

If users are reporting hitting limits much faster in v2.0.x compared to v1.x, Reserved is likely the root cause, not:

  • ❌ Model being "more expensive" (same Sonnet pricing)
  • ❌ Prompts getting longer (they didn't)
  • 2-3x more compaction API calls due to reduced effective context

#### Additional Request:

Please investigate if v2.0.x usage limit complaints correlate with the Reserved introduction. If confirmed, this is a critical UX regression
affecting billable API usage.

mlpassos · 11 months ago

Just disable auto-compact for now under /config and you will get your context back while this is not handled or documented or whatever.

halso · 10 months ago

Think the bug where the reserved memory is double counted is fixed now in version claude-sonnet-4-5-20250929 (Claude Code version 2.0.13). For details see closing comment in:
https://github.com/anthropics/claude-code/issues/8914

github-actions[bot] · 10 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.