claude-code - 💡(How to fix) Fix [BUG] v2.1.111 with Opus 4.7 consumes ~1.7–2x more context tokens than v2.1.110 on a fresh session [3 comments, 2 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#49356Fetched 2026-04-17 08:43:30
View on GitHub
Comments
3
Participants
2
Timeline
13
Reactions
2
Author
Timeline (top)
labeled ×5commented ×3cross-referenced ×2subscribed ×2

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/dzianissheka/.local/share/claude/versions/2.1.111 (expected in multi-process scenarios)\n at Kd_ (/$bunfs/root/src/entrypoints/cli.js:2748:2177)\n at qe6 (/$bunfs/root/src/entrypoints/cli.js:2748:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T18:20:34.729Z"},{"error":"Error: Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.\n at rD (/$bunfs/root/src/entrypoints/cli.js:2628:1328)\n at ac1 (/$bunfs/root/src/entrypoints/cli.js:3084:14570)\n at Se9 (/$bunfs/root/src/entrypoints/cli.js:3084:15206)\n at Iw5 (/$bunfs/root/src/entrypoints/cli.js:5452:14243)\n at xw5 (/$bunfs/root/src/entrypoints/cli.js:5452:14320)\n at f (/$bunfs/root/src/entrypoints/cli.js:477:26078)\n at useState (/$bunfs/root/src/entrypoints/cli.js:477:104955)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:467:9336)\n at ia (/$bunfs/root/src/entrypoints/cli.js:5452:14280)\n at KV7 (/$bunfs/root/src/entrypoints/cli.js:6257:26313)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18148:2451)","timestamp":"2026-04-16T18:20:34.792Z"},{"error":"Error: Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.\n at rD (/$bunfs/root/src/entrypoints/cli.js:2628:1328)\n at ac1 (/$bunfs/root/src/entrypoints/cli.js:3084:14570)\n at Se9 (/$bunfs/root/src/entrypoints/cli.js:3084:15206)\n at Iw5 (/$bunfs/root/src/entrypoints/cli.js:5452:14243)\n at xw5 (/$bunfs/root/src/entrypoints/cli.js:5452:14320)\n at f (/$bunfs/root/src/entrypoints/cli.js:477:26078)\n at useState (/$bunfs/root/src/entrypoints/cli.js:477:104955)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:467:9336)\n at ia (/$bunfs/root/src/entrypoints/cli.js:5452:14280)\n at ay7 (/$bunfs/root/src/entrypoints/cli.js:6257:18467)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18148:2451)","timestamp":"2026-04-16T18:20:34.792Z"}]

RAW_BUFFERClick to expand / collapse

What's Wrong?

Claude Code v2.1.111 consumes roughly ~1.7x the context tokens of v2.1.110 on a fresh session for the same minimal task (read a ~100-line markdown file).

Measured on my ~/.claude directory:

  • v2.1.110 + Opus 4.6 → ~21.5k tokens
  • v2.1.111 + Opus 4.7 → ~36.7k tokens

Same repo, same prompt, clean session, no prior conversation.

In another repository the gap is even larger — ~20k vs ~40k tokens (~2x).

I also compared with Haiku across both CC versions: the new version is consistently heavier, though the absolute delta with Haiku is smaller than with Opus. This suggests the increase is driven primarily by the Claude Code harness (system prompt, tools, skills, MCP descriptors) rather than by the model itself.

What Should Happen?

A fresh session in v2.1.111 should consume roughly the same context as v2.1.110 (~21.5k tokens in my setup). A ~1.7–2x jump for an identical task is a significant regression in effective context budget and cost.

Steps to Reproduce

  1. Install @anthropic-ai/[email protected], start a clean session, select Opus 4.6 via /model.
  2. Run a trivial prompt such as read ~/.claude/learnings/tmux-quickstart.md (any ~100-line markdown file).
  3. Run /context and record the total tokens used.
  4. Install @anthropic-ai/[email protected], start a clean session, select Opus 4.7 via /model.
  5. Run the exact same prompt on the same file.
  6. Run /context and compare.

Observed in my setup (v2.1.111 /context breakdown, 36.7k total):

  • System prompt: 8.3k
  • System tools: 13.7k
  • Custom agents: 0.6k
  • Memory files: 4.2k
  • Skills: 2.9k
  • Messages: 7.1k
  • Compact buffer: 3.0k

The system tools (13.7k) and system prompt (8.3k) figures look notably higher than what I saw on v2.1.110 under the same configuration.

Claude Model

Opus (primary comparison); also reproduced with Haiku at a smaller delta.

Is this a regression?

Yes, this worked in a previous version.

Last Working Version

2.1.110

Version

2.1.111

Platform

macOS (Darwin 25.4.0), zsh, Ghostty terminal.

Additional context

  • Feedback ID: 20aab3e2-5310-4d40-a6d6-4c28a867f515

  • Configuration includes plugins (Mapbox, Slack), custom agents (low-dev, mid-dev, high-dev), and a number of user/plugin skills. However, the same configuration was in place for both measurements — only the CC version and model changed.

  • Happy to provide full /context dumps from both versions if useful.

<img width="660" height="484" alt="Image" src="https://github.com/user-attachments/assets/2ee61e34-6ba4-4d2c-b749-57f8064284f6" /> <img width="724" height="514" alt="Image" src="https://github.com/user-attachments/assets/0e84cb3e-9c73-4750-b4f5-a19fdfd75507" />

Errors

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/dzianissheka/.local/share/claude/versions/2.1.111 (expected in multi-process scenarios)\n    at Kd_ (/$bunfs/root/src/entrypoints/cli.js:2748:2177)\n    at qe6 (/$bunfs/root/src/entrypoints/cli.js:2748:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-16T18:20:34.729Z"},{"error":"Error: Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.\n    at rD (/$bunfs/root/src/entrypoints/cli.js:2628:1328)\n    at ac1 (/$bunfs/root/src/entrypoints/cli.js:3084:14570)\n    at Se9 (/$bunfs/root/src/entrypoints/cli.js:3084:15206)\n    at Iw5 (/$bunfs/root/src/entrypoints/cli.js:5452:14243)\n    at xw5 (/$bunfs/root/src/entrypoints/cli.js:5452:14320)\n    at _f (/$bunfs/root/src/entrypoints/cli.js:477:26078)\n    at useState (/$bunfs/root/src/entrypoints/cli.js:477:104955)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:467:9336)\n    at ia_ (/$bunfs/root/src/entrypoints/cli.js:5452:14280)\n    at KV7 (/$bunfs/root/src/entrypoints/cli.js:6257:26313)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18148:2451)","timestamp":"2026-04-16T18:20:34.792Z"},{"error":"Error: Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.\n    at rD (/$bunfs/root/src/entrypoints/cli.js:2628:1328)\n    at ac1 (/$bunfs/root/src/entrypoints/cli.js:3084:14570)\n    at Se9 (/$bunfs/root/src/entrypoints/cli.js:3084:15206)\n    at Iw5 (/$bunfs/root/src/entrypoints/cli.js:5452:14243)\n    at xw5 (/$bunfs/root/src/entrypoints/cli.js:5452:14320)\n    at _f (/$bunfs/root/src/entrypoints/cli.js:477:26078)\n    at useState (/$bunfs/root/src/entrypoints/cli.js:477:104955)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:467:9336)\n    at ia_ (/$bunfs/root/src/entrypoints/cli.js:5452:14280)\n    at ay7 (/$bunfs/root/src/entrypoints/cli.js:6257:18467)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:18148:2451)","timestamp":"2026-04-16T18:20:34.792Z"}]

extent analysis

TL;DR

The most likely fix is to investigate and potentially revert changes in the system prompt and system tools in Claude Code version 2.1.111, as these components show a significant increase in token usage compared to version 2.1.110.

Guidance

  1. Review System Prompt and Tools: Investigate the changes made to the system prompt and system tools between versions 2.1.110 and 2.1.111, as these are the primary contributors to the increased token usage.
  2. Compare Configuration: Although the configuration, including plugins and custom agents, was the same for both measurements, double-check for any subtle differences that might affect token usage.
  3. Test with Minimal Configuration: Run the test with a minimal configuration (without plugins and custom agents) to isolate if the issue is related to the base system or the added components.
  4. Check for Updates or Fixes: Look for any updates or patches for version 2.1.111 that might address the increased token usage issue.

Example

No specific code changes can be suggested without more details on the internal implementation of Claude Code. However, if the issue is identified in a specific part of the system prompt or tools, adjustments to those areas might be necessary.

Notes

The provided error messages do not directly relate to the token usage issue but indicate authentication and potential multi-process scenario problems. These should be addressed separately to ensure a clean testing environment.

Recommendation

Apply a workaround by potentially downgrading to version 2.1.110 if the increased token usage significantly impacts performance or cost, until the root cause is identified and fixed in version 2.1.111.

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