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".

Screenshot showing Anthropic's interface for creating an API key.

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

Screenshot showing Anthropic's interface for copying an API key to the clipboard.

Step 2: Add Anthropic as a Model Provider

Now we're ready to set things up in Xcode by following the steps below.

  1. Open Xcode's Settings.
  2. Go to IntelligenceAdd a Model Provider.
  3. 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:

Screenshot showing Xcode's Intelligence settings configured to be used with Anthropic.

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

Screenshot showing Xcode's model selector in Coding Assistant

That's it. Now you're ready to start using Claude to write Swift code directly inside Xcode.

Earlier posts