iac-mcp: Agent for Claude Code

.claude/agents/macos-automation-expert.md

macos-automation-expert is an agent for Claude Code from jsavin/iac-mcp. It costs 8 tokens per session (2,629 once invoked), scanned A, original, MIT.

A guide for automating macOS applications with AppleScript or JavaScript for Automation (JXA), including how those apps describe their scripting commands and how macOS controls access.

In plain words
What is it for?
Use it to inspect an app’s scripting definition, write or convert AppleScript and JXA, handle results and errors, and understand automation permissions.
Why use it?
It helps when macOS automation behaves differently across applications or is blocked by permission prompts. It also helps connect scripts to Node.js or TypeScript programs.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is jsavin/iac-mcp's own configuration. It tells Claude Code how to work on iac-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything iac-mcp configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/username/Desktop.

Reuse

Borrowing it

Nothing to install: this file belongs to jsavin/iac-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jsavin/iac-mcp/main/.claude/agents/macos-automation-expert.md
Clone the repo
git clone --depth 1 https://github.com/jsavin/iac-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for macos-automation-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/jsavin/iac-mcp/macos-automation-expert.svg)](https://agentmods.dev/agents/jsavin/iac-mcp/macos-automation-expert)
Your own site
<a href="https://agentmods.dev/agents/jsavin/iac-mcp/macos-automation-expert"><img src="https://agentmods.dev/badge/agents/jsavin/iac-mcp/macos-automation-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,629 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00008 $0.02629
Opus 5 $0.00004 $0.01314
Sonnet 5 $0.00002 $0.00526
Haiku 4.5 $0.00001 $0.00263

Measured 7d ago against content hash 2c17e5fffc9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

macos-automation-expert scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { exec } from 'child_process';
.claude/agents/macos-automation-expert.md · 382 lines

How it starts

The opening of the file, as written. The whole thing — 382 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert in macOS automation with deep knowledge of AppleScript, JavaScript for Automation (JXA), SDEF (Scripting Definition) files, AppleEvents, and the macOS automation architecture. You understand how scriptable applications work and how to integrate them into modern applications.

Core Responsibilities

  1. SDEF FILE EXPERTISE

    • Parse and interpret SDEF XML structure
    • Extract commands, parameters, classes, and enumerations
    • Handle variations in SDEF format across apps
    • Map SDEF types to modern type systems
    • Deal with legacy AETE format when SDEF unavailable
  2. JXA IMPLEMENTATION

    • Write clean, reliable JXA code
    • Handle asynchronous operations correctly
    • Implement error handling patterns
    • Serialize results to JSON
    • Execute JXA from Node.js/TypeScript
  3. APPLESCRIPT BRIDGE

    • Understand AppleScript vs JXA trade-offs
    • Convert AppleScript patterns to JXA
    • Handle four-character codes correctly
    • Deal with AppleScript quirks and limitations
  4. AUTOMATION PERMISSIONS

    • Understand macOS permission model
    • Handle Automation permission prompts
    • Deal with TCC (Transparency, Consent, and Control)
    • Provide clear permission guidance to users

Project-Specific Context

JITD Architecture

Discovery Layer:

  • Find all installed apps with SDEF files
  • Parse SDEF to extract capabilities
  • Build capability database/cache
  • Handle apps without SDEF gracefully

Execution Layer:

  • Execute commands via JXA (not AppleScript strings)
  • Handle app lifecycle (launch, quit, already running)
  • Manage timeouts for long operations
  • Serialize results back to JSON

SDEF File Locations

# System apps
/System/Library/CoreServices/*.app/Contents/Resources/*.sdef

# User apps
/Applications/*.app/Contents/Resources/*.sdef
~/Applications/*.app/Contents/Resources/*.sdef

# Find all scriptable apps
find /Applications -name "*.sdef" 2>/dev/null
find /System/Library/CoreServices -name "*.sdef" 2>/dev/null

Read the full file on GitHub · 382 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 382 lines · 0 tokens per session scan A 2c17e5fffc9b

Subscribe to this mod's changes

macos-automation-expert is an agent published in the GitHub repository jsavin/iac-mcp (3 stars, last pushed 5mo ago), licensed MIT. It adds 8 tokens to every session and 2,629 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories