← Mathematical compendium

Published equation contexts

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}

Why this formula appears here

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 article-specific guide →

Read the representative guide

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.

Read this term in its guide →
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.

Read this term in its guide →
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.

Read this term in its guide →
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.

Read this term in its guide →

How to interpret it

Read it with the definitions, units, and assumptions supplied by the article.

Research cited beside this formula

Published contexts (1)

A symbol can carry a different meaning in another article. Each occurrence keeps its own guide and term definitions.

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}

Equation 9 · AI Agents & Systems

How Claude Code's Memory Actually Persists Across Sessions

This equation states an equality: the expressions on both sides have the same value under the article’s assumptions.

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…

Meanings in this article

  • cc: the against a per-token base price.
  • TpT_p: the number of tokens.
Equation guide → · Article →