anthropics / anthropics/claude-code
Feature request: option to prevent the app window from stealing focus when a session needs attention
- Dominant language
- Python
- Stars
- 145k
- Forks
- 23.1k
- PR merge metrics
- PR metrics pending
Description
## Summary
When a running Claude Code session needs the user's attention (a permission prompt appears, or a task finishes and is waiting on input), the **desktop app window forcibly comes to the foreground and steals focus** from whatever other application the user is actively working in on macOS.
## Why this is disruptive
If the user is focused on unrelated work in another app (writing, browser, design tool, etc.) and a background Claude Code session — especially a long-running agentic task doing many tool calls — needs a permission decision, the app yanks the user's attention away immediately and interrupts whatever they were doing, rather than just signaling that attention is needed (sound, badge, banner) and letting the user switch over when ready.
This gets worse the more sessions/scheduled tasks a user runs in parallel, since each one needing attention can trigger an unwanted focus-steal at an arbitrary moment.
## What's already configurable (and why it doesn't fully solve this)
- `inputNeededNotifEnabled` — push notification when Claude is waiting on input
- `preferredNotifChannel` — choose between terminal bell or desktop notification for task completion
Switching `preferredNotifChannel` to `"terminal-bell"` avoids the OS notification banner, but does not appear to stop the app window itself from coming to the front — the foreground-steal seems to be separate, hardcoded behavior tied to "needs attention" state rather than to the notification channel setting.
## Requested behavior
Please add a setting (e.g. `stealFocusOnAttentionNeeded: false` in `settings.json`, or a toggle in the desktop app's Preferences) that lets the user opt out of the window being forced to the foreground when a session needs attention — while still surfacing *some* passive signal (dock badge, sound, system notification) so the user can switch over on their own terms instead of being interrupted mid-task in another app.
## Environment
- macOS (Darwin), Claude Code desktop app
- Affects any workflow running multiple parallel/background sessions or scheduled tasks that may need permission input at unpredictable times
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.