Skip to content

Restore and enhance Claude Code custom output styles using SessionStart hooks and plugin marketplace. Cross-platform (Windows/Mac/Linux). MIT licensed.

License

Notifications You must be signed in to change notification settings

GitHawkAI/claude-code-output-style-migrator

Repository files navigation

Output Style Migrator

Restore your Claude Code output styles. Upgrade your AI collaboration experience.

A universal tool that migrates deprecated Claude Code output styles to the new SessionStart hook system - with a powerful plugin marketplace for discovering, creating, and sharing custom AI communication styles.

License: MIT Platform: Cross-Platform


The Story: Why This Tool Exists

Claude Code recently deprecated built-in output style support. If you relied on specific output formats—whether poetic, minimalist, technical, or custom—you lost an important tool for shaping how your AI collaborator communicates.

Output Style Migrator restores that capability.

Instead of just migrating old styles, we've built something better: a community-driven plugin marketplace where you can:

  • Preserve your favorite styles
  • Discover styles created by other users
  • Create entirely new communication formats
  • Share your creations with the community

This tool lets you reclaim control over your AI collaboration experience.


What This Tool Does

Output Style Migrator bridges the gap between Claude Code's deprecated output styles and the new SessionStart hook system:

  1. Migrates existing styles from old CLAUDE.md configurations
  2. Manages style library via a local plugin marketplace
  3. Installs styles to your global Claude configuration
  4. Activates styles for individual projects
  5. Creates new styles interactively from scratch
  6. Shares styles with the community via GitHub

Before vs After

Before (Deprecated):

# Old CLAUDE.md output-style configuration
output-style: iambic-pentameter

After (SessionStart Hook):

# New project/.claude/hooks/session-start.sh
# Automatically loads your active style on every session

The tool handles all the complexity of the conversion.


Key Features

Plugin Marketplace System

  • Install styles to your local library (~/.claude-styles/)
  • Activate styles for use across projects
  • Apply styles to individual projects via hooks
  • List installed styles with metadata
  • Create new styles interactively

Included Style Templates

Four ready-to-use output styles included:

  • Haiku - Distilled wisdom in 5-7-5 syllable form
  • Iambic Pentameter - Classical verse in ten-syllable lines
  • Shakespearean - 14-line sonnets with elaborate metaphor
  • Minimalist - Extreme clarity through radical reduction

Cross-Platform Support

  • Works on Linux, macOS, and Windows (via WSL)
  • Automatic path detection across platforms
  • Environment variable overrides for custom locations
  • Git Bash compatibility on Windows

Style Creation & Customization

  • Interactive wizard for creating new styles
  • Comprehensive template system
  • Export styles for sharing
  • Community-driven development

Integration with Claude Code

  • Seamless hook generation
  • Works with existing Claude Code project structure
  • Backwards compatible with standard configurations

Installation

Prerequisites

  • Claude Code 3.1+ installed on your system
  • Python 3.8+ for running the migrator script
  • Bash shell (required by Claude Code anyway)

Quick Setup

  1. Clone or download this repository:
git clone https://github.com/claude-code/output-style-migrator
cd output-style-migrator
  1. Initialize your style library (one-time setup):
python3 -m output_style_migrator init

This creates the directory structure:

~/.claude-styles/
├── library/          # Installed styles
├── active/           # Currently active style
└── config.json       # Marketplace configuration
  1. Verify installation:
python3 -m output_style_migrator list

You should see the included styles available in the library.


Quick Start Guide

Step 1: Install a Pre-Built Style

Install one of the four included styles:

python3 -m output_style_migrator install haiku

Output:

✓ Installed haiku v1.0.0 to ~/.claude-styles/library/haiku/

Step 2: Activate the Style

Set it as your active style:

python3 -m output_style_migrator activate haiku

Output:

✓ Activated haiku as your active style
✓ Path: ~/.claude-styles/active/current-style

Step 3: Apply to a Project

Navigate to your Claude Code project and apply the active style:

cd /path/to/your/project
python3 -m output_style_migrator apply

Output:

✓ Applied haiku style to this project
✓ Created: .claude/hooks/session-start.sh
✓ Your Claude Code sessions will now use the haiku style

Step 4: Start Your Next Session

When you launch Claude Code in this project, the style automatically activates:

claude
# The session-start.sh hook loads your style automatically

That's it! From now on, your Claude Code sessions in this project will use the Haiku output style.


Plugin Marketplace Usage

Installing Styles

Install from local templates:

python3 -m output_style_migrator install haiku
python3 -m output_style_migrator install minimalist
python3 -m output_style_migrator install shakespearean

Install from a file:

python3 -m output_style_migrator install ./my-custom-style/

Install from GitHub (future feature):

python3 -m output_style_migrator install user/style-repo

Listing Installed Styles

See all styles in your library:

python3 -m output_style_migrator list

Output:

Available Styles:
=================

1. Haiku (v1.0.0)
   Author: Output Style Migrator
   Category: poetry
   Keywords: haiku, minimalist, poetry, japanese, 5-7-5
   Location: ~/.claude-styles/library/haiku/

2. Minimalist (v1.0.0)
   Author: Output Style Migrator
   Category: technical
   Keywords: minimalist, clarity, technical, documentation
   Location: ~/.claude-styles/library/minimalist/

3. Iambic Pentameter (v1.0.0)
   Author: Output Style Migrator
   Category: poetry
   Keywords: verse, poetry, iambic, rhythmic
   Location: ~/.claude-styles/library/iambic-pentameter/

4. Shakespearean (v1.0.0)
   Author: Output Style Migrator
   Category: poetry
   Keywords: sonnet, iambic, shakespeare, dramatic
   Location: ~/.claude-styles/library/shakespearean/

Activating Styles

Switch which style is active (only one active at a time):

python3 -m output_style_migrator activate iambic-pentameter

Output:

✓ Activated iambic-pentameter as your active style
✓ To apply to a project, run: migrate apply

Applying Styles to Projects

Apply your active style to a project:

cd /path/to/project
python3 -m output_style_migrator apply

This generates:

  • .claude/hooks/session-start.sh - Loads the style on session start
  • .claude/settings.local.json - References the style configuration

You can apply different styles to different projects, or use the same style globally.

Applying Styles Globally

Apply your active style to ALL projects:

python3 -m output_style_migrator apply --global

This sets up hook templates in ~/.claude/hooks/ that all projects can reference.


Creating Custom Styles

Interactive Creation Wizard

Create a new style interactively:

python3 -m output_style_migrator create

The wizard will ask:

What's the name of your style? (e.g., my-style)
> technical-precise

Display name? (Human-readable)
> Technical Precision

Category? (poetry, technical, creative, custom)
> technical

Brief description:
> Direct communication optimizing clarity and precision

What are the core rules of this style? (3+ rules)
> Rule 1: Every sentence must be under 20 words
> Rule 2: Use active voice only
> Rule 3: Define technical terms on first use
> (Type 'done' when finished)

Any example patterns to demonstrate the style?
> Here's an example. Short sentences. High clarity.

Your style has been created!
✓ Location: ~/.claude-styles/library/technical-precise/

Style File Structure

Your created style will have this structure:

~/.claude-styles/library/technical-precise/
├── style.json        # Metadata
└── template.md       # Style instructions

style.json contains metadata:

{
  "name": "technical-precise",
  "displayName": "Technical Precision",
  "version": "1.0.0",
  "author": "Your Name",
  "description": "Direct communication optimizing clarity and precision",
  "category": "technical",
  "keywords": ["technical", "precision", "clarity"],
  "license": "MIT",
  "settings": {
    "maxSentenceLength": 20,
    "forceActiveVoice": true
  }
}

template.md contains the instructions that Claude Code will use:

# Output Style: Technical Precision

**IMPORTANT OUTPUT STYLE INSTRUCTIONS:**

Apply these rules to every response you generate:

## Core Requirements
1. Every sentence must be under 20 words
2. Use active voice exclusively
3. Define technical terms on first use
4. No filler words or hedging language

## Formatting Rules
[Your style-specific formatting rules]

## When to Use This Style
- Technical documentation
- API specifications
- Configuration instructions

## Validation Checklist
- [ ] All sentences under 20 words
- [ ] No passive voice
- [ ] Terms defined
- [ ] No filler words

Creating from Existing Styles

Start with a template and customize it:

cp -r ~/.claude-styles/library/minimalist ~/.claude-styles/library/my-minimalist
cd ~/.claude-styles/library/my-minimalist
# Edit style.json and template.md to customize

Sharing Your Style

Export your style for sharing with others:

python3 -m output_style_migrator export technical-precise

Output:

✓ Exported technical-precise
✓ Archive: technical-precise-1.0.0.tar.gz
✓ Ready to share or publish

Share the .tar.gz file, or submit to the community repository.


Included Style Examples

Haiku

Perfect for concise conclusions and capturing essence:

Distilled wisdom flows
Through three lines of meaning bright
One idea stands pure

Use when you want:

  • Memorable conclusions
  • Summary statements
  • Wisdom moments

Minimalist

Extreme clarity through radical reduction:

No filler. No hedging. Direct answers only.
Each word earns its place. Delete everything unnecessary.
Signal-to-noise ratio optimized.

Use when you want:

  • Technical documentation
  • Instructions
  • Decision communication
  • Status updates

Iambic Pentameter

Classical verse in flowing ten-syllable lines:

The code doth flow with rhythm pure and bright
Through methods clean that dance with measured beat
Each function strikes a balance, wrong and right
Where logic soft and structure gently meet

Use when you want:

  • Elegant status reports
  • Memorable presentations
  • Summary information

Shakespearean

14-line sonnets with elaborate metaphor:

Your data structure stands as fortress strong
With walls of logic, gates of careful thought
Each index placed precisely, right not wrong
With symmetry that careful planning brought
[... continues in sonnet form ...]

Use when you want:

  • Complex theme exploration
  • Emotionally weighted arguments
  • Sophisticated presentations

Troubleshooting

Style Not Applying to Project

Problem: Changed active style but project still uses old one

Solution: Re-apply the style to the project:

cd /path/to/project
python3 -m output_style_migrator apply

This regenerates the hook with the current active style.

Can't Find Style Library Directory

Problem: Getting "Cannot find ~/.claude-styles/" error

Solution: Initialize the library:

python3 -m output_style_migrator init

Alternative: Set custom location via environment variable:

export CLAUDE_HOME=/path/to/custom/location
python3 -m output_style_migrator list

Style Hook Not Executing

Problem: Style isn't loading in Claude Code session

Verify:

  1. Hook file exists: ls -la .claude/hooks/session-start.sh
  2. Hook is executable: chmod +x .claude/hooks/session-start.sh
  3. Hook has correct path: Check path inside the hook file

Debug:

# Test hook execution manually
bash .claude/hooks/session-start.sh --debug

Windows Path Issues

Problem: Paths not working correctly on Windows

Solution: Use forward slashes (work via Git Bash):

# Correct
python3 -m output_style_migrator install ./styles/my-style/

# Also works
python3 -m output_style_migrator install ".\styles\my-style\"

Claude Code uses Git Bash on Windows, which handles forward slashes natively.

Python Module Not Found

Problem: "No module named 'output_style_migrator'"

Solution: Run from project directory or add to PYTHONPATH:

# From project directory
cd /path/to/output-style-migrator
python3 -m output_style_migrator list

# Or add to path
export PYTHONPATH="/path/to/output-style-migrator:$PYTHONPATH"
python3 -m output_style_migrator list

Contributing Guidelines

We welcome contributions! The community's creativity makes this tool powerful.

Ways to Contribute

  1. Create new styles and submit pull requests
  2. Improve existing templates with better instructions
  3. Report bugs and suggest features
  4. Translate styles to other languages
  5. Write documentation and tutorials

Style Contribution Requirements

When submitting a new style:

  1. Follow the file structure:

    templates/your-style-name/
    ├── style.json
    └── template.md
    
  2. Include complete metadata in style.json:

    • name: Unique identifier (lowercase, hyphens)
    • displayName: Human-readable name
    • version: Semantic versioning (1.0.0)
    • author: Your name or handle
    • description: 1-2 sentence description
    • category: poetry, technical, creative, or custom
    • keywords: Array of searchable tags
    • license: "MIT" (for consistency)
  3. Write comprehensive template.md:

    • Overview section (what the style does)
    • Core requirements (non-negotiable rules)
    • Formatting rules (how to apply the style)
    • Content structure (how to organize ideas)
    • Tone and approach guidelines
    • Example patterns demonstrating the style
    • When to use this style
    • Validation checklist for quality assurance
  4. Test your style:

    • Generate 3-5 sample outputs
    • Verify the style produces consistent results
    • Include sample outputs in PR description
  5. Keep it generic:

    • No personal references (names, organizations)
    • Universal enough for any Claude Code user
    • Clear for non-technical users
  6. Use MIT License: All styles must be MIT licensed for community benefit

Submission Process

  1. Fork the repository
  2. Create a feature branch: git checkout -b new-style/poetic-realism
  3. Add your style to templates/ directory
  4. Test thoroughly
  5. Submit pull request with:
    • Style name and description
    • Use cases and examples
    • Any special instructions

Advanced Usage

Global vs Project-Specific Styles

Global style (applies to all projects):

python3 -m output_style_migrator apply --global
  • Stored in ~/.claude/hooks/
  • All projects use same style unless overridden

Project-specific style (applies to one project):

cd /path/to/project
python3 -m output_style_migrator apply
  • Stored in .claude/hooks/ in project
  • Overrides global style
  • Allows different projects different styles

Migrating from Old Output Styles

If you have old CLAUDE.md files with output styles:

python3 -m output_style_migrator migrate /path/to/old/CLAUDE.md

The tool will:

  1. Detect old style configuration
  2. Create a new style plugin from it
  3. Install it to your library
  4. Show you how to apply it

Exporting Styles for Backup

Backup your custom styles:

python3 -m output_style_migrator export --all

Creates timestamped archive of all styles for safe keeping.

Using Multiple Styles in One Project

Future feature - currently only one active style per project. Coming soon:

  • Context-aware style switching
  • Style composition (combine multiple)
  • Per-task style application

Technical Details

Hook Injection System

When you apply a style, the tool generates session-start.sh:

#!/bin/bash
# Auto-generated by Output Style Migrator
# Session start hook - loads output style

STYLE_PATH="$HOME/.claude-styles/active/current-style"
TEMPLATE_PATH="$STYLE_PATH/template.md"

if [ -f "$TEMPLATE_PATH" ]; then
  # Inject style instructions into session
  cat "$TEMPLATE_PATH"
else
  echo "Warning: Style template not found at $TEMPLATE_PATH"
fi

When Claude Code starts a session in your project, this hook automatically loads your style.

File Structure

output-style-migrator/
├── README.md                    # This file
├── LICENSE                      # MIT License
├── ARCHITECTURE.md              # Technical architecture
├── output_style_migrator/       # Main package
│   ├── __init__.py
│   ├── cli.py                   # Command-line interface
│   ├── migrator.py              # Core migration logic
│   └── marketplace.py           # Plugin marketplace
├── utils/
│   └── platform_helper.py       # Cross-platform path detection
├── templates/                   # Pre-built style plugins
│   ├── haiku/
│   │   ├── style.json
│   │   └── template.md
│   ├── minimalist/
│   │   ├── style.json
│   │   └── template.md
│   ├── iambic-pentameter/
│   │   ├── style.json
│   │   └── template.md
│   └── shakespearean/
│       ├── style.json
│       └── template.md
└── tests/                       # Test suite
    └── test_migrator.py

Platform Compatibility

The tool uses Python's pathlib for cross-platform path handling:

Platform Home Dir Style Library Example
Linux $HOME ~/.claude-styles/ /home/user/.claude-styles/
macOS $HOME ~/.claude-styles/ /Users/user/.claude-styles/
Windows %USERPROFILE% %USERPROFILE%\.claude-styles\ C:\Users\user\.claude-styles\

All paths work with forward slashes (/) via Git Bash on Windows.


FAQ

Q: Will this work with my existing Claude Code projects?

A: Yes! Apply the style to existing projects and it works immediately with the hook system.

Q: Can I use multiple styles simultaneously?

A: Currently, one style per project (one global active). Style composition is planned for future releases.

Q: What happens if I delete a style from my library?

A: Projects that use it will stop loading that style. You can always reinstall from the templates directory.

Q: Can I share styles with team members?

A: Yes! Export your style and share the .tar.gz file. They can install it locally.

Q: Will my old CLAUDE.md output style configuration still work?

A: Claude Code's hook system has replaced it, but this tool migrates old configurations to the new system.

Q: Can I use styles from the community GitHub repository?

A: Yes, once published. Currently in beta - styles will be added as the community contributes.

Q: How do I test a style before applying it?

A: The template.md file shows examples. You can also manually run Claude Code with --style flag (feature in development).

Q: What if a style breaks my Claude Code session?

A: Remove the hook: rm .claude/hooks/session-start.sh and restart your session.


Roadmap

v1.0 (Current)

  • ✅ Core migration functionality
  • ✅ Local plugin marketplace
  • ✅ Pre-built style templates (4 styles)
  • ✅ Cross-platform support
  • ✅ Hook generation
  • ✅ Create new styles

v1.1 (Planned)

  • 🔄 Style preview/demo mode
  • 🔄 Advanced template editor
  • 🔄 Style validation system
  • 🔄 Performance optimizations

v2.0 (Future)

  • 📋 GitHub integration
  • 📋 Community marketplace
  • 📋 Style switching without restart
  • 📋 Style composition
  • 📋 Multi-language support
  • 📋 Cloud style synchronization

License

Output Style Migrator is licensed under the MIT License.

This means:

  • Use freely in personal and commercial projects
  • Modify and distribute with attribution
  • No liability for the authors

See LICENSE for full legal text.

All included style templates are also MIT licensed.


Acknowledgments

This tool exists because a community of Claude Code users loved having control over their AI collaboration experience through custom output styles.

Thank you to:

  • Everyone who created custom styles and inspired this project
  • Claude Code community contributors
  • Beta testers and feedback providers
  • All future contributors who will create amazing new styles

The power of this tool is in its community. Your creativity shapes how we all collaborate with AI.


Support & Community

  • Report bugs: GitHub Issues
  • Request features: GitHub Discussions
  • Share styles: Pull requests to templates/
  • Join community: GitHub Discussions for style sharing
  • Get help: Check ARCHITECTURE.md for technical details

Quick Links


Output Style Migrator - Restore your voice. Shape your collaboration. Build the future.

Version 1.0 | MIT License | Community-Driven Development

About

Restore and enhance Claude Code custom output styles using SessionStart hooks and plugin marketplace. Cross-platform (Windows/Mac/Linux). MIT licensed.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages