Hi 👋 I'm Simon Støvring, a developer with a passion for iOS. I build apps like Runestone, Scriptable, Jayson and Data Jar.
Using Claude with Coding Assistant in Xcode 26
Xcode 26 introduces Coding Assistant, a new tool that helps you write code with the help of AI. It comes with built-in support for ChatGPT. But what's really nice is that Apple lets us add our own model providers, including Anthropic's Claude.
This means you can use Claude Sonnet 4 in Xcode, just like you would with the built-in ChatGPT, as shown in the video below.
Coding Assistant in Xcode 26 requires an M1 Mac running macOS 26 Tahoe.
Let's walk through how to add Claude as a model provider.
Step 1: Generate an Anthropic API Key
First, go to console.anthropic.com/settings/keys and generate an API key. Xcode will use this key to send requests to Claude. You can name the key anything. I chose "Xcode 26".

Copy the API key to your clipboard and store it somewhere if needed. You will need it in a couple of seconds.

Step 2: Add Anthropic as a Model Provider
Now we're ready to set things up in Xcode by following the steps below.
- Open Xcode's Settings.
- Go to Intelligence → Add a Model Provider.
- Select Internet Hosted and enter the following:
URL: https://api.anthropic.com/
API key: Paste in the key you just generated in Anthropic's console.
API key header: x-api-key
It should look something like this:

You can now select Anthropic's models for use with Coding Assistant. You may need to restart Xcode before the model provider shows up.

That's it. Now you're ready to start using Claude to write Swift code directly inside Xcode.
Earlier posts
Running Xcode's View Debugger While Interacting with the Simulator
November 17, 2024
Building Documentation for Both iOS and macOS Using DocC
April 16, 2023
Moving from 1Password to iCloud Keychain
November 21, 2021
Using an iPhone as My Webcam
August 8, 2021
Mint Mojito Iced Coffee Recipe
August 3, 2021