Context window budgeting as a formal allocation problem
Turning "what fits in the context window" into an explicit, numerical allocation decision across competing needs, with a worked algorithm and code.
8 min readUpdated 2026-09-03context-engineeringbudgetingoptimization