claude-clean

skill
Security Audit
Fail
Health Pass
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 16 GitHub stars
Code Fail
  • rm -rf — Recursive force deletion command in install.sh
  • rm -rf — Recursive force deletion command in scripts/build-binaries.sh
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Beautiful terminal parser for Claude Code's streaming JSON output

README.md

🧹 Claude Clean

CI
Release
Go Version
License: MIT

Transform messy Claude Code JSON logs into beautiful terminal output. ✨


⚡ Quick Start

Install:

curl -fsSL https://raw.githubusercontent.com/ariel-frischer/claude-clean/main/install.sh | sh

Use it:

claude -p "your prompt" --verbose --output-format stream-json | cclean

That's it! 🎉


🤔 Why?

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.


📦 Installation

🚀 One-liner (recommended)

curl -fsSL https://raw.githubusercontent.com/ariel-frischer/claude-clean/main/install.sh | sh

📥 Manual Download

Download 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/cclean

🔧 Build from source

git clone https://github.com/ariel-frischer/claude-clean && cd claude-clean
make install

🗑️ Uninstall

cclean --uninstall

🎯 Usage

# 📡 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

🎨 Output Styles

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!

🔧 Options

Flag Description
-s Output style (default/compact/minimal/plain)
-V Verbose: token usage, per-model cost, tool IDs, system reminders, hook and rate-limit events
-n Show source line numbers
-t Show elapsed time per message
-v Show version

🌈 What Gets Parsed

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

📚 Documentation


🗑️ Uninstall

cclean --uninstall

📜 License

MIT © Ariel Frischer

Reviews (0)

No results found