Using Claude Agent in Xcode

Apple introduced AI assistance features in Xcode 26.3. You could interact directly with an AI model in a conversation and ask it to write code or fix a compiler error, but it couldn’t implement complex features.

Starting with Xcode 26.5, agentic coding features became available through Claude Agent and Codex. Gemini support followed in Xcode 26.6. These features let an AI model explore your project, modify it iteratively, and implement features on your behalf directly within the IDE.

Xcode 27 introduced major improvements to AI integration, including the conversation interface and the control AI models have over your project and the IDE.

In this lesson, you’ll set up Claude Agent in Xcode 27.

Before you start, you’ll need a paid subscription or an API key for one of these three AI services:

  • Claude Agent from Anthropic.
  • Codex from OpenAI.
  • Gemini from Google.

Note: At the time of writing, Xcode 27 is in beta 4.

Enabling Apple Intelligence

Before opening Xcode, ensure Apple Intelligence is enabled on your Mac.

On your Mac, open the Apple menu and select System Settings.

Select Apple Intelligence & Siri, then verify Apple Intelligence is enabled.

System Settings
System Settings

Setting Up the Claude Agent Plugin in Xcode

Next, open Xcode’s settings and select Intelligence in the sidebar.

Xcode Settings
Xcode Settings

You’ll see the three available Xcode AI plugins. This lesson uses Claude Agent, but you can use another provider if you have a subscription for it.

Alternatively, you can use an API key to set up your agent connection.

Note: Free subscriptions don’t support Xcode integration. You’ll need a paid subscription for one of the three providers.

Click Get beside Claude Agent. A confirmation dialog informs you that the plugin is third-party software with its own terms and conditions.

Install Claude
Install Claude

Click Install to download the plugin.

Claude downloading...
Claude downloading...

When the download finishes, the interface displays the plugin’s sign-in status. Click the ellipsis … to open the authentication options.

Claude agent sign-in
Claude agent sign-in

  • Claude.ai account: Use single sign-on (SSO) to connect your existing subscription. Usage follows the limits of your plan.
  • API key: Use a prepaid Anthropic API account. Each prompt and request draws from your account balance.
  • Configuration file: Authenticate through a configuration file. Some companies use this option to provide employees with access to AI models.

The rest of this segment uses the first option. If you prefer to use an API key or your company provides a configuration file, choose the appropriate option. Your choice doesn’t affect how Xcode works with your AI agent.

Select Sign In With a Claude.ai Account…. Your default browser opens a single sign-on page where you can authorize Xcode to connect to your Claude account.

Connect Xcode to Claude
Connect Xcode to Claude

Select Authorize to complete the connection with Xcode.

Before trying it out, scroll down in the Intelligence settings to the Chat section.

Intelligence Settings
Intelligence Settings

This integration isn’t agentic. It provides a standard chat experience named Claude Sonnet & Opus, rather than Claude Agent.

Select it and go through its authentication flow just like the agent setup.

Note: If your company provides a custom AI model integration, select Add a Chat Provider and configure the chat server directly. The server can run on localhost if you use a locally hosted server or proxy.

Starting Your First AI Conversation

To start your first conversation with your AI agent, open a project.

Download the materials for this lesson, then open GuesstheCountry from the starter folder.

At the top of the project, you’ll see a new button for starting an AI conversation. Xcode uses the conversation type, provider, and model from your previous conversation.

Start a conversation
Start a conversation

To choose a specific configuration, click Coding Assistant beside Navigators. Select New Conversation, then choose one of the conversation types you’ve configured.

Select chat agent
Select chat agent

Choose Claude Agent, or the agent provider you configured. In the new conversation window, enter give me a brief overview of this project as your prompt, then observe your first AI response in Xcode.

Your first conversation
Your first conversation

Setting Up an Agent Proxy Server

Some companies provide employees with a proxy service. Instead of connecting directly to the provider’s API, the AI agent connects through a custom server that can enforce security measures, quotas, authentication, and model restrictions.

This lesson doesn’t cover proxy configuration because each company has a different setup. To use a proxy, select Authenticate with Configuration File… when signing in to Claude Agent from Xcode.

The config file will be stored in ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/.

Ask your company’s IT or security team whether you need this setup and, if so, how to configure the file.

In the next segment, you’ll learn about Cursor and set it up to use with the starter project.

See forum comments
Download course materials from Github
Previous: Introduction Next: Introduction to Cursor