supaguardsupaguardDocs
Guides

Claude Code Integration: AI-Powered Monitoring from Your Terminal

Set up supaguard with Claude Code to create, test, and deploy synthetic monitors directly from your codebase using AI skills. Install the CLI, add skills, and start monitoring in minutes.

Use supaguard with Claude Code to create synthetic monitors directly from your codebase. Claude reads your source code, generates resilient Playwright scripts, tests them in the cloud, and deploys them as recurring checks — all without leaving your terminal.

Why Claude Code + supaguard?

Traditional monitoring setup means writing scripts by hand, configuring schedules, and managing alerting — all separate from your codebase. With the supaguard skill for Claude Code:

  • Zero context switching — describe what you want to monitor in plain English
  • Code-aware scripts — Claude reads your routes, selectors, and forms to generate accurate Playwright tests
  • Cloud-tested before deploy — scripts run in supaguard's cloud runner before going live
  • No test files in your repo — monitoring scripts live in supaguard, not your codebase

Prerequisites

Step 1: Log In to the supaguard CLI

Install the CLI globally and log in:

npm install -g supaguard
supaguard login

This opens your browser to authenticate. Once logged in, the CLI will display a list of your organizations — select the one you want to monitor.

[!TIP] See the full CLI documentation for all available commands, regions, and schedule options.

Verify your login:

supaguard whoami

Step 2: Install the supaguard and Playwright Testing Skills

Skills teach Claude Code how to work with supaguard. Install both with:

npx skills add AbsolutelySkilled/AbsolutelySkilled --skill supaguard
npx skills add AbsolutelySkilled/AbsolutelySkilled --skill playwright-testing

What each skill does:

SkillPurpose
supaguardCreate, test, and deploy production monitoring checks from your source code
playwright-testingWrite and debug Playwright e2e tests for CI/CD pipelines

[!NOTE] The supaguard skill is for production monitoring — checks that run on a schedule and alert you when things break. The playwright-testing skill is for CI/CD testing — tests that run in your pipeline before deploy. Use both together for full coverage.

Step 3: Using the Skills

Create a monitoring check

Open Claude Code in your project directory and use the /supaguard slash command or describe what you want to monitor:

/supaguard Monitor the login flow on our production app. Verify that users
can sign in with email/password and see the dashboard.

Claude will:

  1. Analyze your source code — reads routes, components, and selectors to understand your app
  2. Generate a Playwright script — writes a monitoring script tailored to your actual UI
  3. Test in the cloud — runs the script in supaguard's cloud runner to verify it works
  4. Deploy interactively — prompts you for check name, schedule, regions, and alert channels

Write e2e tests for CI

Ask Claude to write tests using the playwright-testing skill:

Write Playwright e2e tests for our checkout flow. Cover the happy path
and the case where payment fails.

This generates tests in your project's test directory, ready for your CI pipeline.

Common commands you can ask Claude

RequestWhat happens
"Monitor our signup flow"Generates and deploys a recurring check
"Add monitoring for the API health endpoint"Creates an API check with assertions
"Our login check is failing, debug it"Analyzes the failure and suggests fixes
"Write e2e tests for the settings page"Creates Playwright tests for CI
"Monitor checkout in US and Europe regions"Deploys a multi-region check

Example: full monitoring setup

Here's what a typical session looks like:

You: Set up monitoring for our app at https://app.example.com.
     Monitor the login flow and the main dashboard.

Claude: I'll analyze your codebase and set up monitoring checks.

     [reads source code, identifies routes and selectors]

     I've generated two monitoring scripts:

     1. Login Flow Check
        - Navigates to /login
        - Fills email and password fields
        - Submits and verifies dashboard loads
        - Schedule: every 10 minutes
        - Regions: US East, EU West

     2. Dashboard Health Check
        - Verifies dashboard loads with data
        - Checks navigation menu is functional
        - Schedule: every 10 minutes
        - Regions: US East, EU West, India

     Both scripts passed cloud testing. Deploy these checks? [Y/n]

Troubleshooting

"CLI not found" or authentication errors

Re-run the login flow:

supaguard login

If the browser doesn't open automatically, copy the URL from the terminal and open it manually.

Skills not activating

Verify the skills are installed:

ls .claude/skills/

You should see supaguard/ and playwright-testing/ directories. If not, re-run the install commands from Step 2.

Script fails during cloud testing

Common causes:

  • Selector mismatch — your production UI differs from what Claude read in source code. Provide more specific hints about your UI structure.
  • Authentication required — use environment variables in supaguard for test credentials instead of hardcoding them.
  • Timeout — monitoring scripts must complete within 60 seconds. Simplify the flow or break it into multiple checks.

Firewall blocking cloud runners

If your app is behind a firewall, you'll need to allowlist supaguard's IP ranges. See Firewall Allowlisting.

What's Next?

On this page