← Back to the recipe

Run data

Haiku was enough

Claude Code 2.1.296 · 13 Oct 2026 · 9 runs · costs as Claude Code reports them. Raw summary (JSON)

Prompt

Add a checkout(items, { coupon } = {}) function to the cart module. It returns { subtotal, discount, tax, total }. Rules: items with qty 0 or less are ignored. Coupons are case-insensitive and ignore surrounding spaces: 'SAVE10' takes 10% off the subtotal, 'FLAT5' takes $5 off but never more than the subtotal, an empty or missing coupon means no discount, and any other code throws an Error whose message is 'Unknown coupon: ' followed by the trimmed code. Tax applies to the subtotal after the discount. subtotal, discount and tax are each rounded to cents, and total is subtotal - discount + tax. Add tests.

Runs

RunModelCostTurnsTimenpm run check passescheckout() correct (hidden tests)added a test for checkout()CHANGES.md entrygenerated files untouchedran npm run check after last editDiff
Haiku #1haiku-5-5$0.0101532spasspasspasspasspasspassdiff
Haiku #2haiku-5-5$0.0091326spasspasspasspasspasspassdiff
Haiku #3haiku-5-5$0.0081624spasspasspasspasspasspassdiff
Sonnet #1sonnet-5-5$0.1161830spasspasspasspasspasspassdiff
Sonnet #2sonnet-5-5$0.1001326spasspasspasspasspasspassdiff
Sonnet #3sonnet-5-5$0.1001225spasspasspasspasspasspassdiff
Opus #1opus-5-5$0.2271239spasspasspasspasspasspassdiff
Opus #2opus-5-5$0.2201248spasspasspasspasspasspassdiff
Opus #3opus-5-5$0.2151240spasspasspasspasspasspassdiff