PHPackages                             kambo/cctranscripts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kambo/cctranscripts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kambo/cctranscripts
===================

Convert Claude Code session files to HTML transcripts (PHP port)

v0.2.0(3mo ago)00Apache-2.0PHPPHP &gt;=8.1

Since Feb 12Pushed 3mo agoCompare

[ Source](https://github.com/kambo-1st/php-cc-transcripts)[ Packagist](https://packagist.org/packages/kambo/cctranscripts)[ Docs](https://github.com/kambo-1st/php-cc-transcripts)[ RSS](/packages/kambo-cctranscripts/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Claude Code Transcripts (PHP)
=============================

[](#claude-code-transcripts-php)

Convert Claude Code session files (JSON/JSONL) to clean, mobile-friendly HTML transcripts with pagination.

This is a PHP port of [claude-code-transcripts](https://github.com/simonw/claude-code-transcripts) by Simon Willison.

Features
--------

[](#features)

- Parse JSON and JSONL session files from Claude Code
- Generate paginated HTML transcripts (5 prompts per page)
- Render tool calls with syntax highlighting:
    - **Write** - File creation with content preview
    - **Edit** - Diff-style old/new display
    - **Bash** - Command display with description
    - **TodoWrite** - Task lists with status icons
    - Generic tool calls with JSON formatting
- Auto-detect GitHub repository for commit links
- Search functionality across all pages
- Mobile-friendly responsive design
- Batch conversion of all local sessions

Installation
------------

[](#installation)

### Option 1: Download Static Binary (Recommended)

[](#option-1-download-static-binary-recommended)

No PHP required. Download the pre-built binary for your platform:

```
# Linux x86_64
curl -fsSL https://github.com/kambo-1st/php-cc-transcripts/releases/latest/download/claude-code-transcripts-linux-x86_64 -o claude-code-transcripts
chmod +x claude-code-transcripts
sudo mv claude-code-transcripts /usr/local/bin/

# macOS Apple Silicon
curl -fsSL https://github.com/kambo-1st/php-cc-transcripts/releases/latest/download/claude-code-transcripts-macos-aarch64 -o claude-code-transcripts
chmod +x claude-code-transcripts
sudo mv claude-code-transcripts /usr/local/bin/
```

### Option 2: Install with Composer (Global)

[](#option-2-install-with-composer-global)

Requires PHP 8.1+.

```
composer global require kambo/cctranscripts
```

Make sure Composer's global bin directory is in your PATH:

```
# Add to your ~/.bashrc or ~/.zshrc
export PATH="$HOME/.composer/vendor/bin:$PATH"
# or for newer Composer versions:
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
```

Then run:

```
claude-code-transcripts --help
```

### Option 3: Install with Composer (Project)

[](#option-3-install-with-composer-project)

Add to your project:

```
composer require kambo/cctranscripts
```

Run via vendor bin:

```
./vendor/bin/claude-code-transcripts --help
```

### Option 4: Install from Source

[](#option-4-install-from-source)

```
git clone https://github.com/kambo-1st/php-cc-transcripts.git
cd php-cc-transcripts
composer install
./bin/claude-code-transcripts --help
```

Usage
-----

[](#usage)

### Convert a single session file

[](#convert-a-single-session-file)

```
claude-code-transcripts json /path/to/session.jsonl -o ./output
```

Options:

- `-o, --output ` - Output directory (default: temp dir)
- `--repo ` - GitHub repo for commit links (auto-detected if not specified)

### Browse and convert local sessions

[](#browse-and-convert-local-sessions)

```
claude-code-transcripts local
```

This will scan `~/.claude/projects/` and let you select a session to convert.

Options:

- `-o, --output ` - Output directory
- `--limit ` - Maximum sessions to show (default: 10)

### Convert all sessions to archive

[](#convert-all-sessions-to-archive)

```
claude-code-transcripts all -o ./claude-archive
```

Creates a browsable archive with:

- Master index listing all projects
- Per-project pages listing sessions
- Individual session transcripts

Options:

- `-s, --source ` - Source directory (default: `~/.claude/projects`)
- `-o, --output ` - Output directory (default: `./claude-archive`)
- `--include-agents` - Include agent-\* session files
- `--dry-run` - Show what would be converted without creating files

Output Structure
----------------

[](#output-structure)

Single session:

```
output/
├── index.html      # Overview with all prompts
├── page-001.html   # First 5 prompts
├── page-002.html   # Next 5 prompts
└── ...

```

Archive (all sessions):

```
claude-archive/
├── index.html              # Master index
├── project-name/
│   ├── index.html          # Project sessions list
│   ├── session-uuid/
│   │   ├── index.html
│   │   ├── page-001.html
│   │   └── ...
│   └── ...
└── ...

```

Programmatic Usage
------------------

[](#programmatic-usage)

```
