Claude Chat Exporter banner
agarwalvishal agarwalvishal

Claude Chat Exporter

AI community

Description

Claude Chat Exporter is a JavaScript tool that allows you to export your conversations with Claude AI into a well-formatted Markdown file.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude Chat Exporter

A JavaScript tool that exports Claude.ai conversations with **perfect markdown fidelity** by leveraging Claude's native copy functionality. Get complete conversations with both human and AI messages including tables, complex formatting, and all elements that Claude supports.

Features

  • 🎯 Perfect Markdown Fidelity - Uses Claude's copy function for exact output
  • πŸ“Š Complete Element Support - Tables, math, complex formatting, everything
  • πŸ• Timestamps - Human message timestamps fetched from Claude's API
  • πŸ“ Smart Filename Generation - Uses actual conversation title from API
  • πŸ”§ Future-Proof - Automatically supports new Claude markdown features
  • πŸ“ˆ Real-Time Status - Visual progress indicator during export
  • πŸ›‘οΈ Robust Error Handling - Comprehensive error detection and recovery
  • βš™οΈ Easy Maintenance - Modular selectors for UI changes

How It Works

  1. Fetch Metadata - Calls Claude's internal API to retrieve the conversation title and per-message timestamps before anything is clicked
  2. Human Messages - Identifies human message action bars (those without a thumbs-up feedback button) and clicks their copy buttons; captures each clipboard write via an intercepted navigator.clipboard.writeText
  3. Claude Responses - Identifies Claude response action bars (those with a thumbs-up feedback button) and clicks their copy buttons; captures each clipboard write the same way
  4. Perfect Output - Combines both sets of captured content into a single markdown file, with timestamps on human message headers when available

Why Copy Button Approach?

Instead of manually parsing HTML and converting to markdown (which misses tables and complex elements), this tool uses **Claude's own copy button** to ensure 100% accurate markdown output for all message types.

❌ Manual HTML Parsing:
- Misses tables and complex elements
- Requires constant updates for new features
- Error-prone formatting conve