A session that began as "finish the checkout page" now also holds a debate about pricing copy, a half-applied database change, three unrelated fixes noticed on the way, and one abandoned approach nobody removed. There is no line in it where you could safely stop.

Claude Code is visibly worse than it was at the start, too. It proposes something you rejected an hour ago and edits a file you both agreed to leave alone. No bug caused that. The previous section was about picking work that fits; this one is about the conversation you do it in, which degrades whether or not you sized the work correctly.

The idea

A session is a fixed-size resource you spend as you go, and three things spend it fastest: unrelated tasks sharing one conversation, corrections piling up on a failed approach, and unscoped reading. Each has a specific fix, and none of them is trying harder. Close a session so the next one can start from a file rather than from your memory of this one.

text
   open                                                       close
     |                                                          |
     v                                                          v
 [ orient ] ---> [ build ] ---> [ verify ] ---> [ write the handoff ]
  read the        one result     a named             what changed,
  entry files     changes        check runs          what to open next
                      ^              |
                      |  red check   |
                      +--------------+

  found on the way, unrelated ---> open-work queue (a file, not your memory)

How it works

The reason is mechanical. The holds the whole conversation, and Anthropic's Claude Code guidance says plainly that when it gets full, the model may start forgetting earlier instructions or making more mistakes.

Each documented failure mode has something you type:

  • The kitchen-sink session mixes unrelated tasks into one conversation. Type /clear between them. It starts a blank conversation in the same project, which is what "reset the context" means in practice.
  • Corrections pile up and fill the window with approaches that did not work. There is a documented stopping rule for this, and section 7 puts it to work on the case where it bites hardest.
  • An unscoped "investigate this" reads hundreds of files into the window. Scope it, or ask for a in words: "use a subagent to find every place sendInvoice is called and report back a list."

Both ends are documented too. One recommended opening is to be interviewed into a written specification, then execute it in a fresh session, so the implementing conversation starts clean with a document to work from. At the other end, conversations are saved on your machine. claude --continue reopens the most recent one started in the directory you are in right now, so run it from the wrong folder and it will not find yesterday's work. claude --resume opens a picker instead, which can widen beyond the current project, so it is the safer of the two when you are not sure where you were.

What to do

  1. Open the session by pointing at the file that says where you stopped, rather than by summarising last time from memory. "Read PROGRESS.md and tell me what the next action is" costs one turn.

  2. Type /clear when the subject changes and the new subject does not need the old one. A session that has moved from the checkout page to an unrelated deployment question is two sessions sharing one window, and the second is reading the first's leftovers.

  3. When something out of scope turns out to be necessary, say so explicitly: "this needs a database column, which we excluded. I am extending the boundary to include it and nothing else." A stated enlargement is a decision. An unstated one is what ate the checkout session.

  4. Close by writing the handoff into a file before you close the window, a PROGRESS.md at the project root by convention. Four lines is enough, and the next session reads them cold:

    text
    Result:  /orders paginates. pnpm build passes, both states checked.
    Open:    the 120-order page takes 1.8s. Not investigated.
    Next:    src/lib/orders.ts, the query at line 40.
    Check:   pnpm build, then /orders on the test account that has 120.

Where it breaks

Clearing is not free, and neither is the automatic version. When the window fills, Claude Code compacts the conversation, replacing what you said with a summary of what it judged important; /compact does the same on demand. Either way a detail you mentioned once is exactly what gets dropped, so put anything load-bearing in a file rather than in a message.

Reaching for /clear too eagerly costs the other way. Anthropic's guidance says there are times to let context accumulate, when you are deep in one problem and the history is worth keeping. The signal is not elapsed time. It is whether the conversation still needs what is behind it.