← Back to the recipe
Run data
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
| Run | Model | Cost | Turns | Time | npm run check passes | checkout() correct (hidden tests) | added a test for checkout() | CHANGES.md entry | generated files untouched | ran npm run check after last edit | Diff |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Haiku #1 | haiku-5-5 | $0.010 | 15 | 32s | pass | pass | pass | pass | pass | pass | diff |
| Haiku #2 | haiku-5-5 | $0.009 | 13 | 26s | pass | pass | pass | pass | pass | pass | diff |
| Haiku #3 | haiku-5-5 | $0.008 | 16 | 24s | pass | pass | pass | pass | pass | pass | diff |
| Sonnet #1 | sonnet-5-5 | $0.116 | 18 | 30s | pass | pass | pass | pass | pass | pass | diff |
| Sonnet #2 | sonnet-5-5 | $0.100 | 13 | 26s | pass | pass | pass | pass | pass | pass | diff |
| Sonnet #3 | sonnet-5-5 | $0.100 | 12 | 25s | pass | pass | pass | pass | pass | pass | diff |
| Opus #1 | opus-5-5 | $0.227 | 12 | 39s | pass | pass | pass | pass | pass | pass | diff |
| Opus #2 | opus-5-5 | $0.220 | 12 | 48s | pass | pass | pass | pass | pass | pass | diff |
| Opus #3 | opus-5-5 | $0.215 | 12 | 40s | pass | pass | pass | pass | pass | pass | diff |