33,000 lines of XML to tell you heavyWork() is slow: how I tamed xctrace for LLMs

Last week I was profiling a Swift app with Instruments. Standard procedure: xctrace record, xctrace export, copy the XML to Claude Code’s context, ask it to find the hotspots. Claude responds: “The XML is too large, I can’t process it reliably.” 33,553 lines of XML. For a program with two functions. The real problem xctrace export is a fantastic tool. It gives you everything: every sample, every backtrace, every frame with its binary, memory address, and UUID. It’s exhaustive, precise, and complete. ...

March 8, 2026 · Fernando

My AI Read a JSON File from Disk 900 Times in a Loop (And Why No Linter Can Save You)

Last week my AI wrote code that read a JSON file from disk, parsed it, did one lookup, and repeated this 900 times inside a for loop. Each iteration: open file, decode JSON, look up a value, throw it all away. Start over. It’s a mistake I teach my students not to make within their first month of programming. What happened (straight to the point) I’m building Tokamak, a macOS menu bar app that monitors Claude Max quota. Part of the functionality scans ~900 JSONL files from Claude Code sessions. For each file, it needs to know the byte offset where it left off last time (incremental reading — only process what’s new). ...

February 24, 2026 · Fernando

Why 99% of What You Send to Claude Is Already Cached

I’m building an app that monitors my token consumption in Claude Code. A few days ago, looking at the raw numbers, I found this: cacheReadInputTokens: 4,241,579,174 inputTokens: 1,293,019 Four billion two hundred million tokens read from cache. One million three hundred thousand “fresh” tokens. That’s a 99.97% cache hit rate. My first reaction was thinking something was broken. Nobody has a 99% cache hit rate. Not Redis. Not Cloudflare. Not your mom when she claims she already knows what you’re going to ask for dinner. ...

February 19, 2026 · Fernando