Skip to main content

Save logs of claude code, and convert them into HTML

Project description

Claude Logging

Automatically keep logs of "claude code" sessions, and convert them to HTML.

Features

  • Automatically log claude sessions in ~/.claude/logs
  • Convert logged session into HTML files
  • Strips control characters and preserves text formatting
  • Converts terminal output to styled HTML
  • Supports syntax highlighting, bold text, and colors
  • Includes line numbering and theme toggling in the HTML output

Installation

pip install claude-logging

It is also possible to run it directly using uxv:

uvx claude-logging

For automatic logging of every invocation of claude, you can put an alias in your ~/.bashrc or equivalent:

alias claude="uxv claude-logging"

Usage

Default Mode: Record Claude Sessions

When you run the command claude-logging, it will:

  1. Create a log directory at ~/.claude/logs/ if it doesn't exist
  2. Generate a unique log filename based on your current directory and timestamp
  3. Run the claude command with all provided arguments
  4. Record the entire session to the log file
# Run claude with logging
claude-logging

# Pass arguments to claude
claude-logging --help
claude-logging path/to/your/file.py

HTML Conversion Mode

Convert existing log files to HTML:

# Convert a log file to HTML
claude-logging dump path/to/logfile.log

# Output to a specific file
claude-logging dump path/to/logfile.log -o output.html

# Use stdin/stdout
cat logfile.log | claude-logging dump - > output.html

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_logging-0.3.1.tar.gz (13.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

claude_logging-0.3.1-cp38-abi3-musllinux_1_2_x86_64.whl (26.5 kB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

claude_logging-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (28.5 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

File details

Details for the file claude_logging-0.3.1.tar.gz.

File metadata

  • Download URL: claude_logging-0.3.1.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for claude_logging-0.3.1.tar.gz
Algorithm Hash digest
SHA256 d39c8293b45ec12762e82fdd4d0c1635057efada46854a5133ff588dc23379af
MD5 c4d4af0c216b25db0045a5898f337b78
BLAKE2b-256 4979183f5291bdf73adfc171df7b7cb1c65ed14695ceabc9d0d54a977ca59111

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_logging-0.3.1.tar.gz:

Publisher: build-and-publish.yml on antocuni/claude-logging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_logging-0.3.1-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for claude_logging-0.3.1-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 acfc17b0dacb07e342cb543537f118cdc137fc61a8c778630e69b719c1d6ddea
MD5 e9296da18755b935255a8b2d8d3f6d81
BLAKE2b-256 c0dbc45049c1e2d48bef1e5501f916869be82dfe0d44eb7cf7b5ba2aa5d2305c

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_logging-0.3.1-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: build-and-publish.yml on antocuni/claude-logging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_logging-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for claude_logging-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae40d2512ab2f9c9508e608afda2900ce7f85b7d5bbd2775cd8ffb30eabee9a2
MD5 839e49d19d64bd6b108ea8b68b3644ef
BLAKE2b-256 697e5089462e7fecc17d030e1c0fc59d407547c45b3e67c11526b4015d87fc74

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_logging-0.3.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build-and-publish.yml on antocuni/claude-logging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page