Claude Project Files Extractor

sharmanhall
2025-07-02T18:55:49Z

Download/extract all files from a Claude project as a single ZIP - Fixed filenames, PDF support, CSV handling

Claude Project Files Extractor (ZIP Export)

A powerful Tampermonkey userscript that extracts all files from your Claude AI projects and downloads them as a single ZIP file with intelligent filename detection, full PDF support, and comprehensive content preservation.

🚀 Key Features

One-Click ZIP Export: Downloads all project files in a single convenient ZIP archive

🆕 Full PDF Support: Downloads actual PDF files (not just text extraction) preserving original formatting

🆕 CSV Handling: Exports CSV files via download URL, table reconstruction, or marks unexportable with reason

🆕 Clean Filename Normalization: No more duplicate extensions (.md.md.md → .md) or garbage patterns

🆕 Smart Collision Handling: Duplicate filenames get clean suffixes (file__2.md, file__3.md)

Smart File Detection: Automatically finds and extracts all project knowledge files from the sidebar

Comprehensive Metadata: Detailed _export_metadata.json with per-file status, export method, and error tracking

Real-Time Progress: Button shows live status with clear progress messages

Verbose Console Logging: Watch every file: DOM name → normalized name → type → export method → status

Robust Fallback: Falls back to individual file downloads if ZIP creation fails

Cross-Browser Compatible: Tested and works reliably in Chrome, Firefox, and Edge

🎯 What Gets Exported

All Project Knowledge Files: Every file you've uploaded to the project knowledge base

🆕 Actual PDF Files: Real PDFs downloaded via Claude's API (not text extraction)

🆕 CSV Files: Exported when possible, with clear status if unexportable

Full Text Content: Extracts readable text from Word docs, markdown, and other text-based files

Project Metadata: Export timestamp, project title, URL, file counts, and detailed per-file information

Clean Organization: Files are properly named without duplicate extensions or garbage characters

📦 Export Format

Downloads a single ZIP file containing:

ProjectName_export_2025-01-20T16-30.zip
├── Project_Instructions.txt
├── user_manual.pdf              ← 🆕 Actual PDF file!
├── config_data.json
├── meeting_notes.md
├── contact_list.csv
├── duplicate_file__2.md         ← 🆕 Clean collision handling
└── _export_metadata.json        ← 🆕 Comprehensive export report

📊 Metadata Report

The _export_metadata.json now includes:

{
  "exportDate": "2025-01-20T16:30:00.000Z",
  "projectTitle": "My Project",
  "exporterVersion": "4.0.0",
  "summary": {
    "total": 25,
    "exported": 23,
    "failed": 1,
    "unexportable": 1,
    "pdfExported": 5,
    "csvExported": 2
  },
  "files": [
    {
      "originalDomFilename": "report.pdf",
      "normalizedFilename": "report.pdf",
      "detectedType": "pdf",
      "sourceUrl": "/api/.../document_pdf",
      "exportMethod": "pdf_download_url",
      "status": "success"
    }
  ]
}

🔧 How to Use

1. Install the script via Tampermonkey/Greasemonkey

2. Navigate to any Claude project (claude.ai/project/...)

3. Look for the floating export button in the bottom-right corner

4. Click "📁 Export Project Files" to start the process

5. Watch the console (F12) for detailed per-file logging

6. Download your ZIP automatically when complete!

💡 Button Status Messages

🔄 Loading JSZip... - Setting up export tools

🔄 Discovering files... - Scanning and scrolling to find all files

🔄 Exporting 5/25: filename.pdf - Processing each file with live progress

🔄 Creating ZIP... - Packaging and compressing files

✅ Exported 23/25 files - Success! Download started

❌ No files found - No extractable files detected in project

🖥️ Console Output

Open DevTools (F12) to see detailed logging:

[Claude Exporter] ✅ Discovered 25 files
[Claude Exporter] ✅ FILE: "report.pdf" → "report.pdf" [pdf] via download_url = success
[Claude Exporter] ✅ FILE: "notes.md.md" → "notes.md" [md] via text_scrape = success
[Claude Exporter] ⚠️ FILE: "data.csv" → "data.csv" [csv] via unexportable = failed
[Claude Exporter] ✅ ==================================================
[Claude Exporter] ✅ EXPORT COMPLETE
[Claude Exporter] ℹ️ Total files:       25
[Claude Exporter] ℹ️ Exported:          23
[Claude Exporter] ℹ️ PDFs exported:     5

🛠️ Technical Details

Dynamic Library Loading: Loads JSZip library only when needed

Lazy Load Handling: Automatically scrolls to discover all files before export

PDF Download: Fetches actual PDF blobs via Claude's /document_pdf API endpoint

Filename Sanitization: Removes illegal characters, collapses duplicate extensions, handles collisions

Advanced Modal Interaction: Opens each file, extracts content/download URL, closes cleanly

Memory Efficient: Processes files sequentially to avoid browser memory limits

Comprehensive Error Handling: No silent failures—every file's status is tracked and logged

🎨 Perfect For

Project Backup: Safeguard your work before making major changes

Team Collaboration: Share complete project files with colleagues

Project Archival: Store completed projects for future reference

Account Migration: Move projects between different Claude accounts

Offline Access: Work with project content without internet access

Documentation: Create comprehensive project documentation packages

Audit Trail: Track exactly which files exported and which failed (with reasons)

🔒 Privacy & Security

100% Local Processing: All file extraction happens in your browser

No External Servers: Files transfer directly from Claude to your downloads

Zero Tracking: Script only interacts with Claude.ai pages you're viewing

Open Source Transparency: Full code available for review and customization

No Data Collection: Your files and data remain completely private

📋 Installation Requirements

Userscript Manager: Tampermonkey, Greasemonkey, or Violentmonkey

Modern Browser: Chrome 90+, Firefox 88+, or Edge 90+

JavaScript Enabled: Required for script functionality

Claude AI Access: Valid account with project access

⭐ Why Choose This Script?

Unlike manual copy-paste or tedious individual downloads:

✅ Massive Time Savings - Extract dozens of files in seconds vs hours of manual work

✅ 🆕 Actual PDF Export - Downloads real PDFs, not just extracted text

✅ 🆕 Clean Filenames - No more .md.md.md or csvSelect_file.csv garbage

✅ Perfect Organization - Maintains file structure with smart collision handling

✅ Universal Compatibility - Handles PDFs, docs, spreadsheets, code files, and more

✅ Full Transparency - Detailed metadata shows exactly what happened with each file

✅ Rock-Solid Reliability - Extensively tested across browsers and project types

🆕 Version 4.0.0 Highlights

Full PDF Support: Downloads actual PDF files via Claude's API

CSV Handling: Export attempts with fallback to unexportable status + reason

Filename Fix: Complete rewrite of normalization—no more duplicate extensions

Collision Handling: Clean __2, __3 suffixes before extension

Comprehensive Metadata: Per-file tracking with export method and status

Verbose Logging: Console shows every step for easy debugging

Better Discovery: Handles lazy-loaded file grids with scroll detection

Transform your Claude project management workflow with this essential productivity tool! Save hours of manual work and ensure you never lose valuable project content again.

🐛 Support & Feedback

Having issues? Check the browser console (F12) for detailed logs showing exactly what happened with each file. The _export_metadata.json in your ZIP also contains full diagnostic information. Feel free to report bugs or suggest improvements!