Skip to content
C.W.K.
Stream
Lesson 02 of 05 · published

The Session-Boot Bill

~12 min · tokens, boot, context, cost

Level 0Trace
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Storage cost and read cost differ

A library can hold one hundred thousand tokens and cost almost nothing per session when retrieved on demand. Two thousand tokens in core may be reread every time and compound into a larger bill. Disk size misses the recurring cost that matters.

Weight therefore separates total vault size from the boot-loaded subset. Per-file token estimates and load order reveal where repetition compounds.

Read the boot chain from code

If instructions load an identity document, a core glob, and selected indexes, that executable contract is the measurement source. A prose list or hard-coded UI array becomes false as soon as the loader changes.

Dynamic branches matter. Mark files as unconditional, conditional, or on-demand so a reader distinguishes recurring cost from context used only for a task.

A token estimate is a receipt, not a price tag

Tokenizers and models count somewhat differently. Displaying the number as an exact currency amount creates false precision. The purpose is relative weight and change detection, not reconstructing an invoice.

Record tokenizer and measurement time. Keep currency as a separate projection so a model change does not destroy historical token comparisons.

Delta is more actionable than total

A total of fourteen thousand is less useful in review than learning that one change added eighteen hundred boot tokens. Semantic commits can carry token delta so the cost of memory editing remains visible.

A decrease is not automatically good. Minus four thousand may be duplicate removal or sanctuary loss. The number calls for review; reason and diff complete judgment.

Memory cost arises from the automatically repeated load path, not total stored volume. Use the real loader as source and separate total, delta, and load class.

Code

Separate recurring boot bill from on-demand corpus·python
files = [
    {"name": "identity", "tokens": 900, "load": "always"},
    {"name": "index", "tokens": 500, "load": "conditional"},
    {"name": "library", "tokens": 100000, "load": "on-demand"},
]
boot_bill = sum(f["tokens"] for f in files if f["load"] == "always")
assert boot_bill == 900

External links

Exercise

Follow your context loader's real code path and classify files as always, conditional, or on-demand. Calculate the always-loaded token total and the latest change delta.
Hint
Begin with paths the loader actually opens, not folder-name assumptions.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.