Skip to main content
Combines interactive learning with educational insights, encouraging you to write meaningful code at key decision points.
This plugin increases token usage and creates an interactive workflow where you’ll be asked to contribute code. Only enable if you want an active learning experience.

Overview

The Learning Output Style plugin transforms Claude Code from an automation tool into an interactive teaching environment. Instead of implementing everything automatically, Claude identifies opportunities where you can write 5-10 lines of meaningful code.

What It Does

When enabled, Claude will:
1

Identify Learning Opportunities

Find places where you can write meaningful business logic or make design choices
2

Prepare Context

Set up the environment and explain the trade-offs you’ll need to consider
3

Request Your Contribution

Ask you to implement 5-10 lines of code where your input truly matters
4

Provide Educational Insights

Share explanations about implementation choices and patterns

Installation

This plugin is bundled with Claude Code. To enable it:
/plugin enable learning-output-style

When Claude Requests Contributions

You’ll be asked to write code for:
  • Business logic with multiple valid approaches
  • Error handling strategies requiring judgment
  • Algorithm choices affecting performance
  • Data structure decisions
  • User experience trade-offs
  • Design patterns and architecture

When Claude Implements Directly

Claude handles automatically:
  • Boilerplate and repetitive code
  • Obvious implementations with no choices
  • Configuration and setup
  • Simple CRUD operations

Example Interaction

Scenario: Building an Authentication System

Claude:
★ Insight ─────────────────────────────────────
• Session management has a security vs. UX trade-off
• Auto-extending sessions improve user experience but may
  leave sessions open longer
• Hard timeouts are more secure but might frustrate users
─────────────────────────────────────────────────

I've set up the authentication middleware structure in
auth/middleware.ts. Now you need to decide on session
timeout behavior.

In auth/middleware.ts, implement handleSessionTimeout():

Consider these approaches:
1. Auto-extend: Reset timeout on each request
2. Hard timeout: Fixed expiry from creation
3. Hybrid: Extend up to max lifetime

Which approach fits your security requirements?
Implement your chosen strategy in 5-10 lines.
You write:
function handleSessionTimeout(session: Session): boolean {
  const now = Date.now();
  const maxLifetime = 7 * 24 * 60 * 60 * 1000; // 7 days
  const idleTimeout = 30 * 60 * 1000; // 30 minutes
  
  // Hybrid approach: extend up to max lifetime
  if (now - session.created > maxLifetime) return false;
  if (now - session.lastActivity > idleTimeout) return false;
  
  session.lastActivity = now;
  return true;
}
Claude:
★ Insight ─────────────────────────────────────
• Your hybrid approach balances security and UX well
• The 7-day max lifetime prevents indefinite sessions
• 30-minute idle timeout catches abandoned sessions
• Updating lastActivity on each request completes the loop
─────────────────────────────────────────────────

Great implementation! Let me add the tests and
integration with your auth flow...

Educational Insights Format

In addition to interactive prompts, you’ll see insights using this format:
★ Insight ─────────────────────────────────────
[2-3 key educational points about the codebase]
─────────────────────────────────────────────────
These insights focus on:
  • Codebase-specific patterns
  • Implementation trade-offs
  • Why certain approaches were chosen
  • Design decisions and conventions

Philosophy

Learning by doing is more effective than passive observation. This plugin ensures you:
  • Develop practical skills through hands-on coding
  • Make meaningful design decisions
  • Understand trade-offs in real contexts
  • Build muscle memory for common patterns

Comparison: Explanatory vs Learning

Interactive + Educational
  • You write 5-10 lines at decision points
  • Claude explains trade-offs before you code
  • Active learning through contribution
  • Educational insights included
Best for: Learning while building

Migration from Output Styles

This plugin combines the unshipped “Learning” output style with the deprecated “Explanatory” output style.

Before (deprecated)

{
  "outputStyle": "Explanatory"
}

After (current)

# For interactive learning:
/plugin enable learning-output-style

# For passive insights only:
/plugin enable explanatory-output-style
If you previously used explanatory-output-style, the learning plugin includes all that functionality plus interactive features.

Managing the Plugin

Turn off temporarily:
/plugin disable learning-output-style

Token Usage

Expect higher token usage than explanatory-output-style:
  • ~300 tokens added to system prompt per session
  • ~100-200 tokens per contribution request
  • ~50-150 tokens per insight
For a 20-turn session: ~1,300-2,300 additional tokens

When to Use

Use Learning Style

  • Learning a new codebase
  • Building skills in a framework
  • Making architecture decisions
  • Training on best practices

Use Standard Mode

  • Routine maintenance tasks
  • Repetitive updates
  • Time-sensitive work
  • Well-understood patterns

Details

Name: learning-output-styleType: SessionStart HookAuthor: Boris Cherny ([email protected])Version: 1.0.0Hook File: hooks-handlers/session-start.shIncludes: All functionality from explanatory-output-style

Explanatory Style

Educational insights without interaction

Hook Development

Build your own SessionStart hooks

Build docs developers (and LLMs) love