How full is the context? Use the numbers we already have

· Decision D008 · How Otto came to be

How Otto first showed how full a session’s context was, without building anything new.

A Claude session has a context window, a limit on how much text the model holds at once. We wanted each session card in Otto to show how full it was, “so developers know when to compact without reading terminal output”, as the plan we worked from put it.

The decision calls this phase 1 and keeps it small. Fill is the session’s input token count divided by its model’s context limit. Otto already tracked the count for every session, and the limits are a static map of about five lines. “No new infrastructure, no terminal scraping.” Reading the terminal is the one alternative the entry names, and it rules it out. We didn’t record any others.

The reasons follow from that. The count was already there, the map was tiny, and together they gave a fill percentage at once, at “zero infrastructure cost for phase 1”.

The cost was detail. The bar could say how full a context was, but not what filled it: messages, system prompt or free space. That breakdown had to wait for phase 2, a Stop hook (D010).

Here the code and the decision arrived on the same day. A commit called “projects-first nav, session context fill, recent sessions” (d99123f9) added the fill bar at 11:43 (UTC+10). The decision followed at 13:32, with ten others, in a commit with no message. That second commit also added the plan, dated 2026-04-24 in its file name, which already put the calculation in the window’s code.

Later, on 2026-06-11, our check marked it shipped. The note says the limits map and the fill calculation “ended up” in the renderer, the code that draws the window, instead of the main-process file the entry named. Git shows they were there from the commit that added them (d99123f9), as the plan said. The check added that phase 2 had shipped too, so the breakdown existed.

This decision’s text stops there. The breakdown it waited for was later retired; the post on D010 tells that part.

Decision D008 · 2026-05-05 · ba6e1975, 9399ca23 (moved to its own file in 94a000a6, wording unchanged)

All posts