build-and-run

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

A command for building an Apple app project in Xcode and then launching it. Xcode is Apple's development tool for making macOS and iOS apps.

In plain words
What is it for?
Use it to build and run the current Xcode workspace or project, targeting macOS or an iOS simulator.
Why use it?
It puts project discovery, scheme selection, background builds, error checking, and running the app into one workflow.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: 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 build and run the current Xcode workspace or project, targeting macOS or an iOS simulator.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/sjungling/sjungling-claude-plugins/build-and-run
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-run

README.md
[![agentmods](https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/build-and-run/github.svg)](https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/build-and-run)
Your own site
<a href="https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/build-and-run"><img src="https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/build-and-run/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-run

Your own site · 80×15
<a href="https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/build-and-run"><img src="https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/build-and-run.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 889 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.00013 $0.00889
Opus 5 $0.00006 $0.00445
Sonnet 5 $0.00003 $0.00178
Haiku 4.5 $0.00001 $0.00089

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

Security

Grade C, and why

build-and-run 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 12d 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.

rm -rf ~/Library/Developer/Xcode/DerivedData/*
plugins/swift-engineer/commands/build-and-run.md · 106 lines

How it starts

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

Build and run the current Xcode project.

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

Workflow

Step 1: Find the Project

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

Step 2: Find the Scheme

Get available schemes with:

xcodebuild -workspace <workspace> -list -quiet

or

xcodebuild -project <project> -list -quiet

If multiple schemes exist, ask the user which to build. If scheme is provided as $1, use that.

Step 3: Build

Run as background task to avoid blocking.

For macOS projects, build for native architecture:

ARCH=$(uname -m)
xcodebuild -project <project> -scheme <scheme> -destination "platform=macOS,arch=$ARCH" -quiet build

For iOS projects, determine available simulator and build:

SIMULATOR=$(xcrun simctl list devices available -j | python3 -c "import sys,json; devs=[d for r in json.load(sys.stdin)['devices'].values() for d in r if d['isAvailable']]; iphones=[d for d in devs if 'iPhone' in d['name']]; print(iphones[-1]['name'] if iphones else '')")
xcodebuild -project <project> -scheme <scheme> -destination "platform=iOS Simulator,name=$SIMULATOR" -quiet build

When build completes (exit code 0 = success, non-zero = failure), proceed to Step 4 if errors, or Step 5 if successful.

Step 4: Fix Build Errors

If build fails, read error messages and fix each issue:

  1. Read the file with the error
  2. Identify and fix the issue
  3. Re-run build
  4. Repeat until build succeeds

Prioritize errors over warnings.

Step 5: Run the App

For macOS:

# Get native architecture and build output directory
ARCH=$(uname -m)
BUILT_PRODUCTS_DIR=$(xcodebuild -project <project> -scheme <scheme> -destination "platform=macOS,arch=$ARCH" -quiet -showBuildSettings | grep ' BUILT_PRODUCTS_DIR =' | awk '{print $3}')

# Kill previous instance and run
if [ -f .build.pid ]; then
  OLD_PID=$(cat .build.pid)
  kill -0 "$OLD_PID" 2>/dev/null && kill "$OLD_PID" 2>/dev/null
fi

open "$BUILT_PRODUCTS_DIR/<app-name>.app"
sleep 1
pgrep -f "$BUILT_PRODUCTS_DIR/<app-name>" > .build.pid

Read the full file on GitHub · 106 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. 12d ago First seen · 106 lines · 13 tokens per session scan C dfdca72b76d8

Subscribe to this mod's changes

build-and-run is a command published in the GitHub repository sjungling/sjungling-claude-plugins (13 stars, last pushed 29d ago), licensed MIT. It adds 13 tokens to every session and 889 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.