Skip to content

v0.21.0 — context economy

Choose a tag to compare

@Koroqe Koroqe released this 23 Sep 17:09
· 52 commits to main since this release
96075b4

Added

  • A context-size notice before the next expensive turn. A UserPromptSubmit hook (shared/scripts/context-budget-notice.mjs) reads the session's own transcript and, once the conversation passes 150k tokens of context (then every further 100k), tells the human and the steward: every request now re-reads all of it, so a new topic belongs in a fresh session and a continuing one wants /compact. Once per band, zero model requests, fail-open. Thresholds: OPOS_CONTEXT_NOTICE_AT, OPOS_CONTEXT_NOTICE_STEP.
  • autoCompactWindow: 250000 in shared/templates/required-settings.json. On 1M-window models Claude Code otherwise compacts at about 967k tokens. Verified three ways: the official model-config documentation (settings key, 100k–1M), --autocompact in claude --help, and the key in the shipped binary. A consumer's own value is never overwritten.
  • The steward's "Context economy" rules: one topic per session (write a handoff to the task issue, then /clear); delegate multi-step grunt work (investigations, sweeps, syncs, long Bash sequences) to a subagent with a fresh context; never run a sync in the main thread; never read a large file whole.
  • check-for-updates/check.mjs — the manual update probe as one Bash call. It reports only a newer release (semver): the old procedure reported any different tag, so a consumer pinned ahead of upstream's latest release would have been told to "update" to an older one. It keeps its own cache (.claude/.update-probe) and never touches the session updater's daily flag.

Changed

  • Nothing invokes check-for-updates any more. task-register, task-update, task-complete and the steward's First-touch ran it on every call, turn by turn: about five requests, each re-reading the whole session context. The daily SessionStart updater (v0.19.0) owns routine checks; the skill is on-demand only.
  • sync-from-core runs in a subagent, and applies every pending release in one run.
  • The session updater's per-clone .git/info/exclude list now also covers .claude/.update-probe and .claude/.sessions/.

Why

Measured at the reference consumer from its local transcripts: one interactive session ran 28 hours across five unrelated topics, reached 925k tokens of context with zero compactions, and alone was 80% of a week's usage — 81% of its 244M tokens were spent at more than 400k context, where a single git status re-reads ~0.9M tokens. The usage dashboard's "16% from /check-for-updates" was mostly attribution (it charges everything after a skill to that skill; a copier update sync run inside that session followed the check), but the skill's turn-by-turn execution and its "different, not newer" comparison were real defects.

Migration

  • A consumer without a UserPromptSubmit key receives the hook automatically from sync-from-core / the updater's settings reconciliation, and autoCompactWindow likewise when unset. A consumer with its own UserPromptSubmit hooks keeps them and must add node shared/scripts/context-budget-notice.mjs by hand (the additive class never rewrites an existing value).