THIS IS A PURE F*CKING GOLDMINE
Anthropic just shared one of the best tricks for Claude Code: keep one context for the whole build and let the cache pay for itself.
a full app, 6 layers, 10.69M tokens, and the bill came out at $9.93 instead of $45.84.
claude --model opus "build the ~/app: spec → run"
here's the split:
▸ one agent, one context, every layer in the same session
▸ spec, db, api, ui, tests, run, all built without a single restart
▸ 9.45M of those tokens were cache reads, only 1.05M were fresh input
▸ 90% cache hits, 78% of the bill never happened
the part everyone gets wrong: they restart the session between layers.
Opus 5.5 is $4 per million in, $20 out, but a cache read is $0.20. that is 20x cheaper than paying for the same context twice.
keep the context alive and layer 6 re-reads everything layer 1 wrote for almost nothing. kill the session and you buy that entire history again at full price.
the meter is 3 numbers, not one: input, cache reads, output. $4.20 + $1.89 + $3.84 = $9.93.
output is the expensive half per token but the smallest by volume. 192k written against 10.5M read. you are paying to read, not to write.
one thing that quietly kills this: switching models mid-build. /model resets the cache and the next turn re-reads the entire context as fresh input. one switch can cost more than the layer you were on.
one agent, one context, 6 layers, $9.93 and the app runs.
JEV engineering is the same move one layer down: 1,877 forks this run - which file, which layer, retry or stop - resolved in code at 0.90 sharpness, and only the split ones ever re-plan
the full tree
▸ one agent builds every layer inside a single context
▸ spec, db, api, ui, tests, run, never restarted between them
▸ cache reads carry 90% of the tokens at a twentieth of the input price
▸ never switch models mid-build, it resets the cache and re-reads everything
▸ read the bill as 3 meters: input, cache, output
▸ JEV resolves micro-forks in code and re-plans only on a split
paste the tree and this prompt into Claude Code ↓
"Rebuild my builds around this tree:
1. Build every layer of a project inside one session on Opus 5.5, never restart between layers.
2. Order the work spec, db, api, ui, tests, run so each layer reuses what the last one wrote.
3. Never switch models mid-build, it resets the cache and re-reads the whole context as fresh input.
4. After the run, report the bill as three numbers: uncached input, cache reads, output.
5. Add one rule to CLAUDE.md: a cold restart mid-project is a billing decision, not a convenience.
6. Route deterministic forks (file choice, layer choice, retries) through JEV.
Show me every change as a diff first. No edits until I say go."
↳
save it, 78% of your next bill is sitting in that one habit.
もっと見る