CLAUDE LABJP
MODEL — Claude Sonnet 5 is the default across all plans and Claude Code at $2/$10 per million tokens through August 31FABLE — Access to Claude Fable 5 and Mythos 5 is being restored from July 1 after US export controls were liftedSCIENCE — Claude Science, an AI workbench for researchers, is in beta for Pro, Max, Team, and EnterpriseGATEWAY — The Claude apps gateway for Amazon Bedrock and Google Cloud adds SSO, policy, role-based access, and per-user cost attributionENTERPRISE — Claude Enterprise adds richer admin analytics, model-level entitlements, and spend alertsCODE — Claude Sonnet 5 is now the default model in Claude Code with a native 1M-token context windowMODEL — Claude Sonnet 5 is the default across all plans and Claude Code at $2/$10 per million tokens through August 31FABLE — Access to Claude Fable 5 and Mythos 5 is being restored from July 1 after US export controls were liftedSCIENCE — Claude Science, an AI workbench for researchers, is in beta for Pro, Max, Team, and EnterpriseGATEWAY — The Claude apps gateway for Amazon Bedrock and Google Cloud adds SSO, policy, role-based access, and per-user cost attributionENTERPRISE — Claude Enterprise adds richer admin analytics, model-level entitlements, and spend alertsCODE — Claude Sonnet 5 is now the default model in Claude Code with a native 1M-token context window
Articles/Claude Code
Claude Code/2026-07-08Advanced

Auditing Your Own Code for Required Reason API Declarations with Claude Code

Required reason codes in PrivacyInfo.xcprivacy apply to your own code, not just third-party SDKs. After a wallpaper app of mine was rejected, here is the Claude Code workflow I use to scan Swift sources and match APIs to reason codes before submission.

Claude Code185iOS24App Store7PrivacyIndie Development7

Premium Article

Last spring I shipped an update to one of my wallpaper apps, and a few hours after submitting to the App Store a notice landed: "ITMS-91053: Missing API declaration." I had kept my dependency manifests tidy, so what went wrong? It was my own code. A stray UserDefaults call I had used for saving a setting counts as one of Apple's Required Reason APIs.

Conversation about Required Reason APIs tends to gravitate toward SDK compliance. But the same declaration rules apply to the code you write yourself. This piece narrows in on scanning your own sources — using Claude Code to inventory the gaps and fill in reason codes in PrivacyInfo.xcprivacy. For the dependency side, I leave you to my separate write-up on catching missing manifest declarations in dependencies.

Why your own code slips through

Required Reason APIs sound imposing, yet they are a collection of quiet, everyday calls. UserDefaults for saving settings, modificationDate for reading a file's timestamp, volumeAvailableCapacityKey for checking free space, systemUptime for measuring elapsed time on device. None of them carry the drama the word "privacy" suggests. That is exactly why the need to declare them never registers, and they sink deep into the codebase.

In my case there were three gaps: a UserDefaults write for an onboarding-complete flag, a modificationDate read that judged how fresh a cached image was, and a volumeAvailableCapacityForImportantUsageKey check before a download. All of them were written years ago, before this rule even existed. I had no appetite to trace every source file by hand, so I wanted a mechanical way to surface them.

The four categories and their reason codes

The categories you are most likely to trip over in your own code are these four. Each has reason codes defined by Apple, and .xcprivacy records both the category and the reason code.

Category (NSPrivacyAccessedAPIType)Common APIsReason codes indie apps often use
UserDefaultsUserDefaults / NSUserDefaultsCA92.1 (used only within the app / App Group)
FileTimestampmodificationDate / creationDate / statC617.1 (display to user) / 3B52.1 (within your container)
DiskSpacevolumeAvailableCapacity… / systemFreeSize85F4.1 (display to user) / E174.1 (write to avoid low-space errors)
SystemBootTimesystemUptime / mach_absolute_time35F9.1 (measure time between on-device events)

The reason codes read alike, so you cannot mechanically settle on a single one. The script only goes as far as proposing candidates; which reason actually fits your usage is a choice the developer makes. Always confirm against Apple's Required Reason API documentation.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A Python scanner that finds Required Reason APIs across four categories — UserDefaults, file timestamp, disk space, boot time — in your own Swift code
How to map detected symbols to .xcprivacy reason codes and head off the ITMS-91053 rejection email before you submit
A Claude Code routine that re-scans on every release so declaration gaps never creep back in
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Claude Code2026-05-26
Four Weeks With Claude Code: Driving Xcode Warnings to Zero in an Indie iOS Codebase
An indie iOS developer behind 50M+ downloads pairs with Claude Code for four weeks to clear hundreds of accumulated Xcode warnings. Notes on weekly scope, what to delegate, and the boundary where human judgment still wins.
Claude Code2026-05-23
A Daily Revenue Pipeline for 4 Wallpaper Apps: 8 Weeks Running App Store Connect API + AdMob With Claude Code
An 8-week record of running App Store Connect API and AdMob Reporting API through a Python pipeline for 4 iOS wallpaper apps, with Claude Code helping absorb JWT auth quirks, gzip TSV edge cases, timezone misalignment, and Slack alerting thresholds — written from an indie developer's perspective.
Claude Code2026-05-18
Running Apple Privacy Manifest as an Indie Developer — Catching Dependency Drift with Claude Code
Apple Privacy Manifest (PrivacyInfo.xcprivacy) is a quietly painful area for indie iOS developers. Drawing on twelve years of running iOS apps with over 50 million combined downloads, this article walks through how I use Claude Code to detect drift, respond to rejections, and bake the whole flow into CI.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →