The misunderstanding about the context window
When people talk about "context," the first thing that comes to mind is usually the size of the context window. Bigger is better. That intuition is understandable, but it points in the wrong direction. A large context window is like a large whiteboard — it doesn't help if you write the wrong thing on it.
The actual problem isn't the amount of information you can hand over, it's the quality of that information. A model with precise context beats a model with lots of context almost every time.
What a model actually needs
From practical experience, three categories that really help:
- Facts that can't be inferred: quirks of your system that aren't in the docs. Specific constraints. Decisions from past reviews.
- Directly relevant code: the 30–50 lines that actually matter for the task — not the whole file.
- The goal in one line: what should be different at the end? More precise than you think is necessary.
What you can leave out
Irrelevant files that "might be relevant." Long comment blocks that describe the code. Boilerplate with no bearing on the task. Repeated explanations of the same thing.
Every token that carries no information displaces one that does. Token discipline isn't a cost-cutting measure — it actively improves the quality of the answers.
Preventing hallucinations through context
Most hallucinations don't come out of nowhere. They happen because the model fills a gap — where information is missing — with a plausible assumption. That's not a bug; it's the model doing exactly what it was trained to do.
Consequence: the spots with the highest hallucination risk are the spots where context is thin. Identifying and filling those gaps reduces hallucinations more effectively than any prompt formula.
Persistent context vs. session context
A distinction I find increasingly important: some information matters for one session, other information matters for all sessions. Session context: the current bug, the specific file, the concrete error. Persistent context: architecture decisions, known quirks, team conventions.
Keeping persistent context in a memory file and loading it automatically at session start saves explanations and stops the model from starting from scratch every session.