Context limits almost never show up as a clean error.
They show up as an agent that was sharp at 10:00 and sloppy by 14:00. Same model. Same tools. Worse output.
That is the silent killer: the window is full, the signal is diluted, and the loop keeps running like nothing happened.
Originally posted on X. Expanded here as a developer field guide.
What actually fails
When people say "the agent forgot," they usually mean one of these:
- Critical facts were pushed out by logs, retries, or paste spam
- Contradictory instructions stacked until the model optimized the wrong goal
- Retrieval dumped noise that looked relevant by keyword but not by task
- No compaction - every turn re-included the entire history
The model is still "smart." The working set is garbage.
Symptoms checklist
- Answers ignore constraints you stated earlier in the same session
- It reopens fixed bugs
- Tool calls get more random as the session lengthens
- You keep re-pasting the same "important" paragraph
- Quality jumps after
/clearor a fresh session
If quality jumps after a hard reset, you have a context problem, not a model problem.
The wrong fix
Buying a bigger context window without discipline.
A larger window delays the collapse. It does not design the working set. Teams that paste the whole monorepo into a 1M window still drift - just later, with a higher bill.
The right fix · four practices
1. Separate durable memory from the live window
Journal decisions, not transcripts. Promote repeated lessons into skills. Keep session context thin.
Related: Claude + Obsidian memory stack · journal pattern
2. Compact on purpose
At task boundaries, write a short state file:
- Goal
- Done
- Blocked
- Next action
- Files that matter
Then start a clean turn with that file instead of the full chat.
3. Retrieve with a budget
Cap how many chunks enter the window. Prefer exact paths and diffs over semantic soup. If retrieval cannot name why a chunk is here, drop it.
4. Verify after long runs
After N tool calls or N minutes, force a checkpoint:
- Summarize what changed
- Diff against the brief
- Human gate before irreversible steps
Operator rule of thumb
If the agent has been "working" for an hour without a written state snapshot, you are flying blind.
Context limits will not crash the process. They will quietly ship the wrong change.
Developer exercise (30 minutes)
- Take one real agent session that went bad
- List every token source that entered the window (files, tools, prior messages)
- Delete half of them on paper
- Re-run the same task with only the kept set
Most people discover the deleted half never earned its place.
Next
- Full essay: Your context did not fail the agent - the other way around
- Runbook patterns: Agent OS checklist
- Hands-on install: Agent OS Setup
Manage the window. The model will look smarter overnight.