Use this when:
- The agent repeats something already settled.
- It suggests an approach you already ruled out.
- You paste lots of context and the answer still misses the point.
- You don't know which files, snippets, logs, or notes to include.
Before the next prompt, do this:
- Write the goal of this turn in one sentence.
- Include only the file/snippet/log directly tied to that goal.
- State 2-5 constraints that must not be broken.
- Give one good example or one bad example if you have one.
- Say what output you want: plan, diff, diagnosis, comparison table, or prompt.
What does this turn need to decide or change? One sentence is enough.
The exact file, snippet, log, or screen involved. Leave the rest outside.
What must stay unchanged, be preserved, or require approval before touching.
One right example or one failing case anchors the model in reality.
Don't make it guess whether you want analysis, code, or a plan.
Good context isn't long. Good context makes this turn hard to misunderstand.
01Don't paste history to fix drift
Halfway through a long task, the natural reflex is to paste the whole history back so the agent "remembers." That often makes the answer worse: the context gets bloated, the important part gets diluted, and the agent has to guess what matters now.
The right question is not "what haven't I pasted yet?" The right question is: what does this turn need in order to be correct?
If this turn is about one function, don't include the entire product history. If this turn is about diagnosing one error, don't add three files that never touch the error. If this turn is about writing in an old voice, don't paste the whole inbox; paste two or three examples that sound right.
✕ Paste for completeness
✓ Set the desk for this turn
02How to decide what goes in
Sort everything you have into three buckets.
Bucket 1: include now. Anything the agent will almost certainly get wrong without: current goal, code/file being edited, error log, sample data, mandatory convention, definition of done.
Bucket 2: mention, but don't include yet. Possibly relevant but not needed yet: neighboring modules, older decisions, indirect callers, background docs. Tell the agent to ask before touching them.
Bucket 3: keep out of chat. Noise, sensitive data, or oversized context that doesn't help this turn: old transcript, unnecessary personal data, a giant file where only one paragraph matters, unfiltered logs.
Prompt to use:
This turn's goal: [one sentence].
Context to anchor on:
- [directly relevant file/snippet/log]
- [constraints that must not break]
- [right/wrong example if available]
Possibly related but not included yet: [short list].
If you need to touch those, ask first.
Output I want: [plan / diff / diagnosis / comparison table / answer].Good result: the agent's answer is shorter but more focused. It asks for the right extra context instead of quietly expanding scope.
03Long-lived memory belongs outside chat
One turn's context is not the whole task's memory. The chat will grow, get summarized, be forgotten, or disappear from the next session. If a decision needs to live across many turns, move it out of the chat.
Examples:
- Project convention → put it in
CLAUDE.md, a README, or a rule file. - Architecture decision → write it in
DECISIONS.mdor a changelog. - Remaining work → put it in an issue or task list.
- A prompt that worked → add it to a prompt library or skill.
Don't ask the agent to "remember." Put the thing where the next session can read it.
04Signs you chose context well
You chose well when:
- The agent doesn't ask again for things you knew were mandatory.
- It doesn't wander into areas outside this turn.
- The output can be checked against the context you gave.
- A future session can continue because long-lived decisions live in a file, not an old chat.
Context is not a warehouse. It's the desk for this turn. Put only the tools needed now on the desk; put long-lived rules in a labeled drawer so the next turn can find them again.