Skip to content

Safety model

A request to inspect, audit, find space, or clean Xcode authorizes read-only discovery. A category-level request after an audit may select the current eligible candidates, but mutation begins only after the agent presents the fully enumerated, current candidate ID set. A subsequent unambiguous request to remove that category is the single approval of that exact frozen set. After revalidation, execute in the same turn; no magic phrase, repeated IDs, or additional confirmation is required.

An irreversible Simulator operation still needs explicit category-specific intent after its identifiers and permanent data loss are shown. That intent may be a distinct clause in the same message that approves ordinary cleanup; it does not require another message.

Approval expires when:

  • The candidate path, inode, ownership, or purpose changes
  • A build or simulator starts using the candidate
  • The audit is no longer current enough to trust and revalidation cannot prove the same ID, identity, risk, and action. An unchanged refreshed audit preserves approval.
  • The proposed action changes from Trash to permanent deletion
  • A reversible action changes into an irreversible API operation

Generated build products, indexes, package downloads, and caches. These still require confirmation because deletion can trigger hours of rebuilding or downloads and can disrupt other agents.

Simulator devices, installers, DeviceSupport, and Xcode applications. Data may be redownloadable, but local state or offline recovery is lost.

Archives, dSYMs, unknown documentation, active Xcodes, unique toolchains, signing assets, credentials, and anything with uncertain ownership or recovery.

  • Prefer supported Xcode, SwiftPM, and simctl commands.
  • Move ordinary paths to Trash; never follow symlinks.
  • Do not empty Trash without separate confirmation.
  • Reject wildcard IDs and broad path prefixes.
  • Recheck active builds, tests, archives, package resolution, and exact candidate usage immediately before mutation. An open Xcode or Simulator application by itself is not a blocker.
  • For regenerable documentation caches, warn that local documentation may be temporarily unavailable while Xcode reloads it; do not require Xcode or Simulator to quit solely for that reason.
  • Refuse a path when its inode/device no longer matches the audit.
  • Avoid sudo; do not disable SIP or alter protected system assets.
  • Do not manually remove /Library/Developer/CoreSimulator, /System/Library/AssetsV2, or an entire CoreSimulator device set.

du measures logical blocks reachable through a path. APFS clones, snapshots, and shared volumes mean candidate sizes are not necessarily additive. Measure actual free-space change with df after cleanup and state when files remain in Trash.