Stably CLI is an AI agent that can control a browser — it navigates pages, fills forms, clicks buttons, and interacts with your application just like a real user. This makes it a powerful sub-agent for Claude Code when you need to:
Validate that a feature actually works in the browser
Create end-to-end tests by interacting with your live application
Debug and fix failing tests with real browser context
Claude Code itself cannot control browsers, but by using Stably as a sub-agent, it gains the ability to verify features, generate tests, and maintain your test suite — all through real browser interactions.
Install the Stably agent skills to teach Claude Code how to use Stably CLI:
Copy
npx skills add stablyai/agent-skills
Once installed, Claude Code automatically knows when to invoke Stably. When you request tasks that require browser interaction (like “verify the login works” or “create tests for checkout”), Claude Code will recognize this and spawn Stably as a sub-agent to handle the browser automation.You can also explicitly ask Claude Code to use Stably:
“Use Stably to test the signup flow”
“Run Stably to verify the payment form works”
Use Stably to validate that a feature works correctly without saving the test. This is useful for quick verification during development.
Copy
stably create "verify the login form accepts valid credentials and shows an error for invalid ones" --no-save
Or instruct Claude Code with a prompt like:
“Use Stably to validate that the new checkout flow works, but don’t save the test”
The agent will run stably create with instructions to validate the feature and report results without persisting test files.
Example: Feature Validation Flow
Copy
You: Validate that the new user registration form works correctlyClaude Code (invoking Stably sub-agent): → Running: stably create "validate user registration form - check required fields, email validation, password requirements, and successful submission" --no-save ✓ Validation complete: • Required field validation: PASS • Email format validation: PASS • Password requirements: PASS • Form submission: PASS The registration feature is working as expected.
Generate and save Playwright tests for new features or existing functionality.
Copy
stably create "comprehensive tests for the shopping cart - add items, update quantities, remove items, apply discount codes"
The prompt is optional. When omitted, Stably automatically analyzes the current PR (in CI) or git diffs against origin/HEAD (locally) to generate relevant tests.
Or ask Claude Code:
“Create tests for the payment processing flow”
The agent will invoke stably create to generate test files in your project’s test directory.
Example: Test Creation Flow
Copy
You: Create tests for the dashboard analytics widgetsClaude Code (invoking Stably sub-agent): → Running: stably create "tests for dashboard analytics widgets - verify data loading, chart rendering, date range filtering, and export functionality" Created files: - tests/dashboard-analytics-data-loading.spec.ts - tests/dashboard-analytics-charts.spec.ts - tests/dashboard-analytics-filters.spec.ts - tests/dashboard-analytics-export.spec.ts ✓ 4 test files generated covering the dashboard analytics features.
Execute tests and automatically fix failures using AI-powered analysis.
Copy
# Run testsstably test# If failures occur, fix them automaticallystably fix
Or ask Claude Code:
“Run the tests and fix any failures”
The agent will execute stably test, analyze any failures, and apply fixes with stably fix.
Example: Test Run and Fix Flow
Copy
You: Run all tests and fix any issuesClaude Code (invoking Stably sub-agent): → Running: stably test Test Results: 47 passed, 3 failed → Running: stably fix Analyzing 3 failures... checkout.spec.ts > apply discount code Issue: Selector '.discount-input' not found Fix: Updated to '[data-testid="promo-code-field"]' ✓ Fixed user-profile.spec.ts > update avatar Issue: File upload timeout Fix: Increased timeout and added wait for upload complete ✓ Fixed navigation.spec.ts > mobile menu Issue: Element not visible in viewport Fix: Added scroll into view before interaction ✓ Fixed ✓ All 3 failures auto-fixed. Re-running verification... → Running: stably test Test Results: 50 passed, 0 failed
Use validation first — Before committing a feature, ask Claude Code to validate it with Stably. This catches issues early without cluttering your test suite.
Batch test creation — When adding multiple features, create tests for all of them in one request to maintain consistent coverage.
Automate fix cycles — For flaky tests, use the run-and-fix pattern to automatically heal tests during development.