npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ccrestage

v1.0.2

Published

Claude Code conversation log replay library

Readme

ccrestage

Claude Code会話ログリプレイライブラリ - Claude Codeの会話履歴をストリーミング風に再生します。

特徴

  • 📜 JSONLフォーマットのログファイル読み込み
  • 🎬 ストリーミング風のタイピングアニメーション
  • 🎮 インタラクティブな再生制御
  • 🎨 カラフルで見やすい表示
  • 🔧 ツール実行結果の適切な表示

インストール

npm install ccrestage

または、グローバルインストール:

npm install -g ccrestage

使用方法

CLIツール

基本的な使用:

# Node.js版(ビルド必要)
ccrestage <logfile.jsonl>

# Deno版(ビルド不要、直接実行)
deno run --allow-read ccreplay.ts <logfile.jsonl>

# または実行権限を付与して
./ccreplay.ts <logfile.jsonl>

オプション:

# ストリーミング効果を無効化
ccrestage conversation.jsonl --no-streaming

# アシスタントメッセージのみ表示
ccrestage conversation.jsonl --filter assistant

# インタラクティブモード
ccrestage conversation.jsonl --interactive

# 表示速度の調整(ミリ秒)
ccrestage conversation.jsonl --delay 100

インタラクティブモードの操作

--interactiveオプションを使用すると、以下のキーボード操作が可能:

  • Space: 一時停止/再開
  • : 次のメッセージへスキップ
  • : 前のメッセージへスキップ
  • : 再生速度を上げる
  • : 再生速度を下げる
  • h: ヘルプ表示
  • q/Ctrl+C: 終了

ライブラリとして使用

import { LogReader, MessageRenderer, PlaybackController } from 'ccrestage';

// ログファイルの読み込み
const reader = new LogReader();
const entries = await reader.read('conversation.jsonl');

// 基本的な再生
const renderer = new MessageRenderer();
await renderer.renderAll(entries);

// インタラクティブ再生
const controller = new PlaybackController(entries, renderer);
await controller.startInteractive();

API

LogReader

ログファイルの読み込みとパース:

const reader = new LogReader();
const entries = await reader.read('path/to/log.jsonl');

// フィルタリング
const userMessages = reader.filterByType('user');
const assistantMessages = reader.filterByType('assistant');

// 特定のエントリを取得
const entry = reader.getByUuid('uuid-string');

// 子エントリを取得
const children = reader.getChildren('parent-uuid');

MessageRenderer

メッセージの表示制御:

const renderer = new MessageRenderer();

// ストリーミング効果の有効/無効
renderer.setStreamingEnabled(false);

// 表示速度の設定
renderer.setDelay(100);

// すべてのエントリを表示
await renderer.renderAll(entries);

// 個別のエントリを表示
await renderer.renderEntry(entry);

StreamingEffect

タイピングアニメーション:

const streaming = new StreamingEffect(5, 50); // 文字間5ms、単語間50ms

// テキストをストリーミング表示
await streaming.print("Hello, world!");

// 複数行をストリーミング表示
await streaming.printLines("Line 1\nLine 2\nLine 3");

開発

Node.js版

# 依存関係のインストール
npm install

# 開発モード(ウォッチモード)
npm run dev

# ビルド
npm run build

# テスト
npm test

# Linting
npm run lint

Deno版(ビルド不要)

# 直接実行
deno run --allow-read ccreplay.ts <logfile.jsonl>

# 開発モード(ファイル変更を監視)
deno run --allow-read --allow-write --allow-env --watch ccreplay.ts <logfile.jsonl>

# package.jsonのスクリプトを使用
npm run deno -- <logfile.jsonl>
npm run deno:dev -- <logfile.jsonl>

ログファイル形式

ccrestageは、Claude CodeのJSONL形式のログファイルを読み込みます。各行は以下の構造を持つJSONオブジェクトです:

{
  "uuid": "unique-id",
  "parentUuid": "parent-id",
  "type": "user" | "assistant",
  "timestamp": "2025-01-01T00:00:00.000Z",
  "message": {
    "role": "user" | "assistant",
    "content": [
      {
        "type": "text",
        "text": "メッセージ内容"
      }
    ]
  },
  "toolUseResult": {
    "type": "create" | "edit",
    "filePath": "/path/to/file",
    "stdout": "実行結果"
  }
}

ライセンス

MIT

貢献

プルリクエストを歓迎します!バグ報告や機能提案はIssuesへお願いします。