Running parallel AI agents on the same codebase is the holy grail of developer productivity, but a new experiment from Flowdeck Studio reveals a critical failure mode in iOS development. When two Claude Code agents were tasked with separate features on a SwiftUI weather app using Git worktrees, both reported successful builds. In reality, the second agent silently overwrote the first agent's build on the shared iPhone 18 Pro simulator, leaving the first agent testing code it never wrote.
The Illusion of Isolation
The core misconception is that Git worktrees provide complete isolation. While worktrees successfully separate file systems and branch states, they do not isolate runtime environments like simulators, installed apps, or persistent data such as UserDefaults. In the experiment, Agent A built version 111 and Agent B built version 222. Both used the same bundle ID and targeted the already-booted simulator. The result was a race condition where Agent Bโs installation terminated Agent Aโs running process and replaced its binary, all without raising a single error.
Silent Data Corruption
The failure was insidious because standard build metrics provided no warning. Both agents reported 'success' because their code compiled correctly. It was only when the researcher explicitly checked the installed build number after a 90-second wait that the discrepancy appeared: Agent A read '222' instead of '111'. Furthermore, the shared UserDefaults meant that data saved by Agent Aโs build remained visible to Agent Bโs build, creating a hybrid state that neither agent expected. This highlights a dangerous gap in current agentic workflows: a passing build does not guarantee the correct code is running.
Manual Fixes vs. Automated State Management
The author identified three potential solutions, ranging from the inefficient to the automated. Running one agent at a time negates the speed benefit. Manually cloning simulators via xcrun simctl clone works but requires tedious, repetitive prompt engineering to ensure each agent knows its specific simulator UDID. The third option, promoted by the article, is using a tool like FlowDeck Studio that binds the simulator, worktree, and build configuration into a single session unit. This approach automates the isolation of the runtime environment, preventing the silent clobbering of builds.
Key Takeaways
- Git worktrees isolate source files but not simulator state or app data.
- Parallel agents on a single simulator will overwrite each other's builds silently.
- Shared UserDefaults can leak data between distinct agent tasks.
- Successful compilation does not verify that the correct build is installed or running.
- Manual simulator cloning requires strict prompt discipline to maintain isolation.
The Bottom Line
Until agentic workflows properly isolate runtime environments, parallel AI coding on iOS is a minefield of silent corruption. You are not just managing code; you are managing state, and right now, that state is shared by default.