learn / ai for everyone / ae14 · 1 of 1 · 8 min
Why long chats get worse, what "compaction" does to your conversation, and the habits that keep an AI sharp through big tasks.
## The AI has a desk, not a filing cabinet
Every time you send a message, the AI rereads the whole conversation from the top: your messages, its answers, every file you attached. Everything has to fit on one desk, called the context window.
┌───────────────── context window ─────────────────┐
│ hidden instructions │ your files │ chat so far │ ← all reread
└──────────────────────────────────────────────────┘ every turn
new message ──▶ answerSize is measured in tokens, chunks of roughly three quarters of a word. Modern windows hold hundreds of thousands of tokens, sometimes more. But two things hurt long before you hit the limit. Models pay less attention to the middle of long inputs ("lost in the middle"), and old mistakes or abandoned ideas stay on the desk and keep pulling answers off course. Every token is also reread each turn, so long chats are slower and, if you're paying per use, more expensive.
Why does a very long chat tend to give worse answers than a fresh one?
## What compaction does
When the window gets close to full, many apps and coding agents compact: they ask the model to summarize the conversation so far, throw the original away, and continue from the summary.
That keeps the session alive, but a summary is lossy:
- Exact wording is gone. A precise instruction becomes "user wants it concise".
- Small but important details can drop. A file name, a number, the one thing you said never to do.
- The AI doesn't know what it lost. It carries on confidently from the summary.
If an assistant suddenly "forgets" a rule after a long session, compaction is the usual suspect.
Two hours into a session, your coding agent starts editing a file you told it at the very start never to touch. What most likely happened?
## Memory is not the same thing
Many apps also have a memory feature. It saves short facts about you ("prefers metric units", "has two kids") between chats and slips them into the context of new ones.
- Context is this conversation's desk. It's big, temporary and reread every turn.
- Memory is a small sticky note that follows you to new chats.
- Project or instruction files are notes you write on purpose. Chat apps have "projects" with custom instructions, and coding agents read files like
CLAUDE.mdorAGENTS.mdin your project at the start of every session.
You control the third one, so put the rules that must never be forgotten there. They're reloaded fresh every time and survive compaction.
## Habits that keep it sharp
- One task, one chat. Don't plan a vacation in the same thread you used to fix a spreadsheet.
- Important things first or last. Put key facts at the top of a new chat, or repeat them right before the question.
- Hand off on purpose. Before a chat gets long, ask: "Summarize the decisions, open questions and exact requirements so I can start a new chat." Read it, fix it, paste it into a fresh chat. You just did a careful compaction yourself.
- Attach only what's needed. Three relevant pages beat a 300-page PDF.
- Write rules down once. Use project instructions or an instruction file for anything you'd otherwise repeat.
In coding agents, watch the context meter if the tool shows one. Clear or start a new session between unrelated tasks. Ask the agent to write a progress file (what's done, what's next) before a long session compacts, so the next session can reread it.
Your chat is getting long and sloppy. Put a clean handoff in order.
- 1.Ask for a summary of decisions, open questions and exact requirements
- 2.Paste the corrected summary first, then ask your next question
- 3.Read the summary and fix anything it got wrong or left out
- 4.Start a new chat