# Phase 2: Window and Region Targeting - Discussion Log

> **Audit trail only.** Do not use as input to planning, research, or execution agents.
> Decisions are captured in CONTEXT.md — this log preserves the alternatives considered.

**Date:** 2026-04-12
**Phase:** 02-window-and-region-targeting
**Mode:** --auto (all decisions auto-selected)
**Areas discussed:** Tool interface, Window matching, list_windows design, Target failure handling

---

## Tool Interface Changes

| Option | Description | Selected |
|--------|-------------|----------|
| Extend start_capture | Add optional target params to existing tool — backward compatible | ✓ |
| New tools per target | Separate start_window_capture, start_region_capture tools | |
| Target as separate tool | Set target first, then start_capture uses it | |

**User's choice:** [auto] Extend start_capture — avoids tool proliferation, backward compatible
**Notes:** Discriminated union on `target` field: "desktop" | "window" | "region"

---

## Window Matching Strategy

| Option | Description | Selected |
|--------|-------------|----------|
| Handle + title substring | Support both exact handle and case-insensitive title substring | ✓ |
| Handle only | Require list_windows first, use handle | |
| Regex title match | Full regex support for window title matching | |

**User's choice:** [auto] Handle + title substring — handle for precision, substring for convenience
**Notes:** Multiple title matches → use first match, include matched title in metadata

---

## list_windows Tool Design

| Option | Description | Selected |
|--------|-------------|----------|
| Full metadata | Title, handle, process name, window dimensions | ✓ |
| Minimal | Title and handle only | |
| With thumbnails | Include small preview images | |

**User's choice:** [auto] Full metadata — covers all practical identification needs
**Notes:** No filtering params in v1; return all visible windows

---

## Target Failure Handling

| Option | Description | Selected |
|--------|-------------|----------|
| Skip and continue | Skip frame, record placeholder, continue capture | ✓ |
| Abort session | Error the entire session when target unavailable | |
| Pause and retry | Wait for window to reappear | |

**User's choice:** [auto] Skip and continue — graceful degradation, agent gets partial data
**Notes:** 3 consecutive failures → error the session (window likely gone permanently)

---

## Claude's Discretion

- Window enumeration filtering (exclude zero-size/invisible)
- Error message wording
- Internal caching for window handle lookups
- Whether to add stop_capture tool or defer

## Deferred Ideas

None
