r/iOSProgramming • • Aug 10 '26

Question When to use Xcode AI as opposed to relying on Claude Code?

I'm told by Xcode's AI Claude "this interface is wired into your running Xcode session, and your problem is a measurement problem on real hardware" as a reason to use Xcode AI instead of Claude Code as a means of using Claude.

So (for example) there's access to Instruments that Claude app does NOT have but Xcode does?

Does anyone know of an actively maintained list of when-to-actually-use-Xcode-AI?

UPDATE: I've been using Xcode AI (Claude Opus no idea exactly which Opus) today as opposed to Claude Code with various MCP I'd previously installed (and can't recall which ones), and today had big success with optimization I have to attribute to Xcode AI integration that Claude Code had been lacking.

Is an iOS/Mac/tvOS game, and I'd been poking away at tvOS optimization for (part-time) weeks, but with too much action on screen fps would drop under 30. Is just 2D but I don't know enough about tvOS to be surprised my 2D game with lots of sprites performed worse than a fancy 3D game. I'd have guessed it should have run smoothly but really was never sure I wasn't just taxing Apple TV hardware... the least powerful Apple hardware we have in our home.

Here is what Xcode's Claude Opus figured out: "The cause was UIKit's focus engine walking your entire SpriteKit node tree every frame. Not physics, not AI, not netcode, not the renderer, and not resolution — all of which I measured and ruled out along the way, several of them after confidently predicting otherwise."

It had been dipping to 12fps and now can maintain 60fps. That was it. And it did it by pausing the game and reviewing the stack.

I assume Claude Code couldn't do that, or it would have? Certainly I've spent more than a day with Claude Code and Fable trying to optimize for Apple TV.

"The tvOS focus engine is walking your entire SpriteKit node tree, testing every node for focus eligibility and computing a coordinate-space frame for each one."

Anyway thanks for input on this. CharlesWiltgen mentioned Axiom and I'll be checking that out.

0 Upvotes

17 comments sorted by

1

u/PressureAppropriate Aug 11 '26

Don't you need to use Claude Code to get access to the latest models?

1

u/gordonmcdowell Aug 11 '26

I am finding I can NOT use Fable with Xcode AI, and I've seen some other posts from others observing they can't either. I'm not sure if latest Opus or Sonnet is available either.

3

u/Plastic-Risk-6309 Aug 11 '26

the split i've settled on: xcode's assistant wins when the answer needs the live session (build graph, instruments traces, the current issues panel), claude code wins when the work is multi-file edits plus running your own tooling in a loop. i haven't seen a maintained when-to-use list. the part neither does well is telling you the app actually behaves right after the build.

2

u/start_select Aug 11 '26

I just use VSCode with Copilot and then build/run/test from the command line. I have Xcode open for occasional tasks here or there.

But it’s mostly backgrounded unless I want to see a view hierarchy or visualize memory.

3

u/dat_tae Aug 10 '26

The agent built in to Xcode has extra information exposed to it by Apple, and can obviously control Xcode. I'm no expert but I would always use it over the Claude Code app.

6

u/CharlesWiltgen Aug 10 '26

The agent built in to Xcode has extra information exposed to it by Apple, and can obviously control Xcode.

What Apple includes is very basic, ~75K tokens (~298 KB) worth of context as of Xcode 27 beta 5.

Axiom (free, open source) includes a bit less than 2M tokens of professionally-curated technical context. That's ~23X what Xcode includes, and it works with any coding harness. Axiom also ships tools (xclog, xcsym, xcui, xcprof) which give coding harnesses live simulator logs, crash symbolication, accessibility-tree assertions, and CPU traces.

These aren't competing, in the sense that Axiom leverages Xcode's MCP as needed. But in my biased opinion as a former Apple Evangelist, Apple platform developers leveraging AI should take advantage of Axiom.

2

u/dat_tae Aug 10 '26

I wanted to mention Axiom but couldn’t remember the name 😩

1

u/CharlesWiltgen Aug 10 '26

I'm just glad it came to mind! Thanks for the opportunity to note the relative scope in a way that I hope is helpful.

2

u/Plastic-Risk-6309 Aug 11 '26

the accessibility-tree assertions part is the piece i wish every harness had. i went further down that road and built an open source daemon that leases simulators to agents, so a tap is resolved by accessibility label against the live tree and the action reports back whether the screen actually changed (github.com/BariBariGood/manzanas, mine). logs and traces cover the build side well, the thin part is still driving the app after it builds.

2

u/andreeinprogress Aug 11 '26 edited Aug 13 '26

Just noting that the same exact stuff is available to any agent/harness that connects to the Xcode MCP while Xcode is open.

  1. open xcode, leave it minimized somewhere
  2. open codex/open code/Claude code, connect Xcode mcp
  3. profit

Edit since beta 5: now Xcode doesn't even need to be opened once you give permissions.

1

u/baummer Aug 11 '26

Claude Code can do the same thing

1

u/valleyman86 Aug 10 '26

I was using it and it was nice but I stopped because it would crash in the middle of the work and I would even lose my prompt. Happened way too often that I was tracking prompts and asked it to keep a prompt history which obviously uses more tokens lol. Now I just use codex directly and review in Xcode.

1

u/gsapienza Aug 11 '26

Try the betas. They are way better

1

u/[deleted] Aug 10 '26

[removed] — view removed comment

1

u/AutoModerator Aug 10 '26

Hey /u/einfachdstn, unfortunately you have negative comment karma, so you can't post here. Your submission has been removed. DO NOT message the moderators; if you have negative comment karma, you cannot post here. We will not respond. Your karma may appear to be 0 or positive if your post karma outweighs your comment karma, but if your comment karma is negative, your comments will still be removed.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.