Claude Formatter banner
claude-did-this claude-did-this

Claude Formatter

Code Quality community

Description

A CLI tool to format Claude's streaming JSON output for better readability

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

claude-formatter

A CLI tool to format Claude's streaming JSON output for better readability.

Installation

npm install -g claude-formatter

Usage

Pipe Claude's streaming JSON output to `claude-formatter`:

claude --continue -p "Continue iterating..." --output-format stream-json | claude-formatter

Features

  • Formats streaming JSON output from Claude
  • Converts escaped sequences (\n, \t) to actual characters
  • Pretty prints different message types with emojis
  • Color-codes output for better readability
  • Handles tool calls and responses
  • Shows token usage statistics

Examples

Basic usage

# Pipe Claude output directly
claude --output-format stream-json "Your prompt here" | claude-formatter

# Use with Claude's continue feature
claude --continue -p "Continue iterating..." --output-format stream-json | claude-formatter

# Save formatted output to a file
claude --output-format stream-json "Your prompt" | claude-formatter > output.log

Message Types

The formatter recognizes and specially formats these message types:

  • 🤖 Assistant messages - Shows model responses with content blocks
  • 👤 User messages - Displays user inputs
  • ⚙️ System messages - System information and available tools
  • 🛠️ Tool use - When Claude uses a tool
  • 🔧 Tool results - Results from tool execution
  • 📝 Text content - Regular text content
  • Errors - JSON parsing errors

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

ISC