# Claude Opus 4.8 支持对话中途修改系统提示词

- 来源：宝玉 (@dotey)
- 发布时间：2026-05-30 00:55
- AIHOT 分数：62
- AIHOT 链接：https://aihot.virxact.com/items/cmpr6gddf0bbxslnoxq4unhmh
- 原文链接：https://x.com/dotey/status/2060404667423596843

## AI 摘要

Anthropic为Claude Opus 4.8新增mid-conversation system messages API功能。该功能允许在对话进行中动态修改系统提示词（System Prompt），且不会影响Prompt Caching。此前，系统提示词只能在对话开头固定设置，开发者有时通过user消息中的特殊标签尝试覆盖。新功能支持插入更高优先级的系统指令以调整Agent行为。此功能目前仅限Claude Opus 4.8及其官方API与AWS上的Claude Platform。

## 正文

Claude Opus 4.8 发布的同时，Anthropic 还上线了一个 API 层面的新能力：mid-conversation system messages（对话中途系统消息）。对于做 Agent 开发的会很有用。

简单来说它就是类似于后续注入的方式修改原始系统提示词（System Prompt），并且不会影响 Prompt Caching。

4.8 之前 Claude 是不能发送类型是 system 的消息，只能支持 user 或者 assistant 消息，system prompt 只能在最前面。

所以 Claude Code 之前是用的一种特殊的消息内容：<system-reminder>，尝试覆盖系统消息指令。

举个例子，你在初始 system message 指定这个 Agent 是一个系统设计师的角色，擅长做系统设计，但是不允许写代码，只写文档。

然后随着任务推进，现在得让这个 Agent 开始写代码了，但你就算通过 user message 去让它可以写代码，因为权重不够高，它还是会倾向于不写代码写文档。

现在有了 mid-conversation system messages，你就可以新加一条指令，明确要求它转变角色变成一个开发工程师，不必再遵守之前不写代码只写文档的约定，并且 mid-conversation system messages 的优先级更高，能覆盖原始 system message 的设定。

这个功能目前只支持 Claude Opus 4.8，只在 Anthropic 自家 API 和 AWS 上的 Claude Platform 可用，Bedrock、Vertex AI、Microsoft Foundry 都不支持。系统消息不能放在对话开头（开头还是用顶层 system 字段），也不能连续放两条，必须跟在 user 消息后面。

对于普通用户，这功能无需关心。

### 引用推文

> Lance Martin：a number of useful tips + tricks for Opus 4.8: 1/ you can now update the system prompt mid-conversation w/o breaking the prompt cache. previously, you had to ad...
