做产品 PMaker
空格的键盘
全都塞进去
■ 整个仓库的文件 50%
■ 三十轮历史对话 30%
■ 这次真正要用的 10%
关键约束埋在中间,最容易被忽略
按预算分配
■ 项目约束 20%
■ 这个模块的规格 20%
■ 相关的两三个文件 30%
■ 留白 30%
留出余量给它推理和输出

上下文是有限的注意力,不是仓库。塞得越满,每一条被认真对待的概率越低。

Context Budget

Treat context as a finite budget to allocate. Every piece of irrelevant content you add takes some attention away from the parts that matter.

What you will run into
  • 把整个项目丢给它之后,回答反而变含糊了
  • 聊得越久,它越容易违反前面定好的规则
  • 贴了一大段报错日志,它抓错了重点

What to Give

给什么占比说明
项目约束少量精简的规矩,长期有效。放在最前面
当前模块的规格少量数据结构、状态、边界。这一块最值得占位置
直接相关的文件中等指名要改的那两三个,加上它们依赖的接口定义
这一次的指令少量放在最后。关键约束在这里重申一遍
留白三成左右给它推理和输出用。填满了它就没有余地了
Before reopening a session, have it summarize this round's conclusions into text that can be pasted into a file. That way reopening doesn't mean starting from zero.
把上下文当成有限的预算来分配 项目约束 模块规格 直接相关的那几个文件 这次的指令 留白 约三成 留白是给它推理和输出用的——填满了它就没有余地了。 关键约束值得说两遍 约束 约束 中间这一段最容易被忽略 一遍写在开头的项目规则里,一遍在这条指令里重申——这是针对「中段被忽略」的直接对策。 这四样别给 整个仓库 完整报错日志 上个话题的历史 大段示例数据 有个简单的自查:如果你自己都不确定某段内容这次用不用得上,那多半就不该给。
Before reopening a session, have it summarize this round's conclusions into text that can be pasted into a file. That way reopening doesn't mean starting from zero.

What Not to Give

A simple self-check: if you yourself aren't sure whether a piece of content is needed this time, it probably shouldn't be given.

When to Clear and Start Over

信号该做什么
开始违反前面定好的规则把关键决定写进文件,然后开新会话
它开始重复之前说过的话说明有效信息被稀释了,重开
换了一个不相关的任务直接开新会话,不要接着聊
连续三轮都没改对停下。多半是描述有问题,重新写清楚再开一轮
Before reopening a session, have it summarize this round's conclusions into text that can be pasted into a file. That way reopening doesn't mean starting from zero.

There's also a structural move: organize the codebase by feature. Making a login-related change only requires reading the auth directory, instead of pulling a few files from each layer — saving a lot of context. This choice costs almost nothing at project start, and is expensive to retrofit later.