Reduces iOS app binary and package size with risk-aware optimization, security checks, and verifiable build/runtime evaluation. For Swift/Xcode apps exceeding size targets.
Ships in ios-binary-size-reduction. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill for: Swift/Xcode apps where executable and package size are above target and size reduction must preserve app behavior, security, and startup quality.
workspace_or_project: .xcworkspace (preferred) or .xcodeprojschemeconfiguration: Release (default)risk_level: low | balanced | aggressivesize_budget_mb: optional target reduction thresholdmin_gain_mb: minimum gain to keep a change (0.3 MB default)slice_scope: all or explicit family/OS slices-Ounchecked, -enforce-exclusivity=unchecked, or equivalent safety suppression flags.dSYM generation. Keep symbol upload and crash-symbolication verified.xcodebuild -version, swift --version, destination, git SHA) and rerun the baseline pipeline once as a no-op control.Before any mutation:
SWIFT_OPTIMIZATION_LEVELSWIFT_COMPILATION_MODEDEAD_CODE_STRIPPINGSTRIP_INSTALLED_PRODUCTSTRIP_SWIFT_SYMBOLSLD / linker flags (OTHER_LDFLAGS)ASSETCATALOG_COMPILER_OPTIMIZATIONALWAYS_EMBED_SWIFT_STANDARD_LIBRARIESSWIFT_REFLECTION_METADATA_LEVELLD_RUNPATH_SEARCH_PATHSipa size, app bundle size__TEXT and section split (xcrun size -m)xcodebuild -version, swift --version-destination)HEAD and clean/dirty statexcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -configuration Release -destination "$DESTINATION" -archivePath "$TMP_ARCHIVE" clean archivexcodebuild -project "$PROJECT" -scheme "$SCHEME" -configuration Release -destination "$DESTINATION" -archivePath "$TMP_ARCHIVE" clean archivexcodebuild -exportArchive -archivePath "$TMP_ARCHIVE" -exportPath "$TMP_IPA_PATH" -exportOptionsPlist "$EXPORT_OPTIONS"Apply in sequence, keep all gates green.
cleanarchive (-configuration Release)ipaDEPLOYMENT_POSTPROCESSING = YES, STRIP_INSTALLED_PRODUCT = YESSTRIP_SWIFT_SYMBOLS = YESDEAD_CODE_STRIPPING = YESSWIFT_COMPILATION_MODE = WholeModuleASSETCATALOG_COMPILER_OPTIMIZATION = space, prune unused scales/device families; spot-check touched UI flows visuallySTRIP_PNG_TEXT = YES) where legal/compliance requirements allow itOnly enable if Tier 1 passes.
SWIFT_OPTIMIZATION_LEVEL = -OsizeLLVM_LTO (incremental/partial first)ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO only when precomputed target deployment matrix remains valid (per platform/extension/device family).Enable only with explicit approval when constraints are still missed. Required preconditions:
SWIFT_REFLECTION_METADATA_LEVEL = without-names, then selective noneGCC_SYMBOLS_PRIVATE_EXTERN, exported/unexported symbol map strategy)-ObjC, -all_load) only after runtime validationP1: Release-only clean baseline control. Low risk, required for valid deltas.P2: DEPLOYMENT_POSTPROCESSING and STRIP_INSTALLED_PRODUCT are deterministic, low-risk size wins.P3: STRIP_SWIFT_SYMBOLS = YES reduces size and improves artifact hygiene; requires strict dSYM retention.P4: DEAD_CODE_STRIPPING = YES gives medium-high size gain; low behavior risk with smoke tests.P5: Whole-module compilation is strong for dead boundaries; compile time can increase.P6: Localization pruning gives high ROI only with accurate usage inventory.P7: Asset catalog optimization is often highest ROI among Tier 1 items; visual regressions possible.P8: STRIP_PNG_TEXT = YES can improve size; preserve legal/compliance metadata.P9: Resource bundle pruning is strong but UX-sensitive.P10: -Osize is effective for binary shrink; potential hot-path performance regression.P11: LLVM_LTO typically improves size/perf but increases toolchain CPU/time.P12: Architecture pruning is deterministic if target matrix is validated.P13: ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO lowers size where safe; verify all target configurations.P14: Dependency minimization has high value-to-effort, but functional side-effect risk is highest here.P15: App-thinning validation is low risk, high confidence for deployment compatibility.P16: Reflection metadata reduction is substantial, may break dynamic reflection users.
JSONDecoder/Decodable hot paths still roundtrip correctlyMirror and dynamic cast behaviorP17: Export map hardening improves security posture but can break external integrations.P18: Removing -ObjC / -all_load is risky if runtime registration depends on it.P19: On-demand payload can greatly reduce install size; adds runtime fetch and fallback complexity.P20: Module/framework extraction improves long-term size/control but high refactor risk.P17) → deterministic stripping (P3,P4) → architecture/asset changes (P12,P7) → optimization/link choices (P10,P11) → reflection and linkage edits (P16,P18).P6,P7,P14) → conservative compile/link toggles (P5,P10,P11) → reflection/payload changes (P16,P19).P11 and controlled reflection tuning (P16) are often neutral to positive; P10 can hurt hot paths.ipa, app bundle, __TEXT, and install-eligible slices compared against baseline.min_gain_mb or any gate fails, revert only that pass.Gate execution rule:
Default per-pass budgets unless overridden:
min_gain_mb (or 0.3MB)Produce a single report per run containing:
run_id, xcode_version, swift_version, git_sha, destination, risk_levelrun_started_at, run_ended_at, run_duration_secondsipa, app, __TEXT, symbol bytes, dSYM bytes)pass_idsettings_changedsize_delta_mbcumulative_gain_mbpass_started_at, pass_ended_at, pass_duration_secondspass_status (applied, reverted, skipped)security_impactquality_impactperformance_deltagate_statusrollbacknoteslow risk_level, never run P14 or above without explicit approval.balanced, stop at tier 2 unless explicitly authorized.aggressive, keep user-informed checkpoints before tier 3.{
"run_id": "ios-size-YYYYMMDD-###",
"xcode_version": "15.x",
"swift_version": "5.x",
"git_sha": "",
"destination": "",
"risk_level": "low|balanced|aggressive",
"run_started_at": "2026-03-03T12:00:00Z",
"run_ended_at": "2026-03-03T12:03:24Z",
"run_duration_seconds": 204,
"baseline": {
"ipa_mb": 0.0,
"app_mb": 0.0,
"text_section_mb": 0.0,
"symbols_mb": 0.0,
"dsym_mb": 0.0
},
"final": {
"ipa_mb": 0.0,
"app_mb": 0.0,
"text_section_mb": 0.0,
"symbols_mb": 0.0,
"dsym_mb": 0.0
},
"cumulative_gain_mb": 0.0,
"passes": [
{
"id": "P4",
"gain_mb": 0.0,
"settings_changed": ["DEAD_CODE_STRIPPING=YES"],
"size_delta_mb": 0.0,
"cumulative_gain_mb": 0.0,
"pass_started_at": "2026-03-03T12:01:00Z",
"pass_ended_at": "2026-03-03T12:01:42Z",
"pass_duration_seconds": 42,
"pass_status": "applied",
"security": "low|medium|high",
"quality": "low|medium|high",
"performance_delta": "improved|neutral|degraded",
"gate_status": "pass|fail",
"rollback": false,
"notes": "reason"
}
]
}
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/ios-binary-size-reduction:ios-binary-size-reductionfrom ios-binary-size-reduction
npx claudepluginhub ehmo/ios-binary-size-reduction-skill --plugin ios-binary-size-reduction