正在打开每日关注
正在打开每日关注
Thariq总结Claude 5如何精简系统提示词、按需加载技能并用测试驱动规格提升编码效果。
Thariq at Anthropic just published the new rules of context engineering for Claude 5 models. the same rules let them cut ~𝟴𝟬% of Claude Code's own system prompt with no measurable loss on their coding evals. tldr: • CLAUDE.md is for gotchas only. delete anything the model learns by looking at the repo, and spend the tokens on what it would trip over • swap hard bans for style descriptions. their old rule was never write comments. the new one is write code that matches the comment density and naming around it • stop writing the same rule in both the system prompt and the tool description. keep only the tool description • split a long skill into several files and load only what the task needs • a spec does not have to be markdown. a test suite, an HTML mockup, or a function in another codebase all work worth more than the next ten skills. read it today, then run /doctor to trim your own CLAUDE.md and skills.
We removed ~80% of the Claude Code system prompt for our newest models, this is what we've learned about writing system prompts, skills and Claude.MDs for them. https://t.co/6DZwSrZjE9
是什么 这是一条对 Anthropic 经验总结的二次转述,核心主题不是增加更多提示词,而是通过上下文工程做减法。据转述,Claude 5 相关模型在减少约 80% Claude Code 系统提示词后,编码评测没有出现可测量损失。
核心设计 其方法可归纳为四步:CLAUDE.md 只保留模型无法从仓库自行推断的陷阱;用周边代码的注释密度和命名习惯替代“绝对禁止”式硬规则;避免系统提示词与工具描述重复表达;把长技能拆成多个文件,按任务需要加载。更进一步,规格不必局限于 Markdown,测试套件、HTML 模拟稿或另一代码库中的函数同样可以承担规范作用。
关键洞察 高质量 Agent 指令的价值在于补充不确定性、减少决策歧义,而不是复述环境中已经存在的信息。把可执行资产作为规格,还能让约束更接近验证环节,降低提示词维护成本。
边界与风险 这是针对 Claude Code 与特定新模型的经验转述,不能直接证明所有模型都适用。精简规则前仍需保留安全、隐私、发布流程等仓库无法可靠推断的约束,并通过回归评测验证删除后的行为变化。