A CLI tool to format Claude's streaming JSON output for better readability.
npm install -g claude-formatterPipe Claude's streaming JSON output to claude-formatter:
claude --continue -p "Continue iterating..." --output-format stream-json | claude-formatter- 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
# 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.logThe 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
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
ISC