Many developers notice the same pattern. The first hour of a session is sharp. Three hours in, the agent repeats itself, forgets a constraint you gave early, or edits something it was told to leave alone. The usual advice is to start a new chat, and the usual problem is that a new chat knows nothing.
Why a long session drifts
Everything in the session competes for the agent’s attention: your early instructions, dead ends, long tool output, half-finished plans. The more there is, the more likely something important is outweighed by something recent. Exact limits differ per tool and model, so treat any rule of thumb as a hint and watch the behaviour instead.
Signs it is time to restart
- The agent suggests something you already rejected.
- It asks a question you answered earlier.
- It changes files outside the task.
- You are about to paste a long summary of the session into the chat yourself.
Save first, then restart
Before you close the chat, make sure what you learned is somewhere the next chat will read it:
- Findings with their source (a file, a commit, a log line).
- Decisions with the reason.
- Failed attempts with why they failed.
- A short checkpoint: what is done, what is next, what is open.
With a Contextingo project connected, the agent saves these with context_upsert while it works and session_checkpoint when you stop. The new chat calls session_start and context_get and starts from them, so a restart costs one command instead of a long briefing.
The same mechanism covers the day your usage limit hits mid-task: see handing off from Claude Code to Codex.