Original Reddit post

I’ve been building SwiftUI with Claude Code daily for the past few months. The biggest friction: Claude writes a view, but it’s flying blind. It can’t tell if the layout is right, if colors match your design system, or if the list it just built is rendering blank. You end up copy-pasting screenshots and describing what’s wrong. So I built Claude-XcodePreviews — a Claude Code skill that gives Claude visual feedback on its own SwiftUI output. How it works You: /preview Modules/Components/Chip/Chip.swift Claude then: 1. Parses the #Preview {} block from the file 2. Injects a minimal build target into the Xcode project (only the imports your view needs) 3. Builds in ~3-4 seconds 4. Captures the simulator screenshot 5. Reads the screenshot and analyzes what it sees 6. Iterates if something looks wrong No full app build. No Xcode GUI. Just the view, rendered and captured. Install Via the plugin marketplace: /install Iron-Ham/Claude-XcodePreviews Then install the Ruby dependency: bash gem install xcodeproj --user-install That’s it. You get a /preview skill that works with Xcode projects, SPM packages, and standalone Swift files. Why not Xcode 26.3 MCP? Apple’s new Xcode MCP is great in concept, but in practice: One agent per Xcode instance. Each new agent PID triggers a manual “Allow agent to access Xcode?” dialog. If you’re running parallel agents or using subagents, this is a dealbreaker. Schema bugs. The MCP returns a format that differs from its stated schema, breaking some tools. Tied to Xcode GUI. You need a running Xcode instance. Claude-XcodePreviews works per-worktree. You can run multiple Claude Code agents on different branches, each with their own /preview — no Xcode GUI needed. If you’re doing the tmux multi-agent thing, this works natively with that workflow. CLAUDE.md integration I add this to my project’s CLAUDE.md :

Workflow for Claude
When asked to preview a SwiftUI view:
Run the preview script
: ./scripts/preview path/to/MyView.swift --output /tmp/preview.png
View the screenshot
: Read /tmp/preview.png
Analyze and report
: Describe layout, styling, colors, and any issues ```
Claude picks this up automatically and knows to run the preview when building views.
The result
The feedback loop goes from "build app → screenshot → describe to Claude → Claude guesses" to "Claude builds → Claude sees → Claude iterates." It removes you from the visual verification step entirely for straightforward UI work.
GitHub:
https://github.com/Iron-Ham/Claude-XcodePreviews
Technical deep dive:
https://sundayswift.com/posts/teaching-ai-to-see-swiftui-previews/
Would love feedback — especially from anyone who's tried the Xcode 26.3 MCP approach. How are you handling the permission dialog issue?
submitted by
/u/Iron-Ham

Originally posted by u/Iron-Ham on r/ClaudeCode