Equation 9 · How Claude Code's Memory Actually Persists Across Sessions
What does this equation mean?
Read the formula alongside the article passage below. Each part has a deeper page with its role in the equation, the supporting passage and nearby citations.
This equation states an equality: the expressions on both sides have the same value under the article’s assumptions. Read the equation part by part below; each part has a contextual explanation and a link to its mathematical background.
Read it piece by piece
Symbol n
n appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.
Symbol i
i appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.
Symbol T_v,i
,i is one of the signed contributions combined to compute the quantity on the left.
=
The expressions on both sides represent the same quantity under the stated assumptions.
See an illustrated explanation →subtraction
Subtract the following term or group from the preceding one. A leading minus marks a negative quantity.
subscript
The lower label selects a particular version, component, or indexed member of the quantity. For example, x₀ and xₜ can be values at different positions.
superscript
A raised number can be a power. When it is a label or bound, it selects a case or the upper limit of a sum; the formula’s structure distinguishes these uses.
See an illustrated explanation →Starting index or lower bound: i=1
This label says where the repeated addition, multiplication, or accumulation starts. Read its value or condition together with the article’s description of the index.
Ending index or upper bound: n
This label says where the repeated addition, multiplication, or accumulation stops. It sets the last term or end of the range.
How to interpret it
Read it with the definitions, units, and assumptions supplied by the article.
What the article says around this equation
The dollar cost of re-reading the same CLAUDE.md content every turn is close to solved. Anthropic’s prompt caching system lets a stable prefix — system prompt, memory files, tool definitions, anything identical from one request to the next — be written to a cache once and then reused. A cache write costs a documented 1.25 times the base price of an input token; a cache read, on every subsequent turn that reuses it, costs a documented one-tenth of that base price [ 5 ] . For a stable prefix of tokens reused across n turns of a session, against a per-token base price c , the total cost of that prefix is . where the final sum covers each turn’s own variable content. Past…
Read the full surrounding passage
The dollar cost of re-reading the same CLAUDE.md content every turn is close to solved. Anthropic’s prompt caching system lets a stable prefix — system prompt, memory files, tool definitions, anything identical from one request to the next — be written to a cache once and then reused. A cache write costs a documented 1.25 times the base price of an input token; a cache read, on every subsequent turn that reuses it, costs a documented one-tenth of that base price [ 5 ] . For a stable prefix of tokens reused across n turns of a session, against a per-token base price c , the total cost of that prefix is . where the final sum covers each turn’s own variable content. Past the first turn, every further read of the same CLAUDE.md content costs a tenth of an uncached read — caching is specifically recommended for exactly this kind of content, described in the documentation as “stable, reusable content like system instructions, background information, large contexts” [ 5 ] . In dollar terms, a project memory file that stays identical across a long session is nearly free after its first turn.
Sources cited in the surrounding passage
These citations give research context. Read each source to check which claims it supports.
Return to How Claude Code's Memory Actually Persists Across Sessions