Skip to main content

Experiment · agent economics · post-mortem

Porchlight: 3.37 billion tokens in one afternoon

By Craig Merry 3 December 2026 3 December 2026, 11:33 to 18:57 PST (7 h 23 min)

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.

3.37 billiontokens in 7 h 23 min (97.7% cache reads)
$1,573at API list prices, 100% Opus 5.5
51.8%spent on work not in TestFlight Build 1
66.5%of all output tokens were hidden thinking

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 PorchlightKit modules (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)

$0$100$200$300$400 11:00, Workflow agents (30 runs, 133 agents): $9.7811:00, Main conversation (15 prompts): $5.06 $15 11:00 12:00, Workflow agents (30 runs, 133 agents): $193.2312:00, Main conversation (15 prompts): $17.67 $211 12:00 13:00, Workflow agents (30 runs, 133 agents): $324.3513:00, Main conversation (15 prompts): $16.55 $341 13:00 14:00, Workflow agents (30 runs, 133 agents): $334.1614:00, Main conversation (15 prompts): $13.13 $347 14:00 15:00, Workflow agents (30 runs, 133 agents): $256.5815:00, Main conversation (15 prompts): $7.39 $264 15:00 16:00, Workflow agents (30 runs, 133 agents): $169.7416:00, Main conversation (15 prompts): $7.21 $177 16:00 17:00, Workflow agents (30 runs, 133 agents): $108.6617:00, Main conversation (15 prompts): $6.58 $115 17:00 18:00, Workflow agents (30 runs, 133 agents): $92.5618:00, Main conversation (15 prompts): $10.57 $103 18:00
API-equivalent cost per Pacific hour on 3 December 2026. Peak burn hit $688 across 13:00 to 15:00 while research, Wave 1A/1B builds, and public-domain song OCR ran in parallel. The first weekly limit struck at 18:07 (monthly spend cap at 18:10 to 18:12); extra credits resumed the run at 18:15, and the limit struck again at 18:57.
The numbers
Hour (PST)Workflow agentsMain sessionTotalCalls
11:00 (from 11:33)$9.78$5.06$14.84145
12:00$193.23$17.67$210.902,250
13:00$324.35$16.55$340.903,183
14:00$334.16$13.13$347.293,479
15:00$256.58$7.39$263.972,538
16:00$169.74$7.21$176.951,879
17:00$108.66$6.58$115.241,341
18:00 (limits at 18:07 and 18:57)$92.56$10.57$103.131,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%).

WorkstreamShareCostAgentsCallsOutputIn 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.05484,4695.17MNot 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.66201,9765.18MShipped 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.30142,4703.68MShipped 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.55121,9053.67MBuilt & 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.7591,3291.61MOne 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.5671,1861.82MFeeds 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.85136011.97MUsed to ship 0.1 (1)
Main orchestrator conversation
15 human messages, 8 context compactions, specs, task planning, and launching 30 workflows.
5.3% $84.1616321.38MOrchestration
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.2158991.31MUsed 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.0734560.62MR2 discarded
Aborted initial research run
First research workflow stopped after 7 minutes and relaunched cleanly.
0.3% $4.062530.06MDiscarded

Cost anatomy: thinking, cache, and channels

Token componentTokensCostShare
Cache reads3,267.7M$653.5441.5%
Thinking output17.58M$351.6722.4%
Cache writes (5m + 1h)76.3M$390.6424.8%
Visible output8.86M$177.2411.3%
Uncached input0.03M$0.130.0%
ChannelWhat it isCostShareCallsCost per callAvg context
Workflow agents30 workflows, 133 agents (110 completed, 23 stopped or limit-killed), 98 compactions$1,489.0694.7%15,344$0.097207K
Main conversation15 human prompts, 8 compactions, orchestration and spec writing$84.165.3%632$0.133246K

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.

ItemSizeEvidenceDetail
Public-domain sheet-music OCR before Songs UI existed$331 ($109 lost)Measured48 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$208MeasuredGuitar 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$115Measured23 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$118Measured9 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$69MeasuredTwo 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$26MeasuredR2-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$26Measured133 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)$433Upper bound100% 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:

  1. 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_profile fix in a scratch folder, and hit the 18:57 limit right before running the final tests and installing it.
  2. 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-1 verification, finishing ci-signing, and still running the third public-domain song OCR batch in the background. When the limit snapped shut at 18:57, T-FIRST and T-POLISH-1 code 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:

AreaScopeWhat remains
Before Build 2 (Immediate)NextFreeze 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 Rhythm2 screens/drillsBuild 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 builtWire 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 builtAdd 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 builtWire 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 WatchPhase 2Tune 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

  1. 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.
  2. Cancel superseded workflows immediately. When the architecture pivoted from web audio to native iOS 33 minutes into the session, letting R2-browser-audio finish and run verification burned $26 for nothing.
  3. 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.
  4. 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.
  5. 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.
  6. 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 04d090ca on 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.