One long chat or a fresh session per feature? Same pass rate, 37% cheaper in one chat
We had Claude Code build the same five features in order, either all in one continued session or in a fresh session per feature, 3 runs each. Both setups passed all 11 checks in 2 of 3 runs, each missing once on the trickiest feature. The one long chat averaged $0.204 per five-feature build against $0.326, and finished in 76.3 seconds against 106.5. At five small features it never got near compaction.
Last week we posted that building in one giant chat window costs you, and that splitting a build into one fresh session per feature keeps the context clean. We hadn’t measured it. This is the measurement.
We’ve tested /clear before on three small related tasks and on unrelated tasks, and our cache audit looked at what the prompt cache does with CLAUDE.md. This one is about session strategy for a multi-feature build: five features in a row, including two with real edge cases, scored on quality as well as cost.
The setup
The small cart module from our earlier tests (subtotal(), total() with tax, a roundCents() helper and a lint rule in npm run check that bans Math.round and friends outside it). Five features, always in this order:
checkout(items, { coupon })with two coupon codes, unknown codes throwing, and tax after the discount.splitBill(items, people), splitting the total so the pennies come out right.itemCount(items).discount(items, percent).- A README documenting every exported function and how to run the checks.
Each feature prompt also asked for tests and a line under Unreleased in CHANGES.md. Two setups, same prompts:
- One long session: all five features in one continued Claude Code session (each prompt resumes the previous one).
- Session per feature: a fresh session for each feature, like
/clearor a new chat per feature.
3 runs of each, 6 in all, run in pairs (one of each setup back to back). Claude Code 2.1.321, Sonnet 5.5. After each run, 11 checks: npm run check, hidden tests for all four functions that Claude never saw, tests added for all four, CHANGES.md and README coverage, generated files untouched, and whether it ran the tests after its last code edit.
What happened
| One long session | Session per feature | |
|---|---|---|
| All 11 checks pass | 2 of 3 | 2 of 3 |
| Average cost per five-feature build | $0.204 | $0.326 |
| Cost range | $0.182 to $0.218 | $0.310 to $0.334 |
| Average time per build | 76.3s | 106.5s |
| Average turns | 36.3 | 61.3 |
| Feature 1 (checkout) | $0.082 | $0.088 |
| Feature 2 (splitBill) | $0.048 | $0.093 |
| Feature 3 (itemCount) | $0.022 | $0.050 |
| Feature 4 (discount) | $0.030 | $0.054 |
| Feature 5 (README) | $0.023 | $0.042 |
| Cache reads per build | 416,484 | 655,112 |
| Cache writes per build | 20,045 | 47,099 |
| Output tokens per build | 11,250 | 14,249 |
| Context at the start of feature 5 | 30,734 to 32,768 | 18,495 to 18,499 |
| Largest context on any request | 34,007 | 27,118 |
Costs, tokens, times and turns are averages over 3 runs, summed over the five features; ranges are lowest to highest. Token counts are as the API reported them. Every run, check and diff: run data.
What we learned
Quality was a tie. Each setup passed all 11 checks in 2 of 3 runs. The hidden tests for checkout(), itemCount() and discount() passed in all 6 runs, and the one for splitBill() in 5 of 6. Both misses were on splitBill(), the feature with the pennies problem, and they were different mistakes (below). Three runs per setup can’t separate the two on quality.
The long chat was cheaper because each new session starts by reading the repo again. A fresh session paid $0.093 for splitBill() against $0.048 in the long chat, and roughly double for features 3 to 5 too. It also took more turns, 61.3 against 36.3, and wrote more than twice as much to the prompt cache (47,099 tokens against 20,045). The long chat had already read the cart module and its tests; a fresh session had to look again. Overall the long chat cost 37% less and finished 28% faster.
“Clean context” was real, but small here. A fresh session started every feature at 18,495 to 18,672 tokens. The long chat started at 18,667 to 18,670 and grew to 30,734 to 32,768 by the fifth feature and never went above 34,007 on any request. That is nowhere near where Claude Code compacts, so this test says nothing about what happens when a long chat does get compacted.
What failed, and the limits of this test
- One long session, run 1:
splitBill()gave any leftover pennies all to the first person. With 7 people, shares can then differ by 2 cents, and the hidden test requires at most 1. Its own tests passed. - Session per feature, run 3:
splitBill()worked, but usedMath.roundandMath.floorin the cart module, so the lint step ofnpm run checkfailed. The hidden tests for all four functions passed. - Five small features, one small repo. The features shared one file, which favors a continued session. A long build with many unrelated features, or a chat long enough to be compacted, could flip this, and we didn’t test either.
- 3 runs per setup. Enough to see the cost gap (the ranges don’t overlap), not enough to call a quality winner.
- Costs are API list prices as Claude Code reports them, not subscription usage. For continued sessions we take each feature’s cost as the session total minus the features before it.
- No coordinator. Our post described Claude Projects with a coordinator picking a model per session. Here every session was Sonnet 5.5 with the same prompts, so this measures only the session split.
The recipe
- For a run of small features in the same part of the code, stay in one session. Here it cost $0.204 per build against $0.326, with the same pass rate.
- Start fresh when the work moves somewhere else or the conversation gets long enough to be compacted. Fresh sessions began every feature at 18,495 to 18,672 tokens; the long chat had grown to 30,734 to 32,768 by feature 5.
- Don’t count on either to catch edge cases. Both setups shipped one
splitBill()miss. Runnpm run checkafter the last edit, and test the pennies.