[Bug] Local commands hang after idle session periods
Bug Description
---
Title: /usage (and other local commands) hang when session has been idle
Description:
When a Claude Code session has been idle for a while (no traffic between client and backend), local commands like /usage and /status stop responding — they show no output and hang
indefinitely.
Current workaround (painful):
The only reliable way to "wake up" the session is to type some characters into the prompt, press ESC to cancel, and then run /usage. This works but:
- wastes tokens / context if any text leaks into history
- is unintuitive and undiscoverable
- feels like a bug users have to learn around
Why other workarounds don't help:
- Restarting the CLI / opening a new claude session works, but spawns a full new Node process. On low-memory machines without swap this can OOM the shell.
- /status has the same idle-hang problem, so it can't be used as a "wake-up ping".
Suggested fix:
Have /usage (and similar local-only commands) trigger a lightweight session reconnect / keepalive ping before rendering, so they work even after long idle periods. Should be a small change
— the command already knows it needs backend data.
Environment:
- OS: Linux (Manjaro, kernel 6.6.119)
- Shell: bash
- Claude Code: latest
This has been reproducible for a long time and hasn't been fixed
---
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗