web_wait_for — Claude Code prompt: wait for page events
The web_wait_for Claude Code prompt waits for a change on the current tab. It checks page text, the URL, or network activity for a set time.
Apache-2.0 ★ 9,488 updated 2026-11-16
.claude/commands/web_wait_for.mdWhat web_wait_for does
web_wait_for watches the current tab until a condition is met or the time limit expires. Its result is met=true on success and met=false on timeout. Conditions cover text appearing or disappearing, a matching part of the URL, and network_idle, which means no requests for half a second.
The network_idle check needs devtools; without them, it returns devtools_unavailable. Page actions already pause briefly, while this prompt handles slower changes. For Claude Code, place the command file at .claude/commands/web_wait_for.md.
What it helps with
- wait for text to appear on a page
- check whether text has disappeared
- wait for the URL to include a given string
- wait for network requests to stop
Example prompts for the agent
- Wait up to 20 seconds for “Order complete” to appear on the current tab.
- Wait no more than 15 seconds for the tab URL to contain
/account. - Wait for
network_idleon the current tab for up to 30 seconds.
How to install web_wait_for
Manually: put the files in place
.claude/commands/web_wait_for.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about web_wait_for
How do I install web_wait_for in Claude Code?
Place the command file at .claude/commands/web_wait_for.md.
What does web_wait_for do?
It waits for text to appear or disappear, a URL match, or a period without network requests on the current tab. It returns met=true when the condition is reached before the time limit.
What does the network_idle check require?
It requires devtools. Without them, the prompt returns devtools_unavailable.
Source text
web_wait_for.md · Apache-2.0
Wait until something happens on the current tab, at most {{max_seconds}} seconds: text_present / text_absent (page text contains value or not), url_contains (the address contains value), network_idle (no requests for half a second; needs devtools, else devtools_unavailable). Returns met=true when it happened, met=false when the time ran out. Page actions already wait briefly on their own; use this for slower changes.
© wangzan101 · Apache-2.0 · wangzan101/Mika