[BUG] Claude Agents has buggy behaviour with agent invocation via CLI
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?
When I launch an agent in the background via CLI and try to access it via the claude agents menu. After I hover over the session and press Enter or Right arrow, I get an error and I can't access the session no matter what I do until it finishes responding to the prompt. In the mean time, that session proceeds to fail getting any necessary permissions for the task and burns way more tokens than it would ever need (launched two tasks that after 5 minutes I estimate that they should have used a hard maximum of 15% of my 5h usage combined and it burned all I had left which was around 70% remaining usage).
What Should Happen?
Ideally, I should be able to access those sessions, testament to this is that I can see them in the claude agents menu. I also don't understand why are they burning all the tokens away, but I'm not sure why it happens.
Error Messages/Logs
"Session can't redraw right now — Ctrl+Z to detach"
Steps to Reproduce
- Launch an agent with a task that requires permissions:
``bash``
claude --bg --model opus --effort low -p "Delete the file X"
- Open the claude agents menu:
claude agents
- Try to access the session via the Right Arrow or the Enter key
- Get the error message "Session can't redraw right now — Ctrl+Z to detach"
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.195 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
The terminal I'm using is WezTerm. Nevertheless, I don't believe it has much to do with the problem.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗