[BUG] EnterWorktree approval dialog in a --bg session is not relayed to Remote Control, session hangs silently
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?
A background session started with claude --bg ... --remote-control <name> hit the EnterWorktree approval dialog for a worktree outside .claude/worktrees/. That dialog was rendered only in the session's local TUI (visible through claude logs <id>). It was never surfaced through Remote Control: not in the Claude desktop app, not in the mobile app, and not through the session's channel integration.
The session was still listed as connected via Remote Control and showed waiting in claude agents, but there was no way to answer the dialog remotely. It sat blocked for about 30 minutes until someone noticed and attached from a terminal.
For a --bg session, the local TUI is the one place nobody is looking, so any dialog that is only rendered there turns into a silent hang.
Related but different: #94265 and #77069 are about how often this approval is required. This report is about where the dialog is delivered.
What Should Happen?
Either:
- the dialog is relayed to Remote Control clients (desktop/mobile) like other permission requests, so it can be approved remotely; or
- when no interactive surface can answer it (a
--bgsession), the tool call fails fast with a clear error the model can act on (for example "EnterWorktree outside .claude/worktrees requires interactive approval"), instead of blocking indefinitely.
Error Messages/Logs
Tool use
Entering worktree(<repo>/projects/<app>/.claude/worktrees/<name>)
Creates an isolated worktree (via git or configured hooks) and switches the session into it
permission-root relocation to "<repo>/projects/<app>/.claude/worktrees/<name>" — a model-supplied worktree outside .claude/worktrees/
Do you want to proceed?
❯ 1. Yes
2. No
Esc to cancel · Tab to amend
(from claude logs <id>; the Remote Control apps showed nothing to approve)
Steps to Reproduce
- In a git repo
Athat contains a nested, independent git repoA/projects/B, create a worktree ofBatA/projects/B/.claude/worktrees/w(plaingit worktree add). - From
A, launch a background session with Remote Control:
claude --bg --worktree x --name x --remote-control x --permission-mode auto 'Enter the worktree at A/projects/B/.claude/worktrees/w with EnterWorktree and list its files'
- Open the session
xin the Claude desktop or mobile app via Remote Control. - Observe: the app shows nothing to approve.
claude agentsshows the session aswaiting.claude logs <id>shows theEnterWorktree"Do you want to proceed?" dialog above. - The session stays blocked until someone runs
claude attach <id>and answers in the terminal.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.281 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Non-interactive/CI environment
Additional Information
- The session was started with
--permission-mode auto. - Not verified: whether other permission dialogs from a
--bgsession reach Remote Control correctly and only thisEnterWorktreerelocation dialog is affected, or whether no local-TUI dialogs are relayed.