[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
- Open Claude Code inside PyCharm or IntelliJ's embedded terminal
- Start a session and run the
/costcommand - The usage screen opens — you can navigate left/right between different screens of the usage dashboard
- Attempt to return to the chat
Expected Behavior
Pressing Esc (as documented on-screen) should return to the chat session.
Actual Behavior
Escdoes not return to the chatqdoes not workCtrl+Cdoes 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
costThresholdsetting can partially mitigate the cost risk, but users still need to be able to check usage mid-session.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗