Hi, I'm PipThese Featured apps take turns in my island.
MacPipSubmit
Blog

AGENTS.md for an iPhone app: what to tell Claude Code, Codex and Xcode's agents

By Justinas Rolando, maker of iPip

Short answer

An AGENTS.md is a short Markdown file at the root of your repository that tells coding agents like Claude Code and Codex how to build, test and safely change your iPhone app. Here is what goes in it for an Xcode project, and a free tool that writes one.

If Claude Code, Codex or Xcode's own agents touch your iPhone app, give them an AGENTS.md: a short Markdown file at the root of your repository with your build command, your simulator test command, your minimum iOS and the few rules they must never break.

That's the whole answer. The rest of this post is what I'd put in that file for an iPhone or iPad app, and why each line earns its place.

Why does this matter more for iPhone apps now?

Because the agents moved into Xcode. Apple's Xcode 26.3 announcement added Anthropic's Claude Agent and OpenAI's Codex inside Xcode. Apple says those agents can search documentation, explore your files, update project settings, and check their own work by capturing Xcode Previews and running builds. Xcode also opened its tools to any compatible agent through the Model Context Protocol.

"Update project settings" is the line that made me sit up. An agent that can change settings can also change your bundle ID, your team or your entitlements while chasing a build error. It can't guess that your app is a small business tool that must never ask for contacts. It only knows what's in the code and what you tell it. Look at the business apps for iPhone on iPip: most are one or two person teams, and nobody there has time to undo an agent's surprise signing change the night before a release.

So the short file is cheap insurance. I built a free AGENTS.md maker for iPhone apps today that writes one in your browser. Below is what it puts in and why.

What is AGENTS.md, exactly?

AGENTS.md is an open format: plain Markdown, no required fields, any headings you like. Agents read the nearest one in the folder tree, so a widget extension or a local Swift package can have its own file, and that one wins for files in its folder.

Two details about the big agents:

  • Claude Code reads AGENTS.md only when there's no CLAUDE.md or CLAUDE.local.md in your folder or above it, says its memory docs. If you already have a CLAUDE.md, add the line @AGENTS.md to it. A CLAUDE.md can import files that way, so both tools follow one set of notes. The same docs ask for under 200 lines per file, since longer files take more context and get followed less.
  • Codex stops adding project notes once they reach project_doc_max_bytes, which is 32 KiB by default, per OpenAI's AGENTS.md guide.

A good iPhone app file is nowhere near either limit. Mine are about 30 lines.

What should an iPhone app's AGENTS.md say?

Four things, in this order.

1. The build command. Agents work best when they can check themselves. For an iPhone app, build for the simulator, so no signing certificates or plugged-in device are needed:

```

xcodebuild -project MyApp.xcodeproj -scheme MyApp -destination 'generic/platform=iOS Simulator' build

```

Use -workspace MyApp.xcworkspace instead if you open a workspace.

2. The test command, with a real simulator. Tests need a named one, like -destination 'platform=iOS Simulator,name=iPhone 17'. Pick one you actually have; xcrun simctl list devices available lists them. I also add one line telling the agent to run the build and the tests after every change and fix what fails before stopping.

3. Your minimum iOS. An agent that reads fresh docs will happily reach for the newest API. If you support iOS 18, say so, and ask for if #available(iOS 26, *) around anything newer, with a fallback. This one line saves the most broken builds for me.

4. The rules that would hurt. Not style preferences. The things that get an app rejected or a release stuck.

Which rules matter most on iPhone?

These are the ones I'd never leave out:

  • Every new permission needs a usage description in Info.plist. Apple's docs say that without the matching purpose string, asking for the camera, photos or location fails and might crash the app. An agent adding a "scan a receipt" feature may not think of it. My purpose string checker checks the wording once it's there.
  • Keep PrivacyInfo.xcprivacy current. If the agent uses a required reason API or adds an SDK, the privacy manifest needs the matching entry. The privacy manifest checker reads the file for you.
  • Ask before touching signing. Bundle ID, team, capabilities and entitlements. Given what Apple says Xcode's agents can change, this is the rule I'd write first.
  • Ask before adding a package. Every dependency is something you maintain, and something your privacy manifest has to cover.
  • Don't hand-edit project.pbxproj beyond adding or removing files.

Then your own: "never log what people type", "keep the widget light", whatever your app's sharp edges are. Reference apps are a good example, since a dictionary or a field guide often promises to work offline. If you make one of the reference apps for iPhone, "never add a network call to the lookup path" is the kind of line that belongs here.

Does this work for iPad apps too?

Yes. Same file, plus a line asking the agent to check layout at iPhone and iPad sizes, and on iPad in Split View. For the test command, name an iPad simulator. Plenty of the business apps for iPad on iPip are the same project as their iPhone version, so one AGENTS.md with both sizes in it keeps things simple.

What I'd do this week

  1. Open the AGENTS.md maker, fill in your project and scheme, and run the build line it gives you once by hand. If it fails for you, it'll fail for the agent.
  2. Commit the file at the root of your repository, next to the .xcodeproj.
  3. If you use Claude Code and already have a CLAUDE.md, add @AGENTS.md to it.
  4. Before your next TestFlight build, check what the agent changed in signing and Info.plist. The TestFlight checklist covers the rest.

None of this makes an agent careful. It just makes the careless mistakes rarer, and that's worth thirty lines.

If your iPhone or iPad app is on the App Store and not on iPip yet, listing it is free.

Sources and further reading

More from the blog

Read this post as Markdown · RSS