A tool to sync your Claude.ai project knowledge files to your local machine. This tool uses browser automation to extract and download all your project files, maintaining an organized local backup.
- π Project Knowledge Sync - Download all projects and their knowledge files
- π Organized Storage - Maintains a clean directory structure matching your Claude.ai organization
- π― Selective Sync - Sync specific projects or all projects at once
- π Progress Tracking - Real-time progress updates during sync
- πΎ Metadata Preservation - Saves project descriptions and sync timestamps
- π₯οΈ Headless Mode - Can run in background without opening browser window
- Python 3.8+
- Chrome browser installed
- Chrome DevTools Protocol enabled (see setup below)
Currently only tested on MacOS Sonoma
-
Clone the repository.
-
Install dependencies:
pip install -r requirements.txt- Enable Chrome DevTools Protocol:
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
# Linux
google-chrome --remote-debugging-port=9222
# Windows
chrome.exe --remote-debugging-port=9222- Log in to Claude.ai in the Chrome instance that opened
python sync_cli.py syncpython sync_cli.py sync-project "Project Name"python sync_cli.py listpython sync_cli.py --help
Options:
--storage PATH Storage directory (default: claude_sync_data)
--headless Run browser in headless mode
--quiet Suppress progress outputBy default, synced data is stored in ./claude_sync_data/ relative to your current working directory.
./claude_sync_data/ # Created in current directory
βββ .metadata/
β βββ sync_state.json # Sync history and state
βββ projects/
βββ Project-Name-1/
β βββ project.json # Project metadata
β βββ knowledge/
β βββ file1.txt # Knowledge files
β βββ file2.pdf
β βββ ...
βββ Project-Name-2/
βββ project.json
βββ knowledge/
βββ ...
To use a custom storage location:
python sync_cli.py sync --storage ~/Documents/claude_backupclaude_sync/
βββ claude_sync/
β βββ __init__.py
β βββ models.py # Pydantic models for data structures
β βββ browser/
β β βββ __init__.py
β β βββ config.py # Browser configuration
β β βββ manager.py # Chrome browser management
β β βββ connection.py # Page interaction logic
β βββ extractors/
β β βββ __init__.py
β β βββ project.py # Project list extraction
β β βββ knowledge.py # Knowledge file extraction
β βββ sync/
β βββ __init__.py
β βββ orchestrator.py # Main sync coordination
β βββ storage.py # Local storage management
βββ sync_cli.py # Command-line interface
βββ requirements.txt
βββ README.md
- Browser Automation: Uses Playwright to control Chrome via DevTools Protocol
- Project Discovery: Navigates to Claude.ai projects page and clicks "View All" to load all projects
- Content Extraction: For each project:
- Navigates to the project page
- Extracts list of knowledge files
- Clicks on each file to open the modal
- Extracts the file content from the modal
- Saves to local storage
- Progress Tracking: Provides real-time updates on sync progress
- BrowserManager: Manages Chrome browser lifecycle and connections
- ChromeConnection: Handles page navigation and interactions
- ProjectExtractor: Extracts project information from HTML
- KnowledgeExtractor: Extracts knowledge file metadata
- SyncOrchestrator: Coordinates the entire sync process
- LocalStorage: Manages the local file system storage
Claude.ai β Browser Automation β HTML Extraction β Local Storage
β β
βββ Progress Updates βββββ
pytest tests/test_real_world.py- Test project and file extractiontest_file_download.py- Test file content downloadtest_sync_simple.py- Test basic sync functionality
- Requires Chrome to be running with DevTools Protocol enabled
- Cannot download files that require special handling (some PDFs may only save metadata)
- Sync speed depends on number of projects and files
- Must maintain login session in Chrome
- Ensure Chrome is running with
--remote-debugging-port=9222 - Check that no other application is using port 9222
- Try closing all Chrome instances and restarting
- Make sure you're logged into Claude.ai in the Chrome instance
- If using 2FA, complete the login process before running sync
- Some files may take longer to load - the tool waits for modals to appear
- PDF files may only show preview text rather than full content
Contributions are welcome! Please submit a Pull Request.