web_interact — Claude Code prompt for browser actions
The web_interact prompt for Claude Code and ChatGPT adds mouse and keyboard actions beyond web_tap and web_type_text. Use it to open hover menus, drag items, choose native dropdown options, or handle page dialogs.
Apache-2.0 ★ 9,488 updated 2026-11-16
.claude/commands/web_interact.mdWhat web_interact does
The prompt defines mouse and keyboard actions for web pages: hovering over an element or coordinate, dragging, choosing an option in a native dropdown, and pressing a key or key combination. It can also accept or dismiss alerts, confirmations, prompts, and leave-page checks; prompt dialogs can receive text.
While a dialog is open, other actions fail until it gets an answer. Hover, drag, and dropdown selection need a DevTools connection for the tab. Without one, those actions fail, and the prompt directs the agent to use web_tap instead. To install it in Claude Code, put the file at .claude/commands/web_interact.md.
What it helps with
- open a hover menu or tooltip
- drag an item or move a slider
- choose an option from a native dropdown
- press a key or shortcut on the focused element
- respond to a page dialog before continuing
Example prompts for the agent
- Hover over the menu button to reveal its options.
- Drag the card to the position shown on the page.
- Dismiss the confirmation dialog, then continue on the page.
How to install web_interact
Manually: put the files in place
.claude/commands/web_interact.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about web_interact
How do I install web_interact in Claude Code?
Place the prompt file at .claude/commands/web_interact.md.
What does web_interact do?
It defines browser actions for mouse and keyboard input, including hovering, dragging, selecting dropdown options, pressing keys, and responding to dialogs.
What does web_interact need to work?
Hover, drag, and dropdown selection require a DevTools connection for the tab. Without it, use web_tap for those interactions.
Source text
web_interact.md · Apache-2.0
Mouse and keyboard actions on the web page that web_tap and web_type_text cannot do. hover: move the mouse onto an element (ref+snapshotId) or point (x,y) to open hover menus and tooltips. drag: press at the element or point, move in steps and release over toRef (same snapshotId) or toX,toY (sliders, drag-to-sort, drag and drop). select: pick an option of a native drop-down (role combobox from a <select>) by its shown text or value. key: press a key or combination on the focused element, e.g. Escape, Shift+Tab, Control+A, ArrowDown. dialog: answer the dialog the page opened (alert, confirm, prompt or leave-page check, shown as dialog in the screen read): answer accept or dismiss, and text for a prompt. While a dialog is open the page is paused and every other action fails with dialog_open; it stays open until you answer it. hover, drag and select fail with devtools_unavailable when this tab has no DevTools connection; then use web_tap instead. The result's effect says what the action did to the interface: done (a clear change), small_change (only focus, a toggle or one or two elements changed, or it may still be loading: check it), no_effect (nothing in the interface changed: try another way instead of repeating) or place_changed (now somewhere else, given in effect.to).
© wangzan101 · Apache-2.0 · wangzan101/Mika