Skip to content

jftuga/declaude

Repository files navigation

declaude

Code Base: AI Vibes

Convert Claude conversation exports to styled, browsable HTML.

Overview

declaude takes the conversations.json file from a Claude data export and produces a set of standalone HTML files organized by date, plus a navigable index page. Each conversation is rendered with:

  • Syntax-highlighted code blocks and attachments (via Pygments)
  • Collapsible thinking blocks (collapsed by default)
  • Collapsible tool use and tool result blocks (collapsed by default)
  • Collapsible attachment content with syntax highlighting based on file type (collapsed by default)
  • File references shown with an info icon when no content is available
  • Citation links from web search results
  • Human and assistant messages visually distinguished with color-coded borders

Requirements

  • Python 3.12+
  • uv

Installation

git clone https://github.com/jftuga/declaude.git
cd declaude
uv sync

Usage

uv run python declaude.py <conversations.json> [options]

Arguments

Argument Description
input Path to conversations.json (Claude export file)
-o, --output Output directory for HTML files (default: output)
-s, --source Source filename to display in the index header
--utc Use UTC timezone instead of US/Eastern

Examples

# Basic export
uv run python declaude.py unpacked/conversations.json

# Custom output directory
uv run python declaude.py unpacked/conversations.json -o my_archive

# UTC timestamps with source label
uv run python declaude.py unpacked/conversations.json -o output --utc -s "my-export.json"

Output Structure

output/
  index.html
  2024/
    07/
      20240710--My_Conversation_Title.html
  2025/
    03/
      20250310--Another_Conversation.html
      20250310--Another_Conversation_2.html
  2026/
    ...
  • index.html -- Top-level page listing all conversations grouped by month in reverse chronological order
  • YYYY/MM/ -- Date-based subdirectories containing individual conversation HTML files
  • Duplicate titles -- Resolved with numeric suffixes (e.g. _2, _3)

File Descriptions

Files listed in recommended reading order (foundation-first):

File Description
chat_message.py Represents a single chat message with its content blocks, attachments, and file references
conversation.py Represents a conversation with metadata, filename generation, and date-based folder organization
html_renderer.py Renders conversations as styled HTML with syntax highlighting, collapsible sections, and an index page
exporter.py Orchestrates the export pipeline: JSON loading, HTML rendering, file writing, and index generation
declaude.py CLI entry point with argument parsing

Personal Project Disclosure

This program is my own original idea, conceived and developed entirely:

  • On my own personal time, outside of work hours
  • For my own personal benefit and use
  • On my personally owned equipment
  • Without using any employer resources, proprietary information, or trade secrets
  • Without any connection to my employer's business, products, or services
  • Independent of any duties or responsibilities of my employment

This project does not relate to my employer's actual or demonstrably anticipated research, development, or business activities. No confidential or proprietary information from any employer was used in its creation.

About

Convert Claude conversation exports to styled, browsable HTML with syntax highlighting and collapsible sections

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages