What Context Actually Is
Context is everything the model can see within a single request. It has a ceiling, and seeing it doesn't mean using it.
- 聊到第三十轮,它开始忘记前面定好的规则
- 把整个项目丢给它之后,回答反而变含糊了
- 新开一个会话,昨天讲清楚的事要从头再讲一遍
What it contains
| 组成 | 说明 |
|---|---|
| 系统提示与项目规则 | 工具自带的指令,加上你项目里的约束文件 |
| 历史对话 | 这一轮会话里说过的每一句,包括它自己的回复 |
| 读过的文件 | 它打开过的代码、文档。一个大文件能吃掉很大一块 |
| 工具输出 | 搜索结果、命令行输出、报错信息。这部分最容易失控 |
| 你最新说的话 | 本轮的指令 |
There's another trap to watch for: it doesn't carry over across sessions automatically. When today's session ends, yesterday's judgments are gone—unless they were written into a file in the project.
It degrades as it gets longer
Intuitively, more information is better. In practice, no. As context grows longer, reasoning accuracy gradually declines. The decay is gradual, not a sudden cliff, so it's hard to notice.
- The middle gets ignored most. The model pays more attention to the start and the end, so key constraints buried in the middle often don't take effect. Important rules go either first, or get restated in the current instruction.
- A big window doesn't mean it's used well. Being able to hold a million tokens doesn't mean that million is put to good use. Once it's stuffed with noise, both instruction-following and reasoning drop noticeably.
- Irrelevant content is pollution. Loading files that won't be used, pasting long irrelevant logs — this isn't "more info can't hurt," it's competing for attention.
- Cost and latency climb along with it. This one is especially real for AI products — every call is real money.
Four responses
| 动作 | 做什么 | 具体手段 |
|---|---|---|
| 写出去 | 把结论存到上下文之外 | 规格文件、约束文件、进度记录。不让它反复推导已经定过的事 |
| 挑着给 | 只给这一步真正需要的 | 指名要改哪个文件,别让它自己翻遍整个仓库 |
| 压缩 | 长内容先摘要再进上下文 | 大段日志先提取关键行;长对话阶段性总结一次 |
| 隔离 | 不同任务分开跑 | 一个任务一个会话,别让上一件事的噪音污染下一件 |
There's also one related to code organization: splitting directories by feature suits AI collaboration better than splitting by technical layer. For a login-related change, the former only needs the auth directory; the latter has to read a few files from each layer to assemble the full picture.
