Claude Code Tools

claude-for-safari

github

Give your AI Agent the power to control Safari on macOS. No extensions, no separate browser.

Stars
⭐ 28
License
MIT
Last Updated
2026-05-16
Source
github

Claude for Safari

Give your AI Agent the power to control Safari

MIT License macOS GitHub Stars

Website · Quick Start · Features · FAQ

English | 中文


Why This?

You want your AI Agent to help with browser tasks — then you discover:

  • 🔒 Playwright → Separate browser instance, hijacks your session
  • 🧩 Claude for Chrome → Requires Chrome extension, doesn’t work with Safari
  • 📝 Copy & paste → Manually feeding page content to AI every time

You just want AI to use your Safari, as if you were doing it yourself.

Claude for Safari makes it one command:

npx skills add SDLLL/claude-for-safari

After installing, tell Claude “check what’s open in my Safari” — it reads and controls your real browser directly.

If this saves you time, give it a ⭐ — it helps other developers discover the project!


Quick Start

Run this in your terminal:

npx skills add SDLLL/claude-for-safari

Then launch Claude Code:

claude

Say “show me what tabs are open in Safari”. The agent will guide you through permission setup automatically.

Compatible with any AI Agent that supports Skills: Claude Code, Cursor, Windsurf, etc.

First-Time Setup

The agent auto-detects and guides you, but you can configure ahead of time:

  1. System Settings > Privacy & Security > Automation → Allow terminal to control Safari
  2. Safari > Settings > Advanced → Enable “Show features for web developers”
  3. Safari > Develop menu → Check “Allow JavaScript from Apple Events”
  4. (Optional) System Settings > Privacy & Security > Screen Recording → Allow terminal (enables background screenshots)

Features

Zero install. Pure macOS native capabilities. One Skill covers all browser operations:

CapabilityWhat the Agent DoesHow
List tabsList all windows and tabs with title & URLAppleScript
Read pagesExtract text, structured data, simplified DOMAppleScript + JavaScript
Execute JSRun arbitrary JavaScript in page contextAppleScript do JavaScript
ScreenshotCapture Safari window — AI can “see” the pagescreencapture
NavigateOpen URLs, new tabs, new windowsAppleScript
ClickClick elements (React/Vue/Angular compatible)JavaScript dispatchEvent
TypeFill forms, simulate keyboard inputJavaScript + System Events
ScrollScroll up/down, scroll to elementJavaScript scrollBy/scrollTo
Switch tabsSwitch by index or URL keywordAppleScript
Wait for loadWait until page is fully loadedJavaScript readyState

Screenshot Modes

ModePermission RequiredWindow SwitchBest For
BackgroundScreen RecordingNo switchRecommended, seamless
ForegroundNoneBrief (~0.3s)Default, auto-switches back

How It Works

Claude Code ──osascript──► Safari (reads/controls your real browser)

     └──screencapture──► screenshot ──► Claude sees the page

No extensions. No proxy servers. No extra processes.

Everything runs through macOS native AppleScript and screencapture. Websites see a real user — no automation fingerprints.


FAQ

Do I need to install anything?

No. This Skill relies entirely on macOS built-in AppleScript and screencapture. Just grant a few system permissions on first use.

Does it support Chrome / Firefox / Arc?

Safari only. For other browsers, use Playwright MCP or Chrome ACP. Safari is the only macOS browser with full AppleScript automation support.

Is it safe? Will AI do random things?

Claude Code’s permission system asks for your confirmation before every sensitive action. You can approve individually or in bulk. All operations are visible in your terminal.

The window flickers when taking screenshots?

Without Screen Recording permission, Safari briefly activates (~0.3s) then switches back. Grant Screen Recording permission for fully background screenshots with zero window switching.

Which AI Agents are compatible?

Any agent supporting Claude Code Skills: Claude Code, Cursor, Windsurf, etc.


License

MIT