The context kit: what is actually inside your AI's window
The short version
Context is everything your AI can see at the moment it answers you. Not what it learned in training, and not a memory of you. It is one window holding your instructions, the files it has opened, every message you have both sent, and the output of everything it ran. Each time you press enter it reads that whole pile again from the top and then writes the next reply.
That is why a chat gets worse the longer it runs. Nothing broke. The window filled up with abandoned plans, old versions of files, and three corrections you made two hours ago, and the answer now averages over all of it. You cannot fix that by asking nicely. You fix it by controlling what is in the window.
Copy these prompts
Paste them into Claude Code, Cursor, or any assistant that can see your project. Run them in this order when answers start drifting. The first one is usually enough to show you the problem.
1. Make it show you what it is holding
Before answering anything else, summarise the current state of this conversation.
List: what you believe the task is, which files you have actually read in this
session, the decisions we have made, the approaches we tried and dropped, and
anything you are unsure about. Mark anything you are inferring rather than
something I told you directly.
2. Save the part worth keeping
Write a session log I can hand to a fresh session. Include: what we were doing,
what is now working, what is still broken, the decisions we made and why, the
approaches we rejected and why, and the exact next step. Keep it under one page.
Leave out everything we abandoned unless knowing we abandoned it changes the
next decision.
3. Start clean and point at the log
Read the session log I am pasting below, then read the files it names, and
nothing else yet. Tell me what you understand the current state to be and what
you would do first. Do not start editing until I confirm.
What actually goes in the window
People picture a chat as a conversation. It is closer to a document that keeps growing, and the model reads the whole document every single turn. Four things are usually in it:
- The standing instructions. Your system prompt, your project rules file, whatever the tool injects on every turn. This is always there and always costs space.
- Everything it has read. Files it opened, pages it fetched, search results. A single large file can take more room than an hour of talking.
- The transcript. Every message from you and every reply from it, including the long ones you skimmed and the plan you rejected.
- Tool output. Command output, test runs, stack traces, logs. This is the quiet one. A verbose test run can be larger than everything else combined.
The window has a fixed size. When you get near the end, something has to give: your tool either drops the oldest parts, compacts them into a summary, or starts refusing. All three lose detail, and none of them ask you which detail mattered.
Why more context makes answers worse, not better
The failure is not that it forgets. It is that it remembers the wrong things with equal weight.
- Dead ends stay. You tried an approach, it did not work, you moved on. The model still sees the attempt and part of its attention is still on it.
- Stale versions stay. It read a file forty minutes ago. You have edited that file since. It is still reasoning about the old copy unless it reads it again.
- Corrections add, they do not subtract. "Ignore that" is one more instruction in the pile, sitting right next to the thing you told it to ignore.
- Contradictions get averaged. Two conflicting plans in one window produce a hedged answer that half follows both.
The symptoms are recognisable once you know the cause: it re-suggests something you already rejected, it describes your code the way it used to be, replies get longer and more qualified, and you find yourself explaining the same decision for the third time.
Steal this for your app
If you are building anything that talks to a model, the same rule applies to what you send it.
- Send the current state, not the history. A short accurate description of how things are now beats a long transcript of how they got that way.
- Summarise on a schedule, not at the limit. Compacting because you ran out of room means the tool chooses what to drop. Compacting on purpose means you choose.
- Keep tool output on a leash. Truncate logs and test output before they go in. Send the failing part, not the whole run.
- Re-read files instead of trusting old copies. Cheaper than an answer built on a version that no longer exists.
- Make the window inspectable. If you cannot see what you sent, you cannot debug the reply.
Run this on your codebase
Use this when your own app or agent starts producing answers that drift:
Review how this project builds the input it sends to the model. Do not change
any files.
1. List every source that gets added: instructions, files, message history,
tool or command output, retrieved documents.
2. Estimate the rough size of each one on a typical request, and name the
largest.
3. Identify anything sent every single turn that only needed to be sent once.
4. Identify anything stale: content captured earlier that may no longer match
the current state.
5. Show what happens when the window fills up, and who decides what is dropped.
6. Separate what you verified in the code from what you assumed.
Finish with the single smallest change that would cut the most wasted space,
and how I would measure whether answers improved.