← Back to article

Equation 9 · How Claude Code's Memory Actually Persists Across Sessions

What does this equation mean?

Costn=1.25 c Tp+(n−1) (0.1 c Tp)+c∑i=1nTv,i\mathrm{Cost}_n = 1.25\,c\,T_p + (n-1)\,(0.1\,c\,T_p) + c\sum_{i=1}^{n} T_{v,i}

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.

Inputs and operations1.25cT_p + (n-1)(0.1cT_p) + csum_i=1^n T_v,i
Result or conditionCost_n
How to read the two sides of this formula. Follow the article passage for the meaning of each quantity.

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

nn

Symbol n

n appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.

Understand this part →

cc

Symbol c

the against a per-token base price.

Understand this part →

TpT_p

Symbol T_p

the number of tokens.

Understand this part →

ii

Symbol i

i appears in the bound of this sum. The bound states where the repeated operation starts, ends, or which values it includes.

Understand this part →

Tv,iT_{v,i}

Symbol T_v,i

TvT_v,i is one of the signed contributions combined to compute the quantity on the left.

Understand this part →

=

=

The expressions on both sides represent the same quantity under the stated assumptions.

Understand this part →

See an illustrated explanation →
addition

addition

Add the term after the plus sign to the term or group before it.

Understand this part →

subtraction

subtraction

Subtract the following term or group from the preceding one. A leading minus marks a negative quantity.

Understand this part →

subscript

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.

Understand this part →

superscript

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.

Understand this part →

See an illustrated explanation →
i=1i=1

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.

Understand this part →

nn

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.

Understand this part →

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 TpT_p tokens reused across n turns of a session, against a per-token base price c , the total cost of that prefix is Costn=1.25 c Tp+(n−1) (0.1 c Tp)+c∑i=1nTv,i\mathrm{Cost}_n = 1.25\,c\,T_p + (n-1)\,(0.1\,c\,T_p) + c\sum_{i=1}^{n} T_{v,i}. 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 TpT_p tokens reused across n turns of a session, against a per-token base price c , the total cost of that prefix is Costn=1.25 c Tp+(n−1) (0.1 c Tp)+c∑i=1nTv,i\mathrm{Cost}_n = 1.25\,c\,T_p + (n-1)\,(0.1\,c\,T_p) + c\sum_{i=1}^{n} T_{v,i}. 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.

Read the equation in its article →

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

See this formula across 1 published context →

Browse the mathematical compendium →