Claude for Chrome
This skill provides guidance for interacting with Chrome browser using tree references and the accessibility tree.
Core Principles
- •Use
read_pageto get element refs from the accessibility tree - •Use
findto locate elements by description - •Click/interact using
ref, not coordinates - •NEVER take screenshots unless explicitly requested by the user
Interactive CLIs with tmux
For interactive command-line interfaces, you can use tmux. The pattern is:
- •Start a tmux session
- •Send commands to it
- •Capture the output
- •Verify it's what you expect
Why Tree Refs?
Tree references are more reliable and maintainable than:
- •Screenshots: Can fail with visual changes, different screen sizes, or themes
- •Coordinates: Break when page layout changes
- •XPath/CSS selectors: Can be fragile and hard to maintain
The accessibility tree provides semantic references that are stable and meaningful.
Best Practices
- •Always use
read_pagefirst to understand the page structure - •Use
findwith descriptive text to locate elements (e.g., "Submit button", "Email input field") - •Reference elements by their
refvalue when interacting - •Verify successful interactions by reading the page state again