What this read moved
1–4 of 4claude-directory Changed · +3 / -3 lines
from line 318
318318 icon: 'folder',
319319 color: '#5AA7A7',
320320 oneLiner: 'Project-scoped output styles, if your team shares any',
321 when: 'Applied at session start when selected via the outputStyle setting',
321 when: 'Files read at startup; the style you select with outputStyle is added to the system prompt every turn',
322322 description: <>Output styles are usually personal, so most live in <C>~/.claude/output-styles/</C>. Put one here if your team shares a style, like a review mode everyone uses. See <A href="#ce-global-output-styles">the Global tab</A> for the full explanation and example.</>,
323323 docsLink: '/en/output-styles',
324324 children: []
from line 635
635635 icon: 'folder',
636636 color: '#5AA7A7',
637637 oneLiner: 'Custom system-prompt sections that adjust how Claude works',
638 when: 'Applied at session start when selected via the outputStyle setting',
638 when: 'Files read at startup; the style you select with outputStyle is added to the system prompt every turn',
639639 description: [<>Each markdown file defines an output style: a section appended to the system prompt that, by default, also drops the built-in software-engineering task instructions. Use this to adapt Claude Code for uses beyond coding, or to add teaching or review modes.</>, <>Select a built-in or custom style with <C>/config</C> or the <C>outputStyle</C> key in settings. Styles here are available in every project; project-level styles with the same name take precedence.</>],
640 tips: ['Built-in styles Default, Proactive, Concise, Explanatory, and Learning are included with Claude Code; custom styles go here', <>Set <C>keep-coding-instructions: true</C> in frontmatter to keep the default task instructions alongside your additions</>, 'Changes take effect on the next session since the system prompt is fixed at startup for caching'],
640 tips: ['Built-in styles Default, Proactive, Concise, Explanatory, and Learning are included with Claude Code; custom styles go here', <>Set <C>keep-coding-instructions: true</C> in frontmatter to keep the default task instructions alongside your additions</>, 'Switching styles mid-session applies from your next message and rebuilds the prompt cache once; in the terminal, a style file you create or edit mid-session is picked up after a restart'],
641641 docsLink: '/en/output-styles',
642642 children: [{
643643 id: 'output-style-example',
prompt-caching Changed · +15 / -13 lines
from line 18
1818
1919To get the most out of prefix matching, Claude Code orders each request so content that rarely changes between turns comes first:
2020
21| Layer | Content | Changes when |
22| --------------- | ------------------------------------------------- | ---------------------------------------------------------------------- |
23| System prompt | Core instructions, tool definitions, output style | The set of loaded tool definitions changes, or Claude Code is upgraded |
24| Project context | CLAUDE.md, auto memory, unscoped rules | Session starts, or after `/clear` or `/compact` |
25| Conversation | Your messages, Claude's responses, tool results | Every turn |
21| Layer | Content | Changes when |
22| --------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
23| System prompt | Core instructions, tool definitions, output style | The set of loaded tool definitions changes, you switch output style, or Claude Code is upgraded |
24| Project context | CLAUDE.md, auto memory, unscoped rules | Session starts, or after `/clear` or `/compact` |
25| Conversation | Your messages, Claude's responses, tool results | Every turn |
2626
27A change to the conversation layer leaves the system prompt and project context cached. A change to the system prompt invalidates everything, because all later content now sits behind a different prefix. The third column gives common triggers rather than an exhaustive list, and the sections below cover the full set, including content such as output style that is fixed at session start.
27A change to the conversation layer leaves the system prompt and project context cached. A change to the system prompt invalidates everything, because all later content now sits behind a different prefix. The third column gives common triggers rather than an exhaustive list, and the sections below cover the full set.
2828
2929The prefix-match rule explains most of the behaviors on this page. [Plan mode](/docs/en/permission-modes#analyze-before-you-edit-with-plan-mode) and [skill loading](/docs/en/skills), for example, append their instructions as conversation messages, so the cached prefix stays intact.
3030
from line 68
6868* [Connecting or disconnecting an MCP server](#connecting-or-disconnecting-an-mcp-server)
6969* [Enabling or disabling a plugin](#enabling-or-disabling-a-plugin)
7070* [Denying an entire tool](#denying-an-entire-tool)
71* [Changing output style](#changing-output-style)
7172* [Compacting the conversation](#compacting-the-conversation)
7273* [Accumulating many images](#accumulating-many-images)
7374* [Upgrading Claude Code](#upgrading-claude-code)
from line 151
150151
151152Only a deny rule that matches in the tool-name position has this effect: a bare tool name, the equivalent `Bash(*)` form, or a [tool-name glob](/docs/en/permissions#tool-name-wildcards) like `"*"`. A glob that matches only MCP tools, such as `"mcp__*"`, removes those tools the same way but leaves the cache intact when the matched tools are [deferred](#connecting-or-disconnecting-an-mcp-server), the default, since deferred definitions were never in the cached prefix. Scoped deny rules like `Bash(rm *)`, and all allow and ask rules, don't change which tools Claude sees. Claude Code checks them when Claude attempts a call, leaving the prefix intact.
152153
154### Changing output style
155
156[Output style](/docs/en/output-styles) is part of the system prompt. When you switch styles mid-session with `/config` or the `outputStyle` setting, Claude uses the new style starting with your next message, and that request reads the entire conversation history with no cache hits. To keep that cost small, switch styles before your first message in a session or right after `/clear` or `/compact`, when there is little or no conversation history to re-read.
157
158Before v2.1.251, a mid-session style switch kept the cache but didn't apply until you ran `/clear` or started a new session.
159
153160### Compacting the conversation
154161
155162[Compaction](/docs/en/context-window#what-survives-compaction) replaces your message history with a summary. By design, this invalidates the conversation layer, since the next request has a new, shorter history that doesn't share a prefix with the old one. Claude Code reuses the system prompt layer and reloads project context from disk, which cache-hits only if CLAUDE.md and memory are unchanged since the session started.
from line 187
180187
181188## Actions that keep the cache
182189
183These actions either append to the end of the conversation or don't touch the request at all. Some of them, such as editing CLAUDE.md or changing output style, are also why a setting change waits for a restart to apply.
190These actions either append to the end of the conversation or don't touch the request at all. Some of them, such as editing CLAUDE.md, keep the cache for the same reason the change doesn't reach the running session until `/clear`, `/compact`, or a restart.
184191
185192* [Editing files in your repository](#editing-files-in-your-repository)
186193* [Editing CLAUDE.md mid-session](#editing-claude-md-mid-session)
187* [Changing output style](#changing-output-style)
188194* [Changing permission mode](#changing-permission-mode)
189195* [Invoking skills and commands](#invoking-skills-and-commands)
190196* [Running `/recap`](#running-%2Frecap)
from line 206
200206Your project-root and user-level CLAUDE.md files are read once at session start and held in memory. Editing them mid-session does not invalidate the cache, but the edit also doesn't apply. Claude keeps working with the version that was loaded at session start. The new content loads on the next `/clear`, `/compact`, or restart.
201207
202208[Nested CLAUDE.md files in subdirectories](/docs/en/memory) and [rules with `paths:` frontmatter](/docs/en/memory#path-specific-rules) load later, when Claude first reads a matching file. Editing one before it loads does take effect. After it loads, the content is part of the conversation history, so a mid-session edit doesn't retroactively change it.
203
204### Changing output style
205
206[Output style](/docs/en/output-styles) is part of the system prompt, which Claude Code reads once at session start. Changing it via `/config` or the `outputStyle` setting mid-session does not invalidate the cache, but the change also doesn't apply. Claude keeps using the style that was loaded at session start. The new style loads on the next `/clear` or restart.
207209
208210### Changing permission mode
209211
output-styles Changed · +2 / -2 lines
from line 40
4040}
4141```
4242
43Output style is part of the system prompt, which Claude Code reads once at session start. Changes take effect after `/clear` or a new session. See [How Claude Code uses prompt caching](/docs/en/prompt-caching#changing-output-style) for what an output style change does to the cache.
43When you switch styles mid-session, Claude uses the new style starting with your next message. The style is part of the system prompt, so that first message rebuilds the [prompt cache](/docs/en/prompt-caching#changing-output-style) once. Before v2.1.251, the new style applied only after you ran `/clear` or started a new session.
4444
4545## Create a custom output style
4646
from line 78
7878 </Step>
7979
8080 <Step title="Switch to your style">
81 Run `/config` in the terminal and select your style under **Output style**, or set `outputStyle` in a settings file to the style's name. It takes effect after `/clear` or the next time you start a session.
81 Run `/config` in the terminal and select your style under **Output style**. Claude uses the new style starting with your next message. In the terminal, Claude Code reads style files when it starts, so if you create or edit one during a running session, restart Claude Code to pick up the change.
8282 </Step>
8383</Steps>
8484
settings-reference Changed · +1 / -1 lines
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
from line 1153
11531153
11541154Select an [output style](/docs/en/output-styles) by name. An output style is a saved set of instructions that Claude Code adds to the system prompt to change Claude's role, tone, and output format, such as the built-in Explanatory and Learning styles or one you wrote yourself.
11551155
1156Claude Code builds the style into the system prompt once per conversation. An edit to this key takes effect after you run `/clear` or start a new session.
1156If you change this key during a session, Claude uses the new style starting with your next message. That message rebuilds the [prompt cache](/docs/en/prompt-caching#changing-output-style) once, because the style is part of the system prompt. Before v2.1.251, the edit applied only after you ran `/clear` or started a new session.
11571157
11581158* **Scope**: [`Any file`](#scopes)
11591159* **Type**: string, the name of a [built-in](/docs/en/output-styles#built-in-output-styles) or [custom](/docs/en/output-styles#create-a-custom-output-style) output style
from line 3290
32903290
32913291This example adds two verbs to the built-in set:
32923292
3293```json settings.json theme={null}
3294{
3295 "spinnerVerbs": {
3296 "mode": "append",
3297 "verbs": ["Pondering", "Crafting"]
3298 }
3299}
3300```
3301
3302In `"replace"` mode with an empty `verbs` array, Claude Code kee
3293```json settings.j