build-and-sim

build-and-sim is a command for Claude Code from sjungling/sjungling-claude-plugins. It costs 14 tokens per session (1,154 once invoked), scanned C, original, MIT.

A command for building an Xcode project and opening it in an available iOS or iPadOS simulator. A simulator runs a virtual Apple device on a Mac.

In plain words
What is it for?
Use it to test the current iPhone or iPad app in a suitable available simulator, including any simulator preference declared by the project.
Why use it?
It handles project and scheme discovery, simulator selection, background building, and launch steps in one workflow.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; positional $N argument.

Part of the swift-engineer plugin — 1 skill, 4 commands, 2 agents shipped together

Good fit Use it to test the current iPhone or iPad app in a suitable available simulator, including any simulator preference declared by the project.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/sjungling/sjungling-claude-plugins/build-and-sim
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/sjungling/sjungling-claude-plugins

Made for: Claude Code.

Or install swift-engineer, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 2 agents.

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 build-and-sim

README.md
[![agentmods](https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/build-and-sim/github.svg)](https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/build-and-sim)
Your own site
<a href="https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/build-and-sim"><img src="https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/build-and-sim/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for build-and-sim

Your own site · 80×15
<a href="https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/build-and-sim"><img src="https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/build-and-sim.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,154 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00014 $0.01154
Opus 5 $0.00007 $0.00577
Sonnet 5 $0.00003 $0.00231
Haiku 4.5 $0.00001 $0.00115

Measured 11d ago against content hash cdf72d8b59cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade C, and why

build-and-sim scanned grade C 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 11d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **Stale cache**: `rm -rf ~/Library/Developer/Xcode/DerivedData/*` and rebuild (use sparingly).
plugins/swift-engineer/commands/build-and-sim.md · 112 lines

How it starts

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

Build the current Xcode project and run it in an iOS/iPadOS simulator, selecting the simulator intelligently based on availability and project preferences.

Important: Run all xcodebuild commands as background tasks. Builds can take significant time (30s–5m+). Use Bash with run_in_background: true to avoid blocking. Poll for completion and capture output for error analysis.

Workflow

Step 1: Find the Project

Look for .xcworkspace (preferred) or .xcodeproj in the current directory. If multiple exist, ask the user which to use.

Step 2: Find the Scheme

List schemes:

xcodebuild -workspace <workspace> -list -quiet
# or
xcodebuild -project <project> -list -quiet

If $1 is provided, use it. Otherwise, if multiple schemes exist, ask the user.

Step 3: Determine Preferred Simulator

Check for a simulator preference declared in the project's CLAUDE.md (and any imported memory files). Look for patterns like:

  • "simulator: iPhone 15 Pro"
  • "preferred simulator", "default simulator", "test on"
  • Any explicit simulator device name (e.g., "iPad Pro 13-inch (M4)")

Capture the preferred simulator name if found.

Step 4: Discover Available Simulators

xcrun simctl list devices available -j

Parse the JSON to build a list of available simulators grouped by runtime (iOS / iPadOS). Only include devices where isAvailable is true.

Step 5: Select the Simulator

Apply this decision tree:

  1. Preferred simulator found in CLAUDE.md AND available → use it.
  2. Preferred simulator found but NOT available → use AskUserQuestion to prompt the user. Present 3–5 available simulators as options (prioritize devices matching the preferred family — e.g., if preference was "iPhone 15 Pro", offer other iPhones first; for iPads, offer iPads). Include the preferred name in the question context so the user knows why we're asking.
  3. No preferred simulator in CLAUDE.md → pick a sensible default (most recent iPhone on the latest iOS runtime) and proceed. If ambiguous (e.g., iPad-only project), ask the user.
  4. No simulators available at all → try to install one via the CLI:
    xcodebuild -downloadPlatform iOS
    # or list installable runtimes:
    xcrun simctl runtime list -v
    
    Offer the user 2–3 options from the most recent iOS/iPadOS releases (query available runtimes via xcrun simctl list runtimes available and xcodebuild -downloadAllPlatforms -exportPath hints). If CLI installation isn't possible in this environment, instruct the user to open Xcode → Settings → Platforms and install a simulator runtime manually, then re-run the command.

Read the full file on GitHub · 112 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. 11d ago First seen · 112 lines · 14 tokens per session scan C cdf72d8b59cd

Subscribe to this mod's changes

build-and-sim is a command published in the GitHub repository sjungling/sjungling-claude-plugins (13 stars, last pushed 27d ago), licensed MIT. It adds 14 tokens to every session and 1,154 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.