Experiment · agent economics · post-mortem
Porchlight: 3.37 billion tokens in one afternoon
I set out to build Porchlight, a personal iOS singing and acoustic-guitar coach for one hard-of-hearing adult, and land the first voice build on TestFlight in one afternoon. Claude Code burned through 3.37 billion tokens in 7 hours 23 minutes, hit the weekly limit twice, and ran out of credits 20 minutes before the upload. Gemini 4 Neon finished the stranded signing fix and shipped Build 0.1 (1) to my iPhone an hour later. This is the post-mortem of where every token went, what was waste, and what is still left to make the app whole.
Companion to A week on Claude Code, by the token (7 November 2026), using the exact same transcript deduplication and API list-price yardstick so the two audits compare directly.
Executive summary
- One afternoon burned 35% of my entire November token week. $1,573.22 across 15,976 API calls, launched from just 15 human messages.
- Parallel scope creep killed the finish line. Only $758 (48.2%) went to code, research, release scripts, and orchestration for TestFlight Build 1. The other $815 (51.8%) went to public-domain sheet-music OCR, Wave 1B modules with no UI yet, CarPlay research, and superseded web-audio research.
- Scanning 19th-century sheet music was the #1 cost center. Three workflows of 48 Opus 5.5 agents spent $331 (21.0% of the entire day) making 2,482 base64 image reads (736.8 MB) to transcribe public-domain songs for a Songs tab that is still a stub. Five songs never finished and lost $109 when the limit hit.
- Two-thirds of all output was hidden thinking. Unlike November, December transcripts split thinking tokens out of output: 17.58M of 26.45M output tokens ($352 of $529) were internal thinking.
- It corroborated November's limit-counting guess. In token-week, both weekly allowances ran out around 25.8M to 27.6M output tokens regardless of cache reads. Porchlight hit its limit right in the same band (26.45M output tokens).
- What actually shipped is still substantial. Even with the waste, the afternoon produced 39,000 lines of Swift 6 across 10 tested
PorchlightKitmodules (1,661 passing tests), 13,000 lines of SwiftUI app code, 8,800 lines of hardened build/release scripts, and a live, working voice-training TestFlight build on my iPhone.
Hour by hour (Pacific time)
The numbers
| Hour (PST) | Workflow agents | Main session | Total | Calls |
|---|---|---|---|---|
| 11:00 (from 11:33) | $9.78 | $5.06 | $14.84 | 145 |
| 12:00 | $193.23 | $17.67 | $210.90 | 2,250 |
| 13:00 | $324.35 | $16.55 | $340.90 | 3,183 |
| 14:00 | $334.16 | $13.13 | $347.29 | 3,479 |
| 15:00 | $256.58 | $7.39 | $263.97 | 2,538 |
| 16:00 | $169.74 | $7.21 | $176.95 | 1,879 |
| 17:00 | $108.66 | $6.58 | $115.24 | 1,341 |
| 18:00 (limits at 18:07 and 18:57) | $92.56 | $10.57 | $103.13 | 1,161 |
Where the $1,573 went
Every one of the 30 workflows plus the main conversation is bucketed once below. Blue bars directly served TestFlight Build 1 ($758.18, 48.2%); orange and grey bars went to deferred Wave 3 features or superseded research ($815.04, 51.8%).
| Workstream | Share | Cost | Agents | Calls | Output | In 0.1 (1)? |
|---|---|---|---|---|---|---|
| Public-domain sheet-music OCR (T-PD) 3 batches, 48 agents reading scanned 19th-century songbooks bar by bar (2 blind readers + 1 adjudicator per song). 9 shipped, 5 unfinished. | 21.0% | $331.05 | 48 | 4,469 | 5.17M | Not in Build 1 UI |
| Build-1 core Swift package PorchlightTheory, Songs, Store, Scoring, Voice, DSP, plus Wave 1A follow-ups. All compiled and tested (part of 1,661 passing tests). | 16.4% | $257.66 | 20 | 1,976 | 5.18M | Shipped in 0.1 (1) |
| Build-1 iOS app, stage, audio & haptics Design system & PitchStage, PhoneHaptics, MicEngine, Session runners, T-POLISH-1, and T-FIRST (two runs after the 18:07 limit). | 15.5% | $243.30 | 14 | 2,470 | 3.68M | Shipped in 0.1 (1) |
| Deferred Swift package modules Guitar DSP (T-GDSP), Study & Lessons (T-STUDY, T-LESSONS, contract round 2), Import & Country Catalog (T-IMPORT, T-CATALOG). | 13.2% | $207.55 | 12 | 1,905 | 3.67M | Built & tested; UI stubs |
| CarPlay & 2023 RAV4 research C1 to C4 plus C-carplay-design (9 agents, 395 KB of reports) establishing that CarPlay rules forbid a singing stage. | 7.5% | $117.75 | 9 | 1,329 | 1.61M | One 38-line pause card |
| Deferred-area research (R3, R4, R5, R8) Guitar DSP, public-domain song candidates, country song catalog, and song import pipeline research. | 7.2% | $113.56 | 7 | 1,186 | 1.82M | Feeds Wave 3 |
| Release tooling & CI keychain signing Two adversarial attack rounds on the Mac/TestFlight scripts ($68.78) plus 3 interrupted CI-signing runs after the Mac rebooted ($22.08). | 5.8% | $90.85 | 13 | 601 | 1.97M | Used to ship 0.1 (1) |
| Main orchestrator conversation 15 human messages, 8 context compactions, specs, task planning, and launching 30 workflows. | 5.3% | $84.16 | 1 | 632 | 1.38M | Orchestration |
| Core research used in Build 1 (R1, R7, N1, N2) Vocal pedagogy, pitch/loudness metrics, native iOS/watchOS audio & haptics, and Study-anywhere design. | 5.2% | $82.21 | 5 | 899 | 1.31M | Used in 0.1 (1) |
| Superseded browser-audio & competitive research R2 browser audio ($25.70 including verification) kept running after the native iOS pivot 33 minutes in; R6 competitive ($15.37). | 2.6% | $41.07 | 3 | 456 | 0.62M | R2 discarded |
| Aborted initial research run First research workflow stopped after 7 minutes and relaunched cleanly. | 0.3% | $4.06 | 2 | 53 | 0.06M | Discarded |
Cost anatomy: thinking, cache, and channels
| Token component | Tokens | Cost | Share |
|---|---|---|---|
| Cache reads | 3,267.7M | $653.54 | 41.5% |
| Thinking output | 17.58M | $351.67 | 22.4% |
| Cache writes (5m + 1h) | 76.3M | $390.64 | 24.8% |
| Visible output | 8.86M | $177.24 | 11.3% |
| Uncached input | 0.03M | $0.13 | 0.0% |
| Channel | What it is | Cost | Share | Calls | Cost per call | Avg context |
|---|---|---|---|---|---|---|
| Workflow agents | 30 workflows, 133 agents (110 completed, 23 stopped or limit-killed), 98 compactions | $1,489.06 | 94.7% | 15,344 | $0.097 | 207K |
| Main conversation | 15 human prompts, 8 compactions, orchestration and spec writing | $84.16 | 5.3% | 632 | $0.133 | 246K |
Prompt caching did enormous heavy lifting: 3.27 billion cache-read tokens cost $654 instead of $13,071 at uncached Opus input rates, a 97.7% hit rate and $12,417 saved. Unlike November's audit (where main-session context climbed to 967K), Claude Code compacted at ~365K here (8 times in main, 98 times inside workflow agents), keeping per-call context flat.
The hidden multiplier was thinking output and base64 images. Across 15,976 calls, every single one ran on Opus 5.5 (zero Sonnet or Haiku calls). Two-thirds of all output tokens (17.58M of 26.45M) were internal reasoning. Meanwhile, the Read tool returned 844.2M characters across 4,063 calls, of which 829.0M characters (3,001 calls) were base64 PNG/JPG images, mostly cropped sheet-music scans (2,482 calls) and rendered UI previews (349 calls). Tool errors were tiny (135 errors across 18,300+ tool calls; 25 API errors): the burn was architectural, not crash-looping.
Where the waste was
Categories overlap slightly (for example, Opus-everywhere spans all workflows), so they do not sum. Evidence labels follow the same convention as token-week.
| Item | Size | Evidence | Detail |
|---|---|---|---|
| Public-domain sheet-music OCR before Songs UI existed | $331 ($109 lost) | Measured | 48 Opus 5.5 agents made 2,482 base64 image Read calls (736.8 MB of cropped scans) to transcribe 19th-century songbooks at ~$24.68 per shipped song. 9 songs shipped into a tab that is still a stub; 5 songs burned $108.92 and died on the usage limit. |
| Building Wave 1B modules ahead of Build 1 | $208 | Measured | Guitar DSP ($52.58, including the single costliest agent of the day at $38.41), Study + Lessons ($91.12), and Import + Country Catalog ($63.85) are cleanly tested, so not thrown away, but spending that budget before TestFlight Build 1 starved the finish line. |
| Usage-limit casualties and interrupted restarts | $115 | Measured | 23 agents stopped or killed by the 18:07 and 18:57 weekly limits: $35.10 on the first T-FIRST build, $15.40 on interrupted T-FIRST and T-POLISH-1 reviews, $22.08 across three interrupted CI-signing runs, $25.64 on killed PD adjudicators, and $17.00 on partial restarts. Work on disk survived, but context and handoff work had to be repaid. |
| CarPlay & 2023 RAV4 deep-dive for a 38-line pause card | $118 | Measured | 9 agents and 1,329 calls produced 395 KB of CarPlay and RAV4 reports. The core platform constraint (Apple forbids a singing stage on CarPlay, so Build 1 shows one static pause card) was knowable in the first $15. |
| Two adversarial attack rounds on personal release scripts | $69 | Measured | Two red-team workflows ($26.42 + $42.36) hardened the Mac build scripts against shared-host risks and double uploads. Useful safety engineering, but nearly as expensive as T-FIRST itself on a single-user app. |
| Unstopped browser-audio research after native iOS pivot | $26 | Measured | R2-browser-audio ($17.97) started at 11:56 before the native iOS pivot at 12:10, was never cancelled, and went on to run a $7.73 verification pass on a discarded web architecture. |
| Agent cold-start cache writes | $26 | Measured | 133 agents wrote 5.2M tokens to cache on their first turn (about 39K tokens per agent). Much smaller than in token-week because there were 133 agents instead of 2,169. |
| Opus 5.5 on every single agent (0 Sonnet or Haiku calls) | $433 | Upper bound | 100% of all 15,976 calls ran on Opus 5.5. Moving workflow agents to Sonnet 5.5 at the same turn count would save up to $433; even moving just mechanical stages (image crops, copy checks, mock scripts, blind song reads) would likely have kept the session inside one weekly allowance. |
The last mile: why Claude couldn't finish
Two unrelated collisions happened in the final 90 minutes:
- A remote build Mac reboot at 17:13 PST locked the account's login keychain, breaking automatic TestFlight signing. Claude pivoted cleanly to the team's separate CI keychain, built and unit-tested the migration, and created the App Store provisioning profile, then hit the 18:07 weekly limit before finishing. After credits were added at 18:15, the resumed signing builder discovered that manual Xcode signing never auto-downloads profiles, wrote the exact
install_profilefix in a scratch folder, and hit the 18:57 limit right before running the final tests and installing it. - Parallel work drained the second burst in 42 minutes. Between 18:15 and 18:57, Claude ran three heavy workflows at once: finishing
T-FIRST+T-POLISH-1verification, finishingci-signing, and still running the third public-domain song OCR batch in the background. When the limit snapped shut at 18:57,T-FIRSTandT-POLISH-1code were done on disk, the signing fix was sitting uninstalled in scratch, and zero builds had been uploaded.
Switching to Gemini 4 Neon to close the loop took under 40 minutes: finish two small test fixes on the scratch signing scripts, install them atomically, fix two edge cases from the missed T-FIRST review (a Start double-tap race and keeping the effort page usable after a mic pause), fix a macOS Swift type-checker timeout in ArrangerTests and two Raspberry Pi parallel-test flakes, run the live Mac rehearsal, and upload Porchlight 0.1 (1) to TestFlight.
What is left to make Porchlight whole
TestFlight 0.1 (1) ships the complete Voice loop: first-run onboarding, calibration on stage, Today's coach plan and check-in, Just sing, 11 of 12 voice path drills plus warm-ups/routines, Show me simulation, in-hand vs on-stand haptics, optional captioned sound cues, Settings, Checks diagnostics, and the static CarPlay pause card. Under the hood, all 10 PorchlightKit modules (1,661 tests) and the App/Design components for Guitar, Songs, Study, and Progress are already written. What remains is mostly UI wiring, data fixtures, and Phase 2 hardware:
| Area | Scope | What remains |
|---|---|---|
| Before Build 2 (Immediate) | Next | Freeze Build-1 JSON data fixtures (T-FIXTURES) from the uploaded 0.1 (1) tarball so future builds never break saved practice history; run the 17 real-iPhone checks (mic, hearing aids, haptics, stand vs hand, parked CarPlay); wire TakeRecorder and HapticDriftProbe in Settings. |
| Progress & Voice Rhythm | 2 screens/drills | Build ProgressScreen (shown vs hidden sparklines and milestones, moving milestone copy into PorchlightCoach) and wire voice onset detection for the On the beat rhythm drill. |
| Songs Tab (4 stub screens) | Engine built | Wire SongsScreen, SongDetailScreen, SingScreen, and ImportSongScreen over PorchlightSongs; rewrite CountryFacts research notes into plain user copy; finish the 5 interrupted PD songs only when the tab is ready. |
| Guitar Tab (7 stub screens) | DSP built | Add raw-audio AnalysisEngine.drainSamples() to MicEngine and SimEngine, then wire GuitarHome, Tuner, Chords, ChordCheck, Changes, Strum, and PlayAlong screens over PorchlightGuitarDSP and App/Design. |
| Study Tab (6 stub screens) | FSRS-6 built | Wire StudyHome, StudySession, TapRhythm, Imagery, Lessons, and Lesson screens over PorchlightStudy and PorchlightLessons (with choice shuffling, monotonic answer timing, and unread-lesson priority). |
| Car Phase 2 & Apple Watch | Phase 2 | Tune the noise gate (T-NOISE) after real recordings, add the parked-car check-in and lesson, and build the watchOS companion target (Watch/ is currently empty). |
What I would change next time
- Vertical slice first, never fan out future waves before Build 1 ships. Launching Wave 1B modules, CarPlay deep-dives, and 48 sheet-music OCR agents before the first binary reached TestFlight burned $815 (52% of the budget) and starved the upload.
- Cancel superseded workflows immediately. When the architecture pivoted from web audio to native iOS 33 minutes into the session, letting
R2-browser-audiofinish and run verification burned $26 for nothing. - Never use Opus 5.5 vision for bulk sheet-music OCR. $25 per public-domain song via three Opus agents cropping archive scans is the wrong tool. Use existing MusicXML/ABC/MIDI public-domain corpora or a specialized OMR pass, and only transcribe songs once the Songs tab exists.
- Reserve Opus for architecture and hard DSP; test Sonnet on mechanical stages. Copy-rule checks, mock test harnesses, and repetitive transcription do not need a frontier reasoning model spending 66.5% of output on thinking tokens.
- Cap research depth by decision value. Spending $118 on CarPlay and RAV4 specifics to decide "show one static pause card" is inverted. Ask "what is the single blocking rule?" first and stop when the answer is no.
- Keep a finish-line reserve. Stop launching non-critical background workflows once an allowance crosses 70%, so integration, signing, and deployment never run out of credits mid-flight.
Method and limits
- Source. Local Claude Code JSONL transcripts for session
04d090caon one Raspberry Pi: the main conversation (34 MB) plus all 30 workflow directories and 133 subagent files. Streaming chunks were deduplicated by(message.id, requestId), keeping the final usage record per call and excluding<synthetic>error wrappers. - Dollars. A yardstick, not an invoice. Priced at the exact same list rates per million tokens used in token-week: Opus 5.5 $4 input, $20 output (thinking + visible), $0.20 cache read, $5 5-minute cache write (1.25x), $8 1-hour cache write (2x). The plan is flat-rate plus usage credits.
- Exclusions. The Gemini 4 Neon finishing session that installed the signing fix and shipped TestFlight 0.1 (1) is not included in Claude's token totals. No prompts, credentials, hostnames, or private keys are published here.