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.0.tar.gz (13.3 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.0-cp38-abi3-musllinux_1_2_x86_64.whl (26.6 kB view details)

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

claude_logging-0.3.0-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.0.tar.gz.

File metadata

  • Download URL: claude_logging-0.3.0.tar.gz
  • Upload date:
  • Size: 13.3 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.0.tar.gz
Algorithm Hash digest
SHA256 efe5461b932ebf547223549e4337fc593327abccbd712911e116bb1b790b5255
MD5 19d1a4573b184b2f15f3b3a098859e3a
BLAKE2b-256 605fd295545da9f394e8cff2d8064dc7c314d8454e9c58d8244bfbfe873b5725

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_logging-0.3.0.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.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for claude_logging-0.3.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9dee1910c76d1b725dd9a6dfc8daaf85261def63954931cddeb651a88130b322
MD5 2f2bb6ee9330348605d89fa23a82ac20
BLAKE2b-256 dc8cc1a00079965caf01a9fe674de607f50c4ab9ae5410ca881e3619f0136a18

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_logging-0.3.0-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.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for claude_logging-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 27b6b0b52fd09741f8abc5e2b554428d3f7a1f699b2e0bf45ca17bb69af0624a
MD5 cab62f2ae1bc65e0aca065f21c6462be
BLAKE2b-256 e877cafb627746ef5089ccf99a12ce0fa1f4183ad1843b41a18fd52f091f0d8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_logging-0.3.0-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