# APP-4902 - window-scoped background focus suppression

APP-4902 - window-scoped background focus suppression is a Claude Code subagent that narrows Warp focus blocking during background computer-use sessions.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 720 repo stars
- Author: dominikmartn
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Updated: 2026-11-10
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/app-4902-window-scoped-background-focus-suppression

## What it does

This subagent defines a macOS fix for background computer-use in Warp. It keeps the selected window controllable without raising it, while independent focus changes to other Warp windows continue normally.

The change covers per-PID event taps, the activation primer, `ActiveSession`, and `TapContext`. Focus events `13`, `19`, and `20` are dropped only when their window identity matches the target activation; events for another window, missing identity, or the target-process tap pass through. Each session carries its own activation state, and teardown preserves the existing focus-restoration lifecycle. The scenario uses AppKit, `CGEvent`, and window-addressing fields.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/agents/APP-4902---window-scoped-background-focus-suppression.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/APP-4902---window-scoped-background-focus-suppression.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/APP-4902---window-scoped-background-focus-suppression.md` — Cursor also reads .claude/agents/

## When to use it
- keep a background Warp window controllable
- let users focus another Warp window during computer-use
- separate activation state across concurrent sessions
- restore the previous frontmost window during teardown
- test filtering for focus events `13`, `19`, and `20`

## Example prompts
- Implement APP-4902 in `crates/computer_use/src/mac/activation.rs` while preserving the existing event-tap order and activation primer.
- Add regression coverage for window-identity focus filtering in `crates/computer_use/src/mac/activation_tests.rs`.
- Check that concurrent sessions and owner-scoped teardown keep their activation state isolated.

## Similar
- [cmux-cua](https://affpapa.org/en/nevibecode/skills/cmux-cua.md) — skill · 1200 installs
- [window-management](https://affpapa.org/en/nevibecode/skills/window-management.md) — skill · 58 installs
- [argent-macos-app-interact](https://affpapa.org/en/nevibecode/skills/argent-macos-app-interact.md) — skill · 1700 installs
- [app-store-preflight-skills](https://affpapa.org/en/nevibecode/skills/app-store-preflight-skills.md) — skill · 2200 installs
- [new-mac-app](https://affpapa.org/en/nevibecode/skills/new-mac-app.md) — skill · 1000 installs
- [test-mac-app](https://affpapa.org/en/nevibecode/skills/test-mac-app.md) — skill · 1000 installs

From the same set: [dominikmartn/harp](https://affpapa.org/en/nevibecode/by/dominikmartn/harp.md) — 62 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
