[BUG] /btw command: permission prompts not displayed, agent hangs indefinitely
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 using the /btw command to send a background note to the agent, if the agent needs to execute a tool that requires user permission approval (e.g., running a Bash command, writing a file, etc.), the permission prompt is not displayed to the user. The agent enters a waiting state expecting the user to approve or deny the permission, but no prompt appears in the terminal — leaving the session completely frozen with no way to respond.
The user has no indication that the agent is waiting for input, and there is no timeout or fallback mechanism that would allow the session to recover.
What Should Happen?
When an agent triggered via /btw requires a permission approval, the permission prompt should be rendered in the terminal exactly as it is when the agent is triggered interactively. The user should be able to approve or deny the action and the agent should continue normally.
Alternatively, if /btw operates in a context where interactive permission prompts are not supported, the agent should either:
- Automatically apply the configured permission mode (e.g., deny by default), or
- Surface a clear error message explaining why the
/btwcommand cannot proceed.
Error Messages/Logs
No error output is shown. The terminal appears to be waiting silently with a blinking cursor and no interactive prompt rendered. The only visible state is the agent's last text output before it attempted the tool call.
Steps to Reproduce
- Start a Claude Code session in any project directory.
- Use the
/btwcommand to send a message that will cause the agent to attempt a tool call requiring permission (e.g.,/btw please create a file called test.txt with "hello world"). - Observe that the agent processes the request and internally attempts a
WriteorBashtool call. - The permission prompt (which normally asks "Do you want to allow this?") is never displayed.
- The session hangs indefinitely — the agent is waiting for a response the user cannot provide.
- The only recovery is to force-quit the process (Ctrl+C).
Note: The issue is consistently reproducible when the /btw input causes the agent to attempt any tool that normally requires user approval in the current permission mode.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Claude Code Version
2.1.73 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
- Permission mode in use: default (not
--dangerously-skip-permissions) - The
/btwcommand was introduced recently; this bug appears to be specific to how/btwhandles the interactive permission flow — it likely spawns the agent in a non-interactive sub-context where the UI layer for permission prompts is not wired up. - A potential root cause:
/btwmay be running the agent without attaching the permission prompt renderer to the current TTY, so the prompt is generated internally but never surfaced to stdout/the terminal.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗