claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] `/context` command has displays the context delayed and only temporarily

Open wzhang2022 opened this issue 10 months ago • 7 comments

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?

Running /context shows a delayed visualization of token usage that disappears from the screen

What Should Happen?

The context display should remain on the screen and show up immediately.

Steps to Reproduce

  1. Start claude session
  2. Run /context

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.7

Claude Code Version

2.1.11

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

IntelliJ IDEA terminal

Additional Information

Here you can see that the context display disappears after a few seconds.

https://github.com/user-attachments/assets/9a0191ce-bfca-4a75-ad32-a6204f110588

wzhang2022 avatar Jan 17 '26 02:01 wzhang2022

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18562
  2. https://github.com/anthropics/claude-code/issues/18521
  3. https://github.com/anthropics/claude-code/issues/18488

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Jan 17 '26 02:01 github-actions[bot]

Additional Reproduction Details

Confirming this issue on v2.1.11.

My observations:

  • /context shows token usage briefly then vanishes after ~5 seconds
  • Happens even without window resize
  • Tested with all plugins disabled - still occurs

Environment:

  • Claude Code: 2.1.11
  • macOS: Darwin 25.0.0 (arm64)
  • Terminal: Ghostty 1.2.3, Terminal.app (both affected)
  • Shell: zsh

Troubleshooting attempted (none resolved):

  • Disabled custom statusLine config
  • Disabled claude-hud plugin
  • Removed all hooks from settings.json
  • Set Ghostty shell-integration-features = no-cursor

This appears related to other TUI rendering issues I'm experiencing:

  • #17816 (slash command highlight offset)
  • #18493 (resize content loss)
  • #18797 (cursor blinks below status bar)

These issues may share a common root cause in the TUI rendering layer, possibly a regression in v2.1.x.

Kari-Basavaraj avatar Jan 17 '26 10:01 Kari-Basavaraj

Same here!

SerkanSipahi avatar Jan 17 '26 11:01 SerkanSipahi

This may be related to #18298 and #18370 (MCP Tool Search not auto-enabling).

Hypothesis: Both issues involve processing MCP tool metadata:

  1. /context needs to calculate MCP tool token usage → crashes/flashes
  2. Auto-enable check needs to calculate "are MCP tools > 10%?" → fails silently

If the MCP tool counting/processing code is broken, both would fail. Setting ENABLE_TOOL_SEARCH=true env var bypasses the auto-detection and makes MCP tool search work, but /context still crashes.

Environment:

  • 7-8 MCP servers configured
  • MCP tools consuming ~50k tokens (25% of context) when loaded upfront
  • ENABLE_TOOL_SEARCH=true makes tool search work, but /context still flashes briefly then resets

CybotTM avatar Jan 17 '26 11:01 CybotTM

I did all the same troubleshooting and issue remains in 2.1.12

brian-poillucci avatar Jan 17 '26 18:01 brian-poillucci

Same here

bw2 avatar Jan 17 '26 23:01 bw2

Same here

JohnGaros avatar Jan 18 '26 10:01 JohnGaros

Same here

erick-siordia avatar Jan 19 '26 20:01 erick-siordia

Same here

LudovicPelleDMS avatar Jan 20 '26 10:01 LudovicPelleDMS

same here

ias-z avatar Jan 20 '26 14:01 ias-z

This was fixed in v2.1.14 — The /context overlay now stays open instead of appearing briefly and closing while message processing finishes. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

ashwin-ant avatar Apr 18 '26 04:04 ashwin-ant

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.

github-actions[bot] avatar Apr 26 '26 14:04 github-actions[bot]