Apple Health exports everything you have ever recorded into a single export.xml. If you have worn a Watch for a year or two, that file is routinely hundreds of megabytes. Your text editor hangs, Numbers refuses it, and pasting it into ChatGPT or Claude is not an option.
Why it is so large: it is a complete, uncompressed event log rather than a summary. Every heart-rate reading your Watch has taken is its own XML element, and each one carries the full type identifier, source device, unit and three timestamps. That is around 250 bytes of markup to store one number. The payload is small; the wrapper is not.
The paste problem is not close. At roughly 4 characters per token, a 200 MB export is on the order of 50 million tokens. Frontier models top out in the hundreds of thousands, two orders of magnitude short. Bigger context windows do not close that gap.
Three ways out: stream and filter the records you want (free), collapse it to daily aggregates (free), or skip XML entirely by reading HealthKit on the phone and writing aggregated JSON that a local MCP server can query as live tools. The first two are chores you repeat every time you want fresh data; the third removes the file from the loop.
Full guide, with the token arithmetic, the three fixes, and the tool comparison: https://www.healthexport.dev/blog/apple-health-export-xml-too-big?utm_source=devto&utm_medium=social&utm_campaign=exp-20261008-hea193-xmltoobig
Top comments (0)