spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

Implement a plugin as alternative for deprecated Explanatory output styleBrowse files
Dickson Tsai authored on Oct 28, 2025 parent 4dc23d0 · commit 10e1d3fe7791
4 changed files+95 -0compared with 4dc23d0
Aplugins/explanatory-output-style/.claude-plugin/plugin.json
Aplugins/explanatory-output-style/README.md
Aplugins/explanatory-output-style/hooks/hooks.json
Aplugins/explanatory-output-style/hooks-handlers/session-start.sh
@@ -1,0 +1,9 @@
1+{
2+ "name": "explanatory-output-style",
3+ "version": "1.0.0",
4+ "description": "Adds educational insights about implementation choices and codebase patterns (mimics the deprecated Explanatory output style)",
5+ "author": {
6+ "name": "Anthropic",
7+ "email": "support@anthropic.com"
8+ }
9+}
@@ -1,0 +1,56 @@
1+# Explanatory Output Style Plugin
2+
3+This plugin recreates the deprecated Explanatory output style as a SessionStart hook.
4+
5+## What it does
6+
7+When enabled, this plugin automatically adds instructions at the start of each session that encourage Claude to:
8+
9+1. Provide educational insights about implementation choices
10+2. Explain codebase patterns and decisions
11+3. Balance task completion with learning opportunities
12+
13+## How it works
14+
15+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:
16+
17+```
18+`★ Insight ─────────────────────────────────────`
19+[2-3 key educational points]
20+`─────────────────────────────────────────────────`
21+```
22+
23+## Installation
24+
25+Install this plugin from the Claude Code marketplace, or manually by placing it in your `.claude/plugins` directory.
26+
27+## Usage
28+
29+Once installed, the plugin activates automatically at the start of every session. No additional configuration is needed.
30+
31+The insights focus on:
32+- Specific implementation choices for your codebase
33+- Patterns and conventions in your code
34+- Trade-offs and design decisions
35+- Codebase-specific details rather than general programming concepts
36+
37+## Migration from Output Styles
38+
39+This plugin replaces the deprecated "Explanatory" output style setting. If you previously used:
40+
41+```json
42+{
43+ "outputStyle": "Explanatory"
44+}
45+```
46+
47+You can now achieve the same behavior by installing this plugin instead.
48+
49+## Managing changes
50+
51+* Disable the plugin - keep the code installed on your device
52+* Uninstall the plugin - remove the code from your device
53+* Update the plugin - create a local copy of this plugin to personalize this plugin
54+ - Hint: Ask Claude to read https://docs.claude.com/en/docs/claude-code/plugins.md and set it up for you!
55+
56+
@@ -1,0 +1,15 @@
1+{
2+ "description": "Explanatory mode hook that adds educational insights instructions",
3+ "hooks": {
4+ "SessionStart": [
5+ {
6+ "hooks": [
7+ {
8+ "type": "command",
9+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh"
10+ }
11+ ]
12+ }
13+ ]
14+ }
15+}
@@ -1,0 +1,15 @@
1+#!/bin/bash
2+
3+# Output the explanatory mode instructions as additionalContext
4+# This mimics the deprecated Explanatory output style
5+
6+cat << 'EOF'
7+{
8+ "hookSpecificOutput": {
9+ "hookEventName": "SessionStart",
10+ "additionalContext": "You are in 'explanatory' output style mode, where you should provide educational insights about the codebase as you help with the user's task.\n\nYou should be clear and educational, providing helpful explanations while remaining focused on the task. Balance educational content with task completion. When providing insights, you may exceed typical length constraints, but remain focused and relevant.\n\n## Insights\nIn order to encourage learning, before and after writing code, always provide brief educational explanations about implementation choices using (with backticks):\n\"`★ Insight ─────────────────────────────────────`\n[2-3 key educational points]\n`─────────────────────────────────────────────────`\"\n\nThese insights should be included in the conversation, not in the codebase. You should generally focus on interesting insights that are specific to the codebase or the code you just wrote, rather than general programming concepts. Do not wait until the end to provide insights. Provide them as you write code."
11+ }
12+}
13+EOF
14+
15+exit 0