claude-code-ios-dev-guide
keskinonur · keskinonur/claude-code-ios-dev-guide
A comprehensive guide to configure Claude Code CLI for iOS development, enabling PRD-driven workflows, extended thinking, and planning modes optimized for Swift/SwiftUI.
A comprehensive guide for setting up Claude Code CLI with PRD-driven workflows, extended thinking (ultrathink), and planning modes optimized for Swift/SwiftUI iOS development.
Preview
What you can do with it
- Set up a Claude Code environment specifically for building iOS applications.
- Implement PRD-driven development workflows with AI assistance for Swift projects.
- Configure custom slash commands and agent skills for iOS-specific tasks.
Safety check
Usable, but read the notes first.
- ●Installer downloads a remote script and pipes it to the shell.
README.md - ●No clear license: check with the author before using it in a commercial product.
Automated scan of the repo files. Always review code you run.
From the README
Claude Code CLI - Complete iOS Development Setup Guide
A comprehensive guide for setting up Claude Code CLI with PRD-driven workflows, extended thinking (ultrathink), and planning modes optimized for Swift/SwiftUI iOS development.
Table of Contents
- Installation
- Configuration Hierarchy
- CLAUDE.md Setup for iOS Projects
- PRD-Driven Development Workflow
- Extended Thinking & Ultrathink
- Plan Mode Configuration
- XcodeBuildMCP Integration
- Custom Slash Commands for iOS
- Agent Skills
- Subagents Configuration
- Output Styles
- Plugins System
- Sandbox Mode & Safe Development
- Settings & Permissions
- Hooks for Swift Development
- Complete Project Structure
- Best Practices & Tips
1. Installation
Native Installation (Recommended)
# macOS/Linux - Native installer (no Node.js required)
curl -fsSL https://claude.ai/install.sh | bash
# Or install latest version
curl -fsSL https://claude.ai/install.sh | bash -s latest
NPM Installation (Alternative)
# Global npm install (do NOT use sudo)
npm install -g @anthropic-ai/claude-code
# Migrate existing npm install to native
claude install
Authentication
# Start Claude Code and authenticate via OAuth
claude
# Or set API key environment variable
export ANTHROPIC_API_KEY="your-key-here"
Model Selection
# Use specific model at startup
claude --model claude-opus-4-5-20250929
claude --model claude-sonnet-4-5-20250929
claude --model claude-3-5-haiku-20241022
# Or set default model
export ANTHROPIC_MODEL="claude-sonnet-4-5-20250929"
2. Configuration Hierarchy
Claude Code uses a layered configuration system where each level can override the one below:
Priority (Highest to Lowest):
├── 1. Session flags (--model, --permission-mode)
├── 2. Environment variables
├── 3. .claude/settings.local.json (local - personal, gitignored)
├── 4. .claude/settings.json (project - shared with team)
└── 5. ~/.claude/settings.json (user - global)
Configuration Scopes
| Scope | Description | Storage |
|---|---|---|
| local | Available only to you in current project (default for MCP) | .claude/settings.local.json |
| project | Shared with team via git | .claude/settings.json, .mcp.json |
| user | Available across all your projects | ~/.claude/settings.json |
Key Configuration Files
| File | Scope | Git Status | Purpose |
|---|---|---|---|
~/.claude/settings.json | User | N/A | Global preferences |
~/.claude/CLAUDE.md | User | N/A | Global instructions |
~/.claude/skills/ | User | N/A | Personal Agent Skills |
~/.claude/commands/ | User | N/A | Personal slash commands |
.claude/settings.json | Project | Committed | Team settings |
.claude/settings.local.json | Local | Gitignored | Personal overrides |
.mcp.json | Project | Committed | Shared MCP servers |
CLAUDE.md | Project | Committed | Main project context |
.claude/skills/ | Project | Committed | Project Agent Skills |
.claude/commands/ | Project | Committed | Project slash commands |
.claude/agents/ | Project | Committed | Project subagents |
3. CLAUDE.md Setup for iOS Projects
The CLAUDE.md file is your primary context provider. Claude automatically loads it at session start.
Root CLAUDE.md Template for iOS
Create CLAUDE.md in your project root:
# Project: [Your App Name]
## Quick Reference
- **Platform**: iOS 17+ / macOS 14+
- **Language**: Swift 6.0
- **UI Framework**: SwiftUI
- **Architecture**: MVVM with @Observable
- **Minimum Deployment**: iOS 17.0
- **Package Manager**: Swift Package Manager
## XcodeBuildMCP Integration
**IMPORTANT**: This project uses XcodeBuildMCP for all Xcode operations.
- Build: `mcp__xcodebuildmcp__build_sim_name_proj`
- Test: `mcp__xcodebuildmcp__test_sim_name_proj`
- Clean: `mcp__xcodebuildmcp__clean`
## Project Structure
MyApp/ ├── App/ # App entry point, App delegate ├── Features/ # Feature modules │ ├── [FeatureName]/ │ │ ├── Views/ # SwiftUI views │ │ ├── ViewModels/ # @Observable classes │ │ └── Models/ # Data models ├── Core/ # Shared utilities │ ├── Extensions/ │ ├── Services/ │ └── Networking/ ├── Resources/ # Assets, Localizations └── Tests/
## Coding Standards
### Swift Style
- Use Swift 6 strict concurrency
- Prefer `@Observable` over `ObservableObject`
- Use `async/await` for all async operations
- Follow Apple's Swift API Design Guidelines
- Use `guard` for early exits
- Prefer value types (structs) over reference types (classes)
### SwiftUI Patterns
- Extract views when they exceed 100 lines
- Use `@State` for local view state only
- Use `@Environment` for dependency injection
- Prefer `NavigationStack` over deprecated `NavigationView`
- Use `@Bindable` for bindings to @Observable objects
### Navigation Pattern
```swift
// Use NavigationStack with type-safe routing
enum Route: Hashable {
case detail(Item)
case settings
}
NavigationStack(path: $router.path) {
ContentView()
.navigationDestination(for: Route.self) { route in
// Handle routing
}
}
Error Handling
// Always use typed errors
enum AppError: LocalizedError {
case networkError(underlying: Error)
case validationError(message: String)