claude-chat-exporter  by agarwalvishal

Claude conversation exporter for perfect Markdown fidelity

Created 1 year ago
344 stars

Top 80.7% on SourcePulse

GitHubView on GitHub
Project Summary

This JavaScript tool, Claude Chat Exporter, addresses the need to reliably save Claude.ai conversations. It targets Claude users who require accurate, complete, and well-formatted exports of their chat history, providing a significant benefit over manual methods or less robust parsing scripts.

How It Works

The exporter employs a novel approach by programmatically triggering Claude's native "copy" buttons for both user and AI messages. It intercepts navigator.clipboard.writeText calls to capture the exact Markdown content generated by Claude's internal copy functionality. This captured content is then combined with metadata like conversation titles and per-message timestamps, fetched via Claude's internal API, to construct a comprehensive Markdown file. This method ensures 100% fidelity for all Claude-supported elements, avoiding the inaccuracies and maintenance burdens associated with parsing HTML directly.

Quick Start & Requirements

  • Primary install / run command: Open a conversation on claude.ai, open the browser's developer console (F12 or Cmd+Option+J/K), paste the contents of claude-chat-exporter.js, and press Enter.
  • Non-default prerequisites and dependencies: JavaScript enabled in the browser, modern browser with clipboard API support (Chrome, Firefox, Safari, Edge recommended).
  • Estimated setup time or resource footprint: Execution time is typically 3-8 seconds for 10-message conversations with minimal memory usage.
  • Links: No official quick-start or demo links are provided; the script itself is the primary artifact.

Highlighted Details

  • Perfect Markdown Fidelity: Leverages Claude's copy function for exact output, preserving all formatting.
  • Complete Element Support: Accurately exports tables, LaTeX math, code blocks, lists, links, blockquotes, headers, and future markdown features.
  • Timestamps: Fetches human message timestamps directly from Claude's API.
  • Smart Filename Generation: Automatically names the output file using the conversation title retrieved from the API.

Maintenance & Community

Contributions are welcomed via pull requests or issues for selector updates, performance tuning, and error handling improvements. No specific community channels (e.g., Discord, Slack) or notable contributors/sponsorships are listed.

Licensing & Compatibility

  • License type: MIT License.
  • Compatibility notes: Compatible with modern browsers supporting the clipboard API. Designed exclusively for the claude.ai web interface.

Limitations & Caveats

The tool requires JavaScript to be enabled and operates solely within the claude.ai web interface. It is susceptible to breaking if Claude's UI changes necessitate updates to CSS selectors. The exporter cannot handle attachments, images, or artifacts, and only exports messages currently visible in the browser's DOM.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
1
Star History
89 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.