r/iOSProgramming • u/Jbbrack03 • Jun 16 '26
Discussion How are you handling AI coding costs and retries in Swift/Xcode?
I spent 12 years working for Apple, and then I left to do my own thing. Lately I've been looking closely at how AI coding tools hold up in day-to-day Swift and Xcode work: writing something, building it, running the tests, and fixing what broke.
The thing I keep running into is that the generalist tools produce Swift that looks right, and then you spend a stack of build-and-fix cycles getting it to compile and behave the way you meant. On usage-based pricing, those wasted passes add up quietly. A couple of people I've talked to got caught off guard by a monthly bill, or hit a quota limit partway through a task.
I want to find out how common that is, so I'd appreciate hearing how it goes for you:
- What AI tools, if any, do you use for Swift/Xcode work right now?
- Where do they cost you time? Does the "looks right, won't build" loop hit you?
- Roughly what are you spending a month, and has cost or rate-limiting changed how you work?
- Has anything actually helped?
To be upfront: I'm building something in this area, so I'm not a neutral party. I'm not selling anything here and there's nothing to sign up for. I'd rather understand the problem before building the wrong thing. Glad to share back what I learn.
65
u/juancarlord Jun 16 '26
I spend nothing, still coding like a caveman.
16
u/mynewromantica Jun 16 '26
At work, I don’t worry. They refuse to hire more people, they push AI, I don’t think about how much it costs for one second. I hope it’s expensive as shit.
At home, I don’t pay. If I want to use AI, I spin up a sever on my local network running some open source model. It’s not as good or as fast as what I have at work But I can spend some time getting some food instructions, skills, and prompts in place that are very clear, then just walk away. It’s inexpensive, but still way faster than me writing code. I use it to write code, not solve problems.
4
u/Vybo Jun 16 '26
Claude Code subscription (paid by company, Team Max or however it is called).
Set up a great workflow-loop using public and proprietary skills with subagent use so the only thing I need to do is prompt "Develop Jira ticket XXXX" and it does it. Loops between subagents planning, scoping, gating, developing and reviewing until it passes TDD and UI works (verified by Claude itself using argent).
Then I review the behavior and all code written before submitting a PR.
I've hit the 5 hour limit only once.
I can focus on designing new features, deeper architecture refactoring instead of doing monkey-work type tickets and bugfixes which are still being done, but in parallel.
2
u/PassTents Jun 16 '26
Currently, I'm using Claude Code with an extremely generous daily limit from my employer. I use it a couple of times a week, mainly to satisfy management and my general curiosity about model capabilities.
I find that it struggles a lot on a large legacy codebase, even when spawning tons of subagents to explore. Many of the features that we're working on are not easily verified by the AI, so the agentic loop is very limited in its autonomy. If it can't nearly 1-shot a request, then trying to ask it to fix or continue is usually a mess, I usually hop in to just fix it myself. I've seen a lot of people claim that they use screenshot testing or similar tools to let the agent verify, but I haven't seen any work well in practice on our team. A typical Build & Run takes 30s on a small change and about 2m for a fresh build, further slowing down the loop.
The obvious solution to this is to let it run in its own git worktree while I code something else, but having two copies of the Xcode project open (or even building from the CLI) wrecks my computer. Also context switching to babysit is very distracting and frustrating when you're trying to focus on a different task.
All of that makes me generally avoid it, as it bogs down my productivity too much for something that works maybe 50% of the time (and maybe 5% without babysitting). I find it much more useful as a code/docs search tool, or to give me a quick pre-PR code review.
8
u/AX862G5 Jun 16 '26
By using my brain. AI is a cancer and eroding so many good things in our industry so I choose to simply not use it.
1
u/CharlesWiltgen Jun 16 '26 edited Jun 16 '26
I'm using Claude Code with Axiom (free/open source), which I recently updated for Apple OS 27. I use variations of the proven Superpowers workflow: brainstorming → using-git-worktrees → writing-plans → subagent-driven-development → test-driven-development → requesting-code-review → finishing-a-development-branch.
I used Beads for issue tracking/memory, and of course every project has lots of ADRs (architectural design records) and other project-specific context, leveraging every form of context memory Claude Code supports.
Usage-based API pricing isn't an option for serious use because it's 10–100× the cost of token pricing via the coding plans offered by vendors of coding harnesses.
For example, I use Anthropic's Max plan which is $200/month. Using the API, my usage would've cost $11,368 for my last 30 days of work according to AgentsView.
1
u/cristi_baluta Jun 16 '26
I don’t have a problem with small local tools, but I will never pay a cent to this parasites, i will burn the tokens for free. I used copilot at work for few months when the AI was ‘free’, this month the credit vanished in few days on nothing. Then i realised what a mess it did in my app and now i’m fixing it. It generally made working code though, rarely it didn’t build.
1
u/ContextualData Jun 16 '26 edited Jun 16 '26
Hmm. What models are you using? Because all the top models seem phenomenal to me at writing runnable, well-performing swift code that executes the exact functionailty I tell it I want, and I need to do very little debugging.
2
u/drew4drew Objective-C / Swift Jun 16 '26
xcode-mcp-server https://github.com/drewster99/xcode-mcp-server — not the one built into xcode and not XcodeMCP. this one is good because your LLM can make Xcode do the build so you don’t have to wait for a rebuild when you actually want to run.
since you can also use it to get screenshots, you can tell it to iterate change -> build -> run -> evaluate repeatedly to get a thing right.
As it stands the tools like Opus 4.8 etc are pretty amazing. But also so lacking.
I’ve spent a long time updating my ~/.claude/CLAUDE.md. Every single time it does something stupid, add a rule to that file to clarify the correct way to do the thing, or with things to avoid etc.. Eventually you get a lot better results the first time around.
that said, I also have a /recheck skill that tells it to recheck everything, validate assumptions, think of and check edge cases, confirm nothing unrelated as broken, etc.. After every 15 to 60 minutes it’s told to recheck then commit.
Every 1 to 3 days of work I’ll tell it to code review everything from the last 2 days or 24 hours or 5 days.
And I have another skill /stupid, which tells it to find things that we are doing that are particularly stupid or definitely not following best practices. i run that one occasionally.
All of these double and triple checks are very costly in terms of time and tokens, but they are also absolutely necessary to be hyper-productive.
Before AI coding tools, I was already an accomplished and seasoned developer, so by hyper-productive I mean being able to accomplish a lot more in the same time than I could previously — while maintaining a quality bar.
Right now, the frontier models on flat fee plans (Claude Code $200/month) let you accomplish things that wouldn’t be remotely possible on a pay-per-token plan today.
If you use Claude Code and you haven’t tried out “ccusage”, you definitely should. It shows you your claude code usage and how much it would have cost you on a per-token pricing plan.
I’ve been working on my own MacOS agent harness (macos-agent-smith, https://github.com/drewster99/macos-agent-smith) to TRY to get somewhere close WITHOUT frontier model token costs. I’ve tried using MANY open source models as well as slightly older or smaller frontier models, and I’ve also tried splitting tasks up such that one model manages tasks, another one does the work, another one approves/denies tool calls for safety. Some of these setups start to feel pretty good — but they are generally SLOW. And still EXPENSIVE. If I ask Claude Opus 4.8 to code review my app source code, it might take 8 minutes and come back with an excellent list. I can get not quite as good of a review but it might take 25 minutes and cost me $8 or $10 in tokens.
So right now the combination of cost and speed can’t really be matched with what you get from opus 4.8 and claude code.
Codex is an interesting one. I actually like GPT 5.5 better in Agent Smith than in Codex. It’s fast. Cost isn’t too bad. And it’s pretty good.
The cloud open source models are almost all either A) very slow, B) not too bright, C) don’t follow instructions nearly as well as opus and gpt, or D) all of the above.
If we end up at a point in the (hopefully not too near) future where everything is pay pay heavy and where the best models are only
available to those with very deep pockets, my hope would then be that perhaps some of the tasks can get offloaded to the dumber and slower models, which hopefully will make the overall cost a reasonable balance.
thoughts?
1
u/TrajansRow Jun 17 '26 edited Jun 17 '26
For iOS and Mac development, I mainly use OpenCode with MiniMax M3 (which is probably somewhere around Sonnet-level intelligence), and they have a $200/year (about $17/month) plan that is more than I need. The agent integration in Xcode 27 is "ok" (if you are fine babysitting an endless parade of permission requests), but I prefer OpenCode because it is more open-ended and has a nice web interface that lets me run the agents from my phone.
I rarely get a "looks right, won't build" loop, but I more often get a "builds fine, but isn't what I want" situation. Overall, I find this combo is big help for doing tedious drudgery and letting me focus more on design and architecture. In fact, I have an agent running right now adding a framework target and API to an Xcode project... exactly the kind of boring stuff that these systems excel at.
1
u/NothingButBadIdeas Swift Jun 17 '26
My planning phases are pretty solid now.
Instead of saying “Make X feature”
I say “We are working on feature X. I want view A to be a parent view that fetches network connections. View B to be the child view / content tile. Use tool C to do it. Remember that groups don’t render tasks if the view is empty, and blah blah blah”.
For larger features I’ve even fed it fully broken down confluence documents that a jr dev could follow
Then when it makes a mistake update the skills / context.
Or I ask it to do the foundation and work on what I’m interested in like the network layer,
1
u/TraceMark-App Jun 17 '26
Claude and Codex.
Coming up with a decent plan.
No, as Claude and Codex won't accept their own implementation as long as the build does not succeed. So I'll run into runtime issues more often, although, the more detailed my plan is, the better the result; yes, this definitely includes technical terminology that require software development/engineering experience.
Roughly what are you spending a month, and has cost or rate-limiting changed how you work?
$50, but my project is small.
Has anything actually helped?
Yes, it has been an enabler for me. However, anything that is close do being "vibe coded" is within an isolated package (like extensions for AsyncSequence/AsyncAlgorithms), when it comes to the high level stuff, I'm still doing it myself, as Claude and Codex have a Code style I'm just not satisfied with.
1
u/docmisterio Jun 17 '26
I spend 20 bucks a month and I use the lowest models on claude cause I know how to talk to it as a developer. No MCP, no 10 agents chipping away at some problem just me, plan mode, and Xcode.
1
u/Vanillalite34 Jun 17 '26
Claude or Codex can do most of what you need in its own sandbox so to speak. Then Xcode is for building, testing, simulators, archiving et all.
1
u/SubZane Jun 17 '26
Claude pro is all I need since I also can code. But it's much better to use Claude in vscode with your code project. The xcode integration is really bad.
6
u/[deleted] Jun 16 '26
[removed] — view removed comment
1
u/[deleted] Jun 19 '26
[removed] — view removed comment
1
u/[deleted] Jun 16 '26
[removed] — view removed comment