
Output Styles 不是项目记忆,也不是权限模式,而是 Claude Code 的表达层开关。本篇拆解内置 4 种风格、自定义 Markdown 文件结构、keep-coding-instructions、/config 切换、生效时机、缓存成本、插件分发与排障路径。
如果这条指令换一个项目仍然成立,优先放 Output Style;如果它只对当前仓库成立,放 CLAUDE.md。
Proactive:适合你已经明确方向,只想让 Claude 少问常规问题、直接推进。官方说明它会立即执行、做合理假设、偏向行动;它比 auto mode 更强调自主执行,但不会改变 permission mode,所以工具运行前仍会出现权限提示。1Explanatory:适合你想边完成任务边学习代码库。它会在软件工程任务中插入教育性的「Insights」,解释实现选择和代码库模式。1Learning:适合刻意练习。官方定义里,它不仅会给 Insights,还会要求你自己完成一些小而关键的代码片段,并在代码中留下 TODO(human) 标记。1Proactive 和 auto mode。Proactive 改的是 Claude 的行为倾向:少停顿、多推进。auto mode 改的是权限提示流程:减少常规工具调用前的确认。官方 Permission Modes 文档也写到,如果想要更强的自主行为但仍保留权限提示,应设置 Proactive output style,而不是直接把权限模式放松。2Proactive,同时保留 default 或 acceptEdits 这类权限模式。1/config,不是 /output-style/output-style 命令已经废弃并移除:v2.1.73 废弃,v2.1.91 移除。1{
"outputStyle": "Explanatory"
}outputStyle 是 settings 里的配置项,但它和大多数热加载配置不一样。Settings 文档说明,Claude Code 会监听 settings 文件,很多键可以在运行中的 session 里生效;但 outputStyle 属于 system prompt,下一次 /clear 或重启后才会应用。3/config 或 settings 修改不会让当前 session 立刻换风格,新的风格要等 /clear 或重启。4outputStyle,Claude 还在按旧风格说话,不一定是配置没写对。它可能只是当前 session 还没重建 system prompt。/clear 或重启后新风格才进入 system prompt。~/.claude/output-styles1.claude/output-styles1.claude/output-styles1.claude/output-styles/ 加载项目风格;如果多个嵌套目录定义了同名风格,离当前工作目录最近的那个生效。1---
name: Diagrams first
keep-coding-instructions: true
---
When explaining code, architecture, or data flow, start with a Mermaid diagram.
## Diagram rules {#diagram-rules}
- Use `flowchart TD` for control flow.
- Use `sequenceDiagram` for request paths.
- Keep diagrams under 15 nodes.
- After the diagram, explain the tradeoff in plain language.keep-coding-instructions 是这里最重要的字段。官方说明:如果你只是改变 Claude 的沟通方式,但仍希望它按 Claude Code 的软件工程习惯写代码,就设为 true;如果 Claude 不再做软件工程,比如作为写作助手或数据分析助手,可以不保留。1keep-coding-instructions: true。官方在「How output styles work」里也写到,自定义风格会把内置软件工程指令排除在外。1name:风格名;不写时继承文件名。1description:显示在 /config 选择器里的说明。1keep-coding-instructions:是否保留 Claude Code 内置软件工程指令,默认 false。1force-for-plugin:只用于插件输出风格;插件启用时自动应用该风格,会覆盖用户自己的 outputStyle 设置。1force-for-plugin 更适合插件作者,比如某个教学插件必须让 Claude 始终用课程式风格回答。description。Commands 文档提到,/config 是调整 theme、model、output style 等偏好的入口。5 描述写清楚,队友在菜单里才知道该不该选。--append-system-prompt 的区别--append-system-prompt:在不移除任何默认内容的前提下追加 system prompt,适合一次性调用的临时补充。1长期表达偏好:Output Style
长期项目事实:CLAUDE.md
可复用操作流程:Skill
隔离角色和工具集:Agent
一次性 system prompt 补丁:--append-system-promptoutput-styles/ 目录里携带风格。1 Plugins reference 进一步说明,插件 manifest 里有 outputStyles 字段,可以指向自定义风格文件或目录;该字段会替换默认的 output-styles/ 扫描路径。6/config 或 outputStyle 设置中途修改,当前 session 仍使用启动时加载的风格,新的风格等 /clear 或重启才加载。4Explanatory,进入批量改代码时切回 Default 或 Proactive,避免解释型风格拉长每轮输出。1Explanatory 和 Learning。1/clear 或新 session。官方把它列为 session 启动时读取的 system prompt 部分。4.claude/settings.local.json 写了另一个值,后者会赢。keep-coding-instructions: true 时,自定义风格默认不保留 Claude Code 内置的软件工程指令。1/context 看当前 context window 里有哪些 system prompt、memory files、skills、MCP tools 和消息;再用 /doctor、/status 等命令查设置来源和 schema 问题。7Brief engineer,要求先给结论、命令和风险;一个叫 Teacher mode,要求解释设计取舍。都写 keep-coding-instructions: true,因为保留内置工程指令要显式开启。1force-for-plugin,除非输出协议对插件运行结果有硬依赖。1/clear 写进切换习惯。 每次改完 Output Style 后,直接 /clear 开新任务,别在旧 session 里猜它为什么没变。4docs.anthropic.com
docs.anthropic.com
docs.anthropic.com
docs.anthropic.com
docs.anthropic.com
docs.anthropic.com
docs.anthropic.com
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.