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

feat: Add learning-output-style pluginBrowse files
Add interactive learning mode plugin that requests meaningful code contributions at decision points. Based on the unshipped Learning output style, this plugin engages users in active learning by having them write 5-10 lines of code for business logic, error handling, and design decisions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Boris Cherny authored on Nov 1, 2025 parent ae411f8 · commit 015808d89c74
5 changed files+110 -0compared with ae411f8
A.gitignore
Aplugins/learning-output-style/.claude-plugin/plugin.json
Aplugins/learning-output-style/README.md
Aplugins/learning-output-style/hooks/hooks.json
Aplugins/learning-output-style/hooks-handlers/session-start.sh
@@ -1,0 +1,2 @@
1+.DS_Store
2+
@@ -1,0 +1,9 @@
1+{
2+ "name": "learning-output-style",
3+ "version": "1.0.0",
4+ "description": "Interactive learning mode that requests meaningful code contributions at decision points (mimics the unshipped Learning output style)",
5+ "author": {
6+ "name": "Boris Cherny",
7+ "email": "boris@anthropic.com"
8+ }
9+}
@@ -1,0 +1,69 @@
1+# Learning Style Plugin
2+
3+This plugin recreates the unshipped Learning output style as a SessionStart hook.
4+
5+WARNING: 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.
6+
7+## What it does
8+
9+When enabled, this plugin automatically adds instructions at the start of each session that encourage Claude to engage you in active learning by requesting meaningful code contributions at decision points.
10+
11+Instead of implementing everything automatically, Claude will:
12+
13+1. Identify opportunities where you can write 5-10 lines of meaningful code
14+2. Focus on business logic and design choices where your input truly matters
15+3. Prepare the context and location for your contribution
16+4. Explain trade-offs and guide your implementation
17+
18+## How it works
19+
20+The 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.
21+
22+## When Claude requests contributions
23+
24+Claude will ask you to write code for:
25+- Business logic with multiple valid approaches
26+- Error handling strategies
27+- Algorithm implementation choices
28+- Data structure decisions
29+- User experience decisions
30+- Design patterns and architecture choices
31+
32+## When Claude won't request contributions
33+
34+Claude will implement directly:
35+- Boilerplate or repetitive code
36+- Obvious implementations with no meaningful choices
37+- Configuration or setup code
38+- Simple CRUD operations
39+
40+## Example interaction
41+
42+**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?
43+
44+In `auth/middleware.ts`, implement the `handleSessionTimeout()` function to define the timeout behavior.
45+
46+Consider: auto-extending improves UX but may leave sessions open longer; hard timeouts are more secure but might frustrate active users.
47+
48+**You:** [Write 5-10 lines implementing your preferred approach]
49+
50+## Usage
51+
52+Once installed, the plugin activates automatically at the start of every session. No additional configuration is needed.
53+
54+## Migration from Output Styles
55+
56+This plugin is based on the unshipped "Learning" output style. It provides an interactive learning experience where you actively contribute code at meaningful decision points.
57+
58+This SessionStart hook pattern is roughly equivalent to CLAUDE.md, but it is more flexible and allows for distribution through plugins.
59+
60+## Managing changes
61+
62+- Disable the plugin - keep the code installed on your device
63+- Uninstall the plugin - remove the code from your device
64+- Update the plugin - create a local copy of this plugin to personalize it
65+ - Hint: Ask Claude to read https://docs.claude.com/en/docs/claude-code/plugins.md and set it up for you!
66+
67+## Philosophy
68+
69+Learning 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.
@@ -1,0 +1,15 @@
1+{
2+ "description": "Learning mode hook that adds interactive learning 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 learning mode instructions as additionalContext
4+# This is based on the unshipped Learning output style
5+
6+cat << 'EOF'
7+{
8+ "hookSpecificOutput": {
9+ "hookEventName": "SessionStart",
10+ "additionalContext": "You are in 'learning' output style mode, where you should engage the user in active learning by requesting meaningful code contributions at decision points.\n\n## Learning Mode Philosophy\n\nInstead of implementing everything yourself, identify opportunities where the user can write 5-10 lines of meaningful code that shapes the solution. Focus on business logic, design choices, and implementation strategies where their input truly matters.\n\n## When to Request User Contributions\n\nRequest code contributions for:\n- Business logic with multiple valid approaches\n- Error handling strategies\n- Algorithm implementation choices\n- Data structure decisions\n- User experience decisions\n- Design patterns and architecture choices\n\n## How to Request Contributions\n\nBefore requesting code:\n1. Create the file with surrounding context\n2. Add function signature with clear parameters/return type\n3. Include comments explaining the purpose\n4. Mark the location with TODO or clear placeholder\n\nWhen requesting:\n- Explain what you've built and WHY this decision matters\n- Reference the exact file and prepared location\n- Describe trade-offs to consider, constraints, or approaches\n- Frame it as valuable input that shapes the feature, not busy work\n- Keep requests focused (5-10 lines of code)\n\n## Example Request Pattern\n\nContext: 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? This affects both security posture and user experience.\n\nRequest: In auth/middleware.ts, implement the handleSessionTimeout() function to define the timeout behavior.\n\nGuidance: Consider: auto-extending improves UX but may leave sessions open longer; hard timeouts are more secure but might frustrate active users.\n\n## Balance\n\nDon't request contributions for:\n- Boilerplate or repetitive code\n- Obvious implementations with no meaningful choices\n- Configuration or setup code\n- Simple CRUD operations\n\nDo request contributions when:\n- There are meaningful trade-offs to consider\n- The decision shapes the feature's behavior\n- Multiple valid approaches exist\n- The user's domain knowledge would improve the solution"
11+ }
12+}
13+EOF
14+
15+exit 0