[BUG] /cost command causes session to freeze on v2.1.158

Resolved 💬 1 comment Opened Jun 9, 2026 by ashermis-neosec Closed Jul 16, 2026

Description

Running the /cost command opens a usage dashboard screen, but it becomes impossible to return to the chat session. The issue occurs specifically in IDE-embedded terminals (PyCharm / IntelliJ).

Steps to Reproduce

  1. Open Claude Code inside PyCharm or IntelliJ's embedded terminal
  2. Start a session and run the /cost command
  3. The usage screen opens — you can navigate left/right between different screens of the usage dashboard
  4. Attempt to return to the chat

Expected Behavior

Pressing Esc (as documented on-screen) should return to the chat session.

Actual Behavior

  • Esc does not return to the chat
  • q does not work
  • Ctrl+C does not work
  • The only recovery is killing and restarting the entire session

Impact

This effectively makes /cost unusable in IDE terminals, which is a significant problem for cost monitoring. Without being able to check costs mid-session, users risk runaway spending (e.g., $60+ sessions).

Environment

  • Claude Code version: 2.1.158
  • Platform: macOS (Darwin)
  • Terminal: PyCharm / IntelliJ embedded terminal
  • Works on: v2.1.52 (no issue)

Notes

  • The issue likely relates to how IDE-embedded terminals handle key events differently than standalone terminals (e.g., iTerm2, Terminal.app).
  • A costThreshold setting can partially mitigate the cost risk, but users still need to be able to check usage mid-session.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗