explanatory-output-style — Claude Code plugin: explains the code
Adds short notes to every session about why the code looks the way it does and which patterns your project follows.
/plugin install explanatory-output-style@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-officialWhat explanatory-output-style does
The plugin brings back the retired Explanatory output style, this time as a SessionStart hook. When a session starts, the hook injects instructions telling Claude to offer two or three brief educational points before and after writing code. They show up in a framed block marked with a star.
The notes stick to your codebase: implementation choices, conventions, design trade-offs. No generic programming lectures. Nothing to configure after install — it activates on its own at the start of every session.
What to weigh first: those extra instructions and output cost tokens. The author says plainly not to install it unless you accept that. One more thing worth knowing — output styles that cover work beyond software development fit better as subagents, since a subagent changes the system prompt while a SessionStart hook only adds to it.
What it helps with
- see why a given approach was chosen in the project
- get oriented in conventions of an unfamiliar codebase
- read explanations while coding instead of waiting for review
- restore the retired Explanatory output style
- learn from decisions made inside your own project
Example prompts for the agent
- explain why this pattern was picked here
- add insights as you edit this module
- walk me through the trade-offs of this approach in our code
How to install explanatory-output-style
Plugin marketplace
/plugin install explanatory-output-style@claude-plugins-official/plugin marketplace add anthropics/claude-plugins-officialStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about explanatory-output-style
How do I install explanatory-output-style in Claude?
Add the marketplace first: /plugin marketplace add anthropics/claude-plugins-official, then install the plugin: /plugin install explanatory-output-style@claude-plugins-official.
What does explanatory-output-style do?
A SessionStart hook injects instructions at the start of each session, so Claude adds brief educational notes about implementation choices and codebase patterns.
How is it different from the Explanatory output style?
That output style is deprecated. The plugin reproduces its behaviour as a SessionStart hook, and hooks can be shipped through plugins.
Source text
explanatory-output-style · Apache-2.0
# Explanatory Output Style Plugin
This plugin recreates the deprecated Explanatory output style as a SessionStart
hook.
WARNING: Do not install this plugin unless you are fine with incurring the token
cost of this plugin's additional instructions and output.
## What it does
When enabled, this plugin automatically adds instructions at the start of each
session that encourage Claude to:
1. Provide educational insights about implementation choices
2. Explain codebase patterns and decisions
3. Balance task completion with learning opportunities
## How it works
The plugin uses a SessionStart hook to inject additional context into every
session. This context instructs Claude to provide brief educational explanations
before and after writing code, formatted as:
```
`★ Insight ─────────────────────────────────────`
[2-3 key educational points]
`─────────────────────────────────────────────────`
```
## Usage
Once installed, the plugin activates automatically at the start of every
session. No additional configuration is needed.
The insights focus on:
- Specific implementation choices for your codebase
- Patterns and conventions in your code
- Trade-offs and design decisions
- Codebase-specific details rather than general programming concepts
## Migration from Output Styles
This plugin replaces the deprecated "Explanatory" output style setting. If you
previously used:
```json
{
"outputStyle": "Explanatory"
}
```
You can now achieve the same behavior by installing this plugin instead.
More generally, this SessionStart hook pattern is roughly equivalent to
CLAUDE.md, but it is more flexible and allows for distribution through plugins.
Note: Output styles that involve tasks besides software development, are better
expressed as
[subagents](https://docs.claude.com/en/docs/claude-code/sub-agents), not as
SessionStart hooks. Subagents change the system prompt while SessionStart hooks
add to the default system prompt.
## Managing changes
- Disable the plugin - keep the code installed on your device
- Uninstall the plugin - remove the code from your device
- Update the plugin - create a local copy of this plugin to personalize this
plugin
- Hint: Ask Claude to read
https://docs.claude.com/en/docs/claude-code/plugins.md and set it up for
you!
© Anthropic · Apache-2.0 · anthropics/claude-plugins-official