Convert a Claude Code for web session.json to HTML
Project description
claude-code-publish
Convert Claude Code session.json files to clean, mobile-friendly HTML pages with pagination.
Example transcript produced using this tool.
Installation
Install this tool using uv:
uv tool install claude-code-publish
Or run it without installing:
uvx claude-code-publish --help
Usage
When using Claude Code for web you can export your session as a session.json file using the teleport command (and then hunting around on disk).
This tool converts that JSON into a browseable multi-page HTML transcript.
The quickest way to view a recent session is to import it directly and open in your browser:
claude-code-publish import --open
This shows an interactive picker to select a session, generates HTML, and opens it in your default browser.
For a local session file:
claude-code-publish session.json -o output-directory/
This will generate:
index.html- an index page with a timeline of prompts and commitspage-001.html,page-002.html, etc. - paginated transcript pages
Options
-o, --output DIRECTORY- output directory (default: current directory)--repo OWNER/NAME- GitHub repo for commit links (auto-detected from git push output if not specified)--open- open the generatedindex.htmlin your default browser--gist- upload the generated HTML files to a GitHub Gist and output a preview URL--json- include the original JSON session file in the output directory
Publishing to GitHub Gist
Use the --gist option to automatically upload your transcript to a GitHub Gist and get a shareable preview URL.
If you use that with the import command with no other options you can directly select a session to publish to a Gist:
claude-code-publish import --gist
The --gist option is available for other commands too:
claude-code-publish session.json --gist
claude-code-publish import session_01BU6ZZoB7zTHrh9DAspF5hj --gist
Each of these will output something like:
Gist: https://gist.github.com/username/abc123def456
Preview: https://gistpreview.github.io/?abc123def456/index.html
Files: /var/folders/.../session-id
The preview URL uses gistpreview.github.io to render your HTML gist. The tool automatically injects JavaScript to fix relative links when served through gistpreview.
When using --gist without -o, files are written to a temporary directory (shown in the output). You can combine both options to keep a local copy:
claude-code-publish session.json -o ./my-transcript --gist
Requirements: The --gist option requires the GitHub CLI (gh) to be installed and authenticated (gh auth login).
Including the JSON source
Use the --json option to include the original session JSON file in the output directory:
claude-code-publish session.json -o ./my-transcript --json
This will output:
JSON: ./my-transcript/session_ABC.json (245.3 KB)
The JSON file preserves its original filename. This is useful for archiving the source data alongside the HTML output.
Importing from Claude API
You can import sessions directly from the Claude API without needing to export a session.json file:
# List available sessions
claude-code-publish list-web
# Import a specific session
claude-code-publish import SESSION_ID -o output-directory/
# Import with interactive session picker
claude-code-publish import
# Import and publish to gist
claude-code-publish import SESSION_ID --gist
# Import and save the JSON session data
claude-code-publish import SESSION_ID --json
On macOS, the API credentials are automatically retrieved from your keychain (requires being logged into Claude Code). On other platforms, provide --token and --org-uuid manually.
The --json option for the import command saves the session data fetched from the API as {session_id}.json in the output directory.
Development
To contribute to this tool, first checkout the code. You can run the tests using uv run:
cd claude-code-publish
uv run pytest
And run your local development copy of the tool like this:
uv run claude-code-publish --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_code_publish-0.2.tar.gz.
File metadata
- Download URL: claude_code_publish-0.2.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
483ebaed2917973ca44366b756fe08cfab70822a37d6646e0d167a6903b68318
|
|
| MD5 |
4759c2a0827f46fb222f2f01cc3b67dd
|
|
| BLAKE2b-256 |
283945d1d36d6890e2f2023ec3b87f0b445c12e5dc6e9b64e1e330a346fc89aa
|
Provenance
The following attestation bundles were made for claude_code_publish-0.2.tar.gz:
Publisher:
publish.yml on simonw/claude-code-publish
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_code_publish-0.2.tar.gz -
Subject digest:
483ebaed2917973ca44366b756fe08cfab70822a37d6646e0d167a6903b68318 - Sigstore transparency entry: 779372350
- Sigstore integration time:
-
Permalink:
simonw/claude-code-publish@60f762284f531f83dea784b85213df09de80357a -
Branch / Tag:
refs/tags/0.2 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60f762284f531f83dea784b85213df09de80357a -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_code_publish-0.2-py3-none-any.whl.
File metadata
- Download URL: claude_code_publish-0.2-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc99863f3cb69843c7ef28bd475e261f1ac27657c9b6112ea6af17ea578b7ce5
|
|
| MD5 |
5adcb38787ae9148a103a3585a25f0dd
|
|
| BLAKE2b-256 |
90ab104050cf3b5cb786bf4b5ba764d2afbe5492f6592b927cce1cab4d9d80fb
|
Provenance
The following attestation bundles were made for claude_code_publish-0.2-py3-none-any.whl:
Publisher:
publish.yml on simonw/claude-code-publish
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_code_publish-0.2-py3-none-any.whl -
Subject digest:
bc99863f3cb69843c7ef28bd475e261f1ac27657c9b6112ea6af17ea578b7ce5 - Sigstore transparency entry: 779372352
- Sigstore integration time:
-
Permalink:
simonw/claude-code-publish@60f762284f531f83dea784b85213df09de80357a -
Branch / Tag:
refs/tags/0.2 - Owner: https://github.com/simonw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@60f762284f531f83dea784b85213df09de80357a -
Trigger Event:
release
-
Statement type: