Developer & AIvendor:anthropicEmail OTPUnwrapped Magic LinkCloud KMS TOTP
Automate Anthropic Console & Claude Magic Link & 2FA in Playwright
Automate Anthropic Console & Claude.ai magic links, 6-digit login verification codes, and KMS TOTP in Playwright, Stagehand, and Browser Use.
1. 60-Second Gmail & Outlook Auto-Forwarding Filter
Don't want to change your existing account email on Anthropic & Claude? Keep your corporate inbox on Anthropic & Claude and forward only verification emails to <identity-slug>@in.sentryrelay.com. Sentry Relay's Stage 2 unwrapper preserves the original Anthropic & Claude sender header automatically (full setup guide).
# Paste into Gmail -> Settings -> Filters -> Create a new filter ("Has the words")
from:(anthropic.com OR mail.anthropic.com OR claude.ai) ("verification code" OR "login code" OR "magic link" OR "sign in to Claude")
# Action: Forward it to -> <your-identity-slug>@in.sentryrelay.com2. Copy-Paste Anthropic & Claude 2FA Automation Snippets
Choose your browser automation stack below. All snippets resolve codes in <200ms with Upstash Redis 15-second lookback protection so arrived-before-wait race conditions never fail a run.
import { test, expect } from '@playwright/test';
import { SentryRelay } from '@sentryrelay/sdk';
const relay = new SentryRelay({ apiKey: process.env.SENTRY_RELAY_API_KEY! });
test('Sign into Anthropic Console with magic link or 6-digit email code', async ({ page }) => {
await page.goto('https://console.anthropic.com/login');
await page.fill('input[type="email"]', 'claude-ops@in.sentryrelay.com');
await page.click('button[type="submit"]');
const auth = await relay.wait('claude-ops', {
channel: 'email',
timeout: 30,
});
if (auth.event?.magicLink) {
await page.goto(auth.event.magicLink);
} else if (auth.event?.otpCode) {
await page.fill('input[name="code"]', auth.event.otpCode);
await page.click('button[type="submit"]');
}
await expect(page).toHaveURL(/console\.anthropic\.com|claude\.ai/);
});3. Anthropic & Claude Production Gotchas
Wait Without Restricting to a Single Subdomain
Anthropic login links may arrive from `mail.anthropic.com`, `anthropic.com`, or `claude.ai`. When waiting on a dedicated Identity, omitting `sender` (or passing `subject: "Claude"`) catches all three domains cleanly.
API Credit Reload Receipts Ignored
Auto-reload billing receipts from Anthropic are explicitly disqualified so billing amounts or invoice IDs are never misclassified.
Claude Code MCP Skill Support
You can connect `@sentryrelay/mcp` directly inside Claude Code via `claude mcp add sentryrelay` so coding agents solve Anthropic/SaaS logins autonomously.