cc-prism
v0.1.2
Published
Convert Claude Code session JSONL files to asciicast v3 for embedding via asciinema
Maintainers
Readme
cc-prism
Your Claude Code sessions, refracted into shareable terminal recordings.
One command. Instant asciinema upload. Share the conversation that built your feature.
Built with Claude. 185 tests pass, don't blame me if it's wrong — I'm trusting their word.
Why
Born from building onceuponaclaude.com — I needed to share Claude Code sessions without resorting to screenshots or unstyled paste dumps.
cc-prism renders sessions with Claude Code's ink aesthetics: the thinking blocks, tool calls, spinners, and all. The output plays back in asciinema like you're watching the real thing.
Use it to:
- Share the conversation that shipped your feature
- Create demos of AI-assisted workflows
- Document how you solved that gnarly bug
Prerequisites: asciinema CLI for playback and upload
Quick Start
# No install needed — run directly with npx
npx cc-prism cast --latest --upload
# That's it! Share the URL anywhere.Installation
For frequent use, install globally:
npm install -g cc-prism
# or
bun install -g cc-prismThen run without npx:
cc-prism cast --latest --uploadFor more control:
# Extract specific messages, customize theme
cc-prism cast ~/.claude/projects/-home-user-myapp/session.jsonl \
--last 20 --theme dracula -o demo.cast
# Interactive picker to select message ranges
cc-prism pick --latestFeatures
Session Parsing
- Parse all 6 Claude Code JSONL message types
- Recursive loading of agent/sub-assistant conversations
- Preserve conversation structure and message relationships
Clip Extraction
- Extract by UUID range:
--start-uuid <uuid> --end-uuid <uuid> - Extract by timestamp:
--start-time <iso8601> --end-time <iso8601> - Extract last N messages:
--last <n>
Theming
Five built-in themes matching popular terminal color schemes:
tokyo-night(default) - Dark Tokyo Night palettetokyo-storm- Tokyo Storm variantdracula- Dracula color schemenord- Nord Arctic themecatppuccin-mocha- Catppuccin Mocha
Timing Presets
demo(default) - Normalized pace, brief pauses, smooth flowwalkthrough- Slower typing effect, educational pacereal- Preserve actual timestamps from session
Status Spinner
Enabled by default (use --no-status-spinner to disable):
- Rotating asterisk animation (·✢✳✻✽)
- Shimmering verb text effect with character-level highlight sliding
- Alternating verbs during long agentic sessions (throttled to 2s intervals)
- Displays TodoWrite activeForm when available
- Falls back to whimsical verbs (Clauding, Pondering, Reticulating, etc.) selected via hash-based pseudo-random distribution
- Appears during thinking blocks and tool calls, not just user prompts
Navigation Markers
Enable chapter navigation in the asciinema player:
all(default) - User prompts, assistant responses, tool callsuser- User prompts onlytools- Tool calls onlynone- No markers
CLI Commands
cast - Generate asciicast files
cc-prism cast [session] [options]
cc-prism cast [session] --interactive # Launch TUI formlist - Browse session messages
cc-prism list <session>pick - Interactive message picker
cc-prism pick [session] [--latest]Features:
- Dual-pane layout with message list and preview
- Tab cycling (All → Selected → Preview) with number shortcuts
- Visual selection mode and cherry-pick mode
- Fuzzy search with n/N navigation
- Export preview with full-screen content view
- Export dialog with format selection (.cast, .jsonl, or both)
- Single vs multiple range export modes
- Copy commands and UUIDs to clipboard
- Advanced options integration with interactive cast form
sessions - Discover project sessions
cc-prism sessionsInteractive Mode
Launch a TUI form to configure all cast options:
cc-prism cast session.jsonl --interactive
cc-prism cast --latest -IFeatures:
- Accordion sections for grouped options (Output, Appearance, Timing, Features)
- Profile system: auto-loads/saves
cc-prism.profilein current directory - Field validation with inline error messages
- vim-style navigation (j/k, g/G, Enter, Space)
See QUICKSTART.md and USAGE.md for detailed examples.
Architecture
The codebase follows a clear pipeline architecture:
JSONL → Parser → Clip Extractor → ANSI Renderer → asciicast Generator → .cast fileModules:
src/parser/- JSONL parsing and clip extractionsrc/renderer/- ANSI rendering with theme support, markdown parsing, diff visualization, todo list rendering, fixed-position input UI, and status spinner animationsrc/generator/- asciicast generation with timing/markerssrc/cli.ts- CLI commands (cast, list, sessions)
See source code for detailed implementation.
Development
npm install # Install dependencies
npm run build # Build with tsup
npm test # Run vitest tests (185 passing)
npm run dev # Watch mode
npm run typecheck # TypeScript validationTech stack:
- TypeScript with strict mode
- tsup for fast ESM bundling
- vitest for testing
- commander for CLI parsing
- chalk for terminal output
How It Works
Claude Code stores conversations in ~/.claude/projects/ as JSONL files. Each line is a JSON object representing a message. Messages form a tree structure via parent UUID references.
cc-prism:
- Parses JSONL and reconstructs the message tree
- Loads agent conversations from separate files
- Extracts the requested clip range
- Renders each message as ANSI-styled terminal output
- Generates asciicast v3 with timing and markers
- Optionally uploads to asciinema.org
Example Output
See the demo recording: https://asciinema.org/a/d6M4PZFGDK43oLrmYXnwCrvDB
Showcase
See live demos at onceuponaclaude.com
License
MIT
