Transform messy Claude Code JSON logs into beautiful terminal output. β¨
Install:
curl -fsSL https://raw.githubusercontent.com/ariel-frischer/claude-clean/main/install.sh | shUse it:
claude -p "your prompt" --verbose --output-format stream-json | ccleanThat's it! π
Claude Code's stream-json output is unreadable:
{"type":"assistant","message":{"content":[{"type":"text","text":"Hello!"}],"usage":{"input_tokens":150,"output_tokens":45}}}With cclean, you get beautiful output in multiple styles:
Default (-s default) β boxed with box-drawing characters:
ββ SYSTEM [init]
β Model: claude-sonnet-4-20250514
β Claude Code: v1.0.12
β Tools: 12 available
ββ
ββ ASSISTANT
β I'll check the project structure first.
ββ
ββ TOOL: Bash
β Input:
β command: ls src/
ββ
ββ TOOL RESULT
β index.ts
β utils.ts
β config.ts
ββ
ββ ASSISTANT
β Found the source files. Let me read the config.
ββ
ββ TOOL: Read
β Input:
β file_path: src/config.ts
ββ
ββ RESULT: SUCCESS
β Turns: 4
β Duration: 12.35s (API: 8.21s)
β Cost: $0.0142
β Tokens: in=1250 out=380
ββ
Compact (-s compact) β single-line summaries for quick scanning:
AST Hello! I can help you with that.
TOOL[Bash] echo "hello world"
RES hello world
Minimal (-s minimal) β clean and readable, no box-drawing:
ASSISTANT
Hello! I can help you with that.
TOOL USE [Bash]
echo "hello world"
Plain (-s plain) β no colors or formatting, ideal for piping/logs:
ASSISTANT
Hello! I can help you with that.
TOOL USE [Bash]
echo "hello world"
RESULT
hello world
Bonus: Using -p with --output-format stream-json bypasses Claude's interactive UI, avoiding segfault issues some users experience.
curl -fsSL https://raw.githubusercontent.com/ariel-frischer/claude-clean/main/install.sh | shDownload the appropriate binary for your platform from the latest release.
# After downloading, make it executable and move to PATH
chmod +x cclean-* && sudo mv cclean-* /usr/local/bin/ccleangit clone https://github.com/ariel-frischer/claude-clean && cd claude-clean
make installcclean --uninstall# π‘ Live streaming (most common)
claude -p "your prompt" --verbose --output-format stream-json | cclean
# π From a file
cclean logs.jsonl
# π₯ From stdin
cat logs.jsonl | cclean| Style | Flag | Best For |
|---|---|---|
| Default | -s default |
π¦ Boxed, colorful, easy to read |
| Compact | -s compact |
π Single-line, quick scanning |
| Minimal | -s minimal |
π No boxes, still colored |
| Plain | -s plain |
π No colors, great for logs |
cclean -s compact logs.jsonl # Try different styles!| Flag | Description |
|---|---|
-s, --style |
Output style (default/compact/minimal/plain) |
-v, --verbose |
Show system reminders |
-l, --line-numbers |
Show source line numbers |
-t |
Show elapsed time per message |
-V, --usage |
Show token usage stats |
| Type | Color | Description |
|---|---|---|
| π§ SYSTEM | Cyan | Init, config, session info |
| π¬ ASSISTANT | Green | Claude's responses |
| π οΈ TOOL | Yellow | Tool calls (Bash, Read, Write...) |
| β RESULT | Gray | Tool output |
| β ERROR | Red | Tool errors |
| π USAGE | Magenta | Token stats & costs |
- Usage Guide - Shell aliases, advanced examples, output styles
- Installation - Detailed installation options
- Development - Building from source, architecture
- Contributing - How to contribute
- Releases - Release process and versioning
- Auto-bump - Automatic version bumping
cclean --uninstallMIT Β© Ariel Frischer