# 26.1 Why long sessions drift and bloat (/building-ai-workers/context-engineering/why-long-sessions-drift-and-bloat)

---
type: Document
title: "26.1 Why long sessions drift and bloat"
description: "Why a long session drifts and bloats, the two causes of drift, and why a bigger window cures neither."
status: stable
order: 326.01
ksor:
  owner: team:panaversity
  audience:
    - public
  approval:
    by: process:panaversity
    at: 2026-11-30T08:16:28Z
chapter: '26'
part: III
expert_status: manager
concepts: [ "26.1" ]
last_verified: '2026-11-30'

sources:
  - id: anthropic-ccdv-f-exam-guide
    title: Claude Certified Developer - Foundations Exam Guide, version 1.1, effective December 7, 2026 (read 2026-11-29)
    resource: https://cc.sj-cdn.net/instructor/6nizmqk8tpzpfjvt6qmmav7rh/public/1794946771/Claude_Certified_Developer_-_Foundations_Exam_Guide_Updated_Dec_7.pdf
  - id: anthropic-context-windows
    title: Context windows (verified 2026-11-29)
    resource: https://platform.claude.com/docs/en/build-with-claude/context-windows
  - id: claude-code-best-practices
    title: Best practices for Claude Code (verified 2026-11-29)
    resource: https://code.claude.com/docs/en/best-practices
  - id: anthropic-eng-context
    title: Effective context engineering for AI agents (Anthropic, verified 2026-11-29)
    resource: https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
generated:
  at: 2026-11-30T08:16:28Z
  by: esl-rewrite/1.2.0+ksor.1
trust_tier: unverified
build_id: sha256:d6ce3f28a2cf8e492a60bae1b426b7cc6466e35e83d70c3b9763db2c55009f4b
dirty: true
ksor_version: 0.0.60
---

**In everyday life.** You study for an exam at a small desk. On the first evening you write your teacher's one rule on a card, "show your work for every answer". You lay the card on the desk. Each evening more arrives: books, printed pages, old practice papers. After a week, two different things can go wrong. The card is still on the desk, but it lies among forty pages and you look at it less. Or your brother tidies the desk into one neat pile of "the important things", and the card is not in the pile. Either way, you stop showing your work. For the first, you need a clearer desk. For the second, the card needed a place the tidying could not reach, such as the wall.

**What you will learn.** You practice this in Lab 26, Tasks 1 and 2, where a check fails and you find the cause.

- What do bloat and drift mean?
- What are the two causes of drift, and why do they need different fixes?
- Does a bigger context window cure either one?
- Who sees the signs when nobody is watching?
- What does one long session cost, and when is it still the fair choice?

**Why it matters.** A fix for the wrong cause changes nothing. A smaller window does not bring back a rule that a summary removed.

**At work.** Friday's month-end review (the overview) shows both words of this section's title. Tool results pile up, and then a rule is gone. On Monday at 8:40 you have one question. Was Dave's rule still in the window?

### What do bloat and drift mean?

**Bloat is the window filling with text the work no longer needs. Drift is the worker no longer following a rule it followed at the start.** The exam guide names them together, as "context bloat or drift".[^anthropic-ccdv-f-exam-guide]

In a worker, **bloat** is mostly evidence piling up. Every tool result stays in the conversation, and each request carries the whole history, so every turn pays again for everything before it (21.5).

Drift is the guide's word. When you name the failure in a report, its name is context loss (24.7).

### What are the two causes of drift, and why do they need different fixes?

**Attention and removal. In the first the rule is still in the window, and in the second it is not.**

- *Attention.* The rule is in the request, among much else, and gets less of the model's attention. Anthropic's documentation says: "As token count grows, accuracy and recall degrade, a phenomenon known as *context rot*."[^anthropic-context-windows] Its engineers call this "a performance gradient rather than a hard cliff".[^anthropic-eng-context] So no line marks where it starts. Bloat makes it worse. The fix is less in the window (26.3 to 26.5).
- *Removal.* The rule's text is no longer in the request at all. A summary replaced the turns that held it. A fact can be lost in the same way, when old tool results are cleared. The fix is a home outside the conversation, given before the run (26.6).

The second fix depends on one fact about where text lives. The worker's instructions go out whole with every request, because your code sends them each time, and no summary rewrites them. A system message is a rule that the operator's code adds in the middle of a run (25.2). It is part of the history, and so is a rule in the request or a correction typed later. A summary or a fresh session replaces the history.

Friday's run shows removal only. For attention, use 12.5's signs and the two lines quoted above.

### Does a bigger context window cure either one?

**No.** On November 29, 2026, the lab's model, `claude-sonnet-5-5`, had a context window of 1 million tokens. The same page that says so adds that "more context isn't automatically better".[^anthropic-context-windows] A bigger window lets more pile up before anything is cut, so a rule is among more text for longer. And the summary still comes, at the size you set or at the product's own.

Anthropic's guide for its coding agent agrees. Because of large windows and automatic compaction, "running out is rare". It still says that to start a fresh session (`/clear`) between tasks is worth doing, "because a focused context gets you better answers and costs less."[^claude-code-best-practices]

### Who sees the signs when nobody is watching?

**A check by code and the trace, read the next working morning.** In 12.5 you saw four signs with your own eyes. Each one now has to be something a program can show.

| The sign in 12.5 | What shows it after an unwatched run |
| --- | --- |
| It forgets a rule from the start of the session | The check by code passes the early invoices and fails the later ones |
| It repeats a mistake you already corrected | The check's failure message was sent back (23.16), and the same failure is in a later answer |
| It works as if an earlier version were still current | A decision's value differs from the tool result it was made on |
| Its answers get longer and less precise | In the trace, the tokens the model writes grow turn by turn |

To find the cause, read what the request held at the first failing turn, which is 26.2's subject. If the rule's words are there, the cause is attention. If they are not, the cause is removal, and the rule had no home outside the conversation.

### What does one long session cost, and when is it still the fair choice?

**It costs every turn's re-reading, each summary, and the risk that a cut removes a rule.** A summary is itself a model call that you pay for (26.4).

One long session is still fair when the steps depend on each other. Anthropic's engineers write that compaction "maintains conversational flow for tasks requiring extensive back-and-forth".[^anthropic-eng-context] The month-end review is one task, in which a late invoice can depend on an earlier decision. So one session is a fair choice for it, once its rule and its decisions have a home.

**The operating rule:** when a worker stops following a rule, ask first whether the rule was still in the request.

**Do this now.** Ask your coding agent to find where each rule of one project lives. Copy this line:

> List every rule this project's worker is given. For each one, say where it is written: in its instructions, in the first request, or in a message sent later in a run. Mark each rule that is not in the instructions. Change no file.

[^anthropic-ccdv-f-exam-guide]: Claude Certified Developer - Foundations Exam Guide, version 1.1, effective December 7, 2026, Anthropic.
[^anthropic-context-windows]: Context windows, Anthropic.
[^anthropic-eng-context]: Effective context engineering for AI agents, Anthropic.
[^claude-code-best-practices]: Best practices for Claude Code, Anthropic.
