Desktop Control
Unified skill for all UI automation. Chooses between CDP and Computer Use based on the target, and reports meaningful actions with a path= + action_class= transcript.
This skill is already injected into your system prompt. Do not run sed, cat, head, or Read to load it from disk. Guessing absolute paths like /Users/*/.codex/skills/... or /Users/*/.cli-jaw-*/skills/... wastes a turn and often targets a file that doesn't exist. If you need a specific reference file (e.g., reference/computer-use.md), use cli-jaw skill read jaw-desktop-control <ref-name>.
When to use
Trigger on any request that touches a visible UI:
- User message contains
$computer-use or /computer-use → skip routing analysis, jump straight to reference/computer-use.md. Explicit user opt-in. If Computer Use tools are not available, stop with precondition failed: computer-use unavailable.
- "open this URL / click this button / type in this field" → read
reference/cdp.md
- "switch Chrome tab / open Finder / click System Settings" → read
reference/computer-use.md
- "click the thing inside this Canvas / WebGL / iframe" → read
reference/vision-click.md
- Not sure which path → read
reference/intent-routing.md FIRST
- Want a real end-to-end example → read
reference/control-workflow.md
Absolute rules
- Announce the path before acting. First line of every task must be
path=cdp, path=computer-use, or path=cdp+cu.
- Computer Use always starts each assistant turn with a state read before interacting. Re-read on stale warnings, after actions that change UI state, and whenever confidence drops.
- Every meaningful action records an
action_class. Classes: state-read, element-action, value-injection, keyboard-action, pointer-action, pointer-action+vision, scroll-action, drag-action, secondary-action.
- Never fall back silently. If the required path is unavailable, stop and report which precondition failed.
- Never claim the cursor was visible. Cursor overlay is best-effort in the current build.
- When uncertain, take a screenshot FIRST. If you ever find yourself guessing — "is that tab 342 or 357?", "did the click actually land?", "is this the right page?" — stop and re-ground via the platform's state read (Computer Use) or
cli-jaw browser snapshot (CDP). Never chain actions through uncertainty. Guessing indices or URLs leads to infinite correction loops. If two consecutive actions produced ambiguous state, the next call must be a state-read, not another action.
Preconditions (Computer Use path)
- macOS or Windows. Linux, WSL, and Docker have no Computer Use host — use CDP there.
- The tool surface belongs to the host and changes between versions — do not assume tool names. Read
reference/computer-use.md before the first call: it explains how to establish the surface from what is actually exposed, and why an enabled plugin is not proof its tools are callable.
- macOS Computer Use is app-scoped: select an app, then read its state. Windows is window-scoped: enumerate windows, then read one window's state.
- On Windows an enumeration that answers proves nothing about the connection, and an empty window list usually means the transport is not connected rather than that no windows are open.
- If packaged through cli-jaw,
/Applications/Jaw.app and /Applications/Codex Computer Use.app may be required for TCC attribution. Missing app bundles are a setup issue, not a reason to silently switch paths.
- macOS: TCC Accessibility and AppleEvents must be granted to the controlling app.
- Windows: the Codex desktop app must be running in the logged-on session — it creates the named pipe. A locked screen is fine; logged out is not.
Transcript format (standard)
CDP action:
path=cdp
url=https://example.com
action=click e3
result=ok
Computer Use action:
path=computer-use
app=Google Chrome
action_class=element-action
action=click(element_index=730)
stale_warning=no
result=ok
Hybrid (lookup via CDP, action via Computer Use):
path=cdp+cu
lookup=cli-jaw browser snapshot → bbox of "Play"
action_class=pointer-action
action=click(x=812, y=514)
result=ok
Related skills
browser — CDP command reference (this skill supersedes its coverage).
screen-capture — generic macOS screenshot / webcam / video recording (unchanged).
vision-click — no longer auto-active. Absorbed as a tactic in reference/vision-click.md. If you need the low-level recipe (NDJSON parsing, DPR correction), run cli-jaw skill install vision-click.
Common failures and the only correct responses
| Symptom |
Correct report |
| "I don't see a cursor" |
cursor overlay is best-effort in the current build — action=click(...) succeeded; visible cursor not guaranteed |
| CDP server not running |
precondition failed: cli-jaw serve not running. Start with 'jaw serve' and retry. |
| Computer Use tools missing |
precondition failed: computer-use unavailable |
| cli-jaw CU app missing in packaged install |
precondition failed: /Applications/Codex Computer Use.app missing. Recover: jaw doctor --tcc --fix |
| Stale warning on action |
re-read state then retry; log stale_warning=yes in the transcript |
| Non-GUI task routed here |
needs boss follow-up: not GUI automation |
1---2name: jaw-desktop-control3description: Unified desktop + browser automation. Routes DOM targets to CDP (cli-jaw browser), desktop apps to Computer Use, hybrid combos to both. Codex desktop/CLI required for Computer Use; macOS is app-scoped and Windows is window-scoped.4---56# Desktop Control78Unified skill for all UI automation. Chooses between CDP and Computer Use based on the target, and reports meaningful actions with a `path=` + `action_class=` transcript.910> **This skill is already injected into your system prompt.** Do not run `sed`, `cat`, `head`, or `Read` to load it from disk. Guessing absolute paths like `/Users/*/.codex/skills/...` or `/Users/*/.cli-jaw-*/skills/...` wastes a turn and often targets a file that doesn't exist. If you need a specific reference file (e.g., `reference/computer-use.md`), use `cli-jaw skill read jaw-desktop-control <ref-name>`.1112## When to use1314Trigger on any request that touches a visible UI:1516- **User message contains `$computer-use` or `/computer-use`** → **skip routing analysis**, jump straight to [`reference/computer-use.md`](reference/computer-use.md). Explicit user opt-in. If Computer Use tools are not available, stop with `precondition failed: computer-use unavailable`.17- "open this URL / click this button / type in this field" → read [`reference/cdp.md`](reference/cdp.md)18- "switch Chrome tab / open Finder / click System Settings" → read [`reference/computer-use.md`](reference/computer-use.md)19- "click the thing inside this Canvas / WebGL / iframe" → read [`reference/vision-click.md`](reference/vision-click.md)20- Not sure which path → read [`reference/intent-routing.md`](reference/intent-routing.md) FIRST21- Want a real end-to-end example → read [`reference/control-workflow.md`](reference/control-workflow.md)2223## Absolute rules24251. **Announce the path before acting.** First line of every task must be `path=cdp`, `path=computer-use`, or `path=cdp+cu`.262. **Computer Use always starts each assistant turn with a state read before interacting.** Re-read on stale warnings, after actions that change UI state, and whenever confidence drops.273. **Every meaningful action records an `action_class`.** Classes: `state-read`, `element-action`, `value-injection`, `keyboard-action`, `pointer-action`, `pointer-action+vision`, `scroll-action`, `drag-action`, `secondary-action`.284. **Never fall back silently.** If the required path is unavailable, stop and report which precondition failed.295. **Never claim the cursor was visible.** Cursor overlay is best-effort in the current build.306. **When uncertain, take a screenshot FIRST.** If you ever find yourself guessing — "is that tab 342 or 357?", "did the click actually land?", "is this the right page?" — **stop** and re-ground via the platform's state read (Computer Use) or `cli-jaw browser snapshot` (CDP). Never chain actions through uncertainty. Guessing indices or URLs leads to infinite correction loops. If two consecutive actions produced ambiguous state, the **next call must be a state-read**, not another action.3132## Preconditions (Computer Use path)3334- macOS or Windows. Linux, WSL, and Docker have no Computer Use host — use CDP there.35- **The tool surface belongs to the host and changes between versions — do not assume tool names.** Read [`reference/computer-use.md`](reference/computer-use.md) before the first call: it explains how to establish the surface from what is actually exposed, and why an enabled plugin is not proof its tools are callable.36- macOS Computer Use is app-scoped: select an app, then read its state. Windows is window-scoped: enumerate windows, then read one window's state.37- On Windows an enumeration that answers proves nothing about the connection, and an empty window list usually means the transport is not connected rather than that no windows are open.38- If packaged through cli-jaw, `/Applications/Jaw.app` and `/Applications/Codex Computer Use.app` may be required for TCC attribution. Missing app bundles are a setup issue, not a reason to silently switch paths.39- macOS: TCC Accessibility and AppleEvents must be granted to the controlling app.40- Windows: the Codex desktop app must be running in the logged-on session — it creates the named pipe. A locked screen is fine; logged out is not.4142## Transcript format (standard)4344CDP action:4546```47path=cdp48url=https://example.com49action=click e350result=ok51```5253Computer Use action:5455```56path=computer-use57app=Google Chrome58action_class=element-action59action=click(element_index=730)60stale_warning=no61result=ok62```6364Hybrid (lookup via CDP, action via Computer Use):6566```67path=cdp+cu68lookup=cli-jaw browser snapshot → bbox of "Play"69action_class=pointer-action70action=click(x=812, y=514)71result=ok72```7374## Related skills7576- `browser` — CDP command reference (this skill supersedes its coverage).77- `screen-capture` — generic macOS screenshot / webcam / video recording (unchanged).78- `vision-click` — **no longer auto-active**. Absorbed as a tactic in `reference/vision-click.md`. If you need the low-level recipe (NDJSON parsing, DPR correction), run `cli-jaw skill install vision-click`.7980## Common failures and the only correct responses8182| Symptom | Correct report |83|---|---|84| "I don't see a cursor" | `cursor overlay is best-effort in the current build — action=click(...) succeeded; visible cursor not guaranteed` |85| CDP server not running | `precondition failed: cli-jaw serve not running. Start with 'jaw serve' and retry.` |86| Computer Use tools missing | `precondition failed: computer-use unavailable` |87| cli-jaw CU app missing in packaged install | `precondition failed: /Applications/Codex Computer Use.app missing. Recover: jaw doctor --tcc --fix` |88| Stale warning on action | re-read state then retry; log `stale_warning=yes` in the transcript |89| Non-GUI task routed here | `needs boss follow-up: not GUI automation` |