C.W.K.
Stream
Lesson 04 of 05 · published

Evict What Stopped Earning Attention

~25 min · eviction, working-set, stale-context

Level 0Window Watcher
0 XP0/50 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

Context must leave

Every loaded item should have a lifecycle. It enters because it is needed, stays while it is active, and leaves when it becomes stale or superseded. Workflows without an eviction discipline accumulate context until the window is mostly archaeology.

Eviction is not forgetting

Eviction means moving the material to the right storage: file, history, index, ticket, or commit. The window should contain active work, not everything that ever happened. The pointer to the evicted material can stay in the index; the full text leaves.

The eviction question

Ask: would this content change the next decision? If not, keep a pointer and move on. The question is binary and fast, which is the only kind of policy a long session will actually follow.

Code

Eviction predicate·python
def should_keep(item, next_decision):
    return (
        item.is_live_rule
        or item.blocks_next_action
        or item.contains_unresolved_error
        or item.is_current_source_for(next_decision)
    )
Eviction lifecycle·yaml
lifecycle:
  enter:    "loaded for a specific task"
  active:   "referenced in last 3 turns OR contains live rule"
  evict_to:
    file:    "raw command output"
    history: "resolved decisions"
    index:   "general references"
    commit:  "finalized changes"

External links

Exercise

Review a hypothetical long session and choose three things to evict. For each, say where the pointer should live (file, history, index, ticket, commit).
Hint
Good eviction preserves retrieval, not necessarily full text.

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.