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

claude-code / plugins / learning-output-style / README.md
93 lines · 4.6 KBPreviewCodeRaw
1# Learning Style Plugin
2
3This plugin combines the unshipped Learning output style with explanatory functionality as a SessionStart hook.
4
5**Note:** This plugin differs from the original unshipped Learning output style by also incorporating all functionality from the [explanatory-output-style plugin](https://github.com/anthropics/claude-code/tree/main/plugins/explanatory-output-style), providing both interactive learning and educational insights.
6
7WARNING: Do not install this plugin unless you are fine with incurring the token cost of this plugin's additional instructions and the interactive nature of learning mode.
8
9## What it does
10
11When enabled, this plugin automatically adds instructions at the start of each session that encourage Claude to:
12
131. **Learning Mode:** Engage you in active learning by requesting meaningful code contributions at decision points
142. **Explanatory Mode:** Provide educational insights about implementation choices and codebase patterns
15
16Instead of implementing everything automatically, Claude will:
17
181. Identify opportunities where you can write 5-10 lines of meaningful code
192. Focus on business logic and design choices where your input truly matters
203. Prepare the context and location for your contribution
214. Explain trade-offs and guide your implementation
225. Provide educational insights before and after writing code
23
24## How it works
25
26The plugin uses a SessionStart hook to inject additional context into every session. This context instructs Claude to adopt an interactive teaching approach where you actively participate in writing key parts of the code.
27
28## When Claude requests contributions
29
30Claude will ask you to write code for:
31- Business logic with multiple valid approaches
32- Error handling strategies
33- Algorithm implementation choices
34- Data structure decisions
35- User experience decisions
36- Design patterns and architecture choices
37
38## When Claude won't request contributions
39
40Claude will implement directly:
41- Boilerplate or repetitive code
42- Obvious implementations with no meaningful choices
43- Configuration or setup code
44- Simple CRUD operations
45
46## Example interaction
47
48**Claude:** I've set up the authentication middleware. The session timeout behavior is a security vs. UX trade-off - should sessions auto-extend on activity, or have a hard timeout?
49
50In `auth/middleware.ts`, implement the `handleSessionTimeout()` function to define the timeout behavior.
51
52Consider: auto-extending improves UX but may leave sessions open longer; hard timeouts are more secure but might frustrate active users.
53
54**You:** [Write 5-10 lines implementing your preferred approach]
55
56## Educational insights
57
58In addition to interactive learning, Claude will provide educational insights about implementation choices using this format:
59
60```
61`★ Insight ─────────────────────────────────────`
62[2-3 key educational points about the codebase or implementation]
63`─────────────────────────────────────────────────`
64```
65
66These insights focus on:
67- Specific implementation choices for your codebase
68- Patterns and conventions in your code
69- Trade-offs and design decisions
70- Codebase-specific details rather than general programming concepts
71
72## Usage
73
74Once installed, the plugin activates automatically at the start of every session. No additional configuration is needed.
75
76## Migration from Output Styles
77
78This plugin combines the unshipped "Learning" output style with the deprecated "Explanatory" output style. It provides an interactive learning experience where you actively contribute code at meaningful decision points, while also receiving educational insights about implementation choices.
79
80If you previously used the explanatory-output-style plugin, this learning plugin includes all of that functionality plus interactive learning features.
81
82This SessionStart hook pattern is roughly equivalent to CLAUDE.md, but it is more flexible and allows for distribution through plugins.
83
84## Managing changes
85
86- Disable the plugin - keep the code installed on your device
87- Uninstall the plugin - remove the code from your device
88- Update the plugin - create a local copy of this plugin to personalize it
89 - Hint: Ask Claude to read https://docs.claude.com/en/docs/claude-code/plugins.md and set it up for you!
90
91## Philosophy
92
93Learning by doing is more effective than passive observation. This plugin transforms your interaction with Claude from "watch and learn" to "build and understand," ensuring you develop practical skills through hands-on coding of meaningful logic.