Export your Raycast AI chat sessions to structured JSON format.
Raycast is a macOS productivity app with a powerful built-in AI chat feature. However, Raycast doesn't provide a native way to export your chat history.
This tool lets you rescue your AI conversations so you can:
- Unify with ChatGPT and Claude exports in Central Chat for one searchable interface
- Archive your chats for long-term storage
- Search across your conversation history
- Analyze your AI usage patterns
git clone https://github.com/daveonkels/raycast-ai-exporter
cd raycast-ai-exporter- macOS
- uv (Python package manager)
- Raycast with AI Chat feature
- Accessibility permissions for Terminal/your shell
# Extract 5 chats (quick test)
uv run --with pyobjc-framework-Cocoa --with pyobjc-framework-Quartz --with pyobjc-framework-ApplicationServices python3 raycast_export.py
# Extract all chats
uv run --with pyobjc-framework-Cocoa --with pyobjc-framework-Quartz --with pyobjc-framework-ApplicationServices python3 raycast_export.py --allusage: raycast_export.py [-h] [--count COUNT] [--all] [--output OUTPUT] [--delay DELAY] [--debug]
Export Raycast AI Chat sessions
options:
-h, --help show this help message and exit
--count, -n COUNT Number of chats to extract (default: 5)
--all Extract all chats
--output, -o OUTPUT Output file path (default: ~/Desktop/raycast_ai_chats.json)
--delay, -d DELAY Delay between chats in seconds (default: 1.0)
--debug Enable debug output (shows scroll progress and message counts)
# Export 20 chats
uv run --with pyobjc-framework-Cocoa --with pyobjc-framework-Quartz --with pyobjc-framework-ApplicationServices python3 raycast_export.py -n 20
# Export all chats with faster delay
uv run --with pyobjc-framework-Cocoa --with pyobjc-framework-Quartz --with pyobjc-framework-ApplicationServices python3 raycast_export.py --all -d 0.8
# Export to custom location
uv run --with pyobjc-framework-Cocoa --with pyobjc-framework-Quartz --with pyobjc-framework-ApplicationServices python3 raycast_export.py --all -o ~/Documents/my_chats.json
# Debug mode (shows scroll progress per chat)
uv run --with pyobjc-framework-Cocoa --with pyobjc-framework-Quartz --with pyobjc-framework-ApplicationServices python3 raycast_export.py -n 5 --debug- Open the Raycast AI Chat window - The script needs this window visible
- Grant accessibility permissions if prompted
- Don't use keyboard/mouse while the script runs - it automates UI selection
The script exports to JSON with this structure:
{
"exported_at": "2026-01-18T12:00:00.000000",
"total_sessions": 100,
"sessions": [
{
"index": 0,
"title": "Chat Title",
"date": "2026-01-18",
"messages": [
{"role": "user", "content": "Your message..."},
{"role": "assistant", "content": "AI response..."}
]
}
]
}The date field contains an approximate ISO date based on Raycast's sidebar grouping:
| Sidebar Section | Date Value |
|---|---|
| Pinned | null |
| Today | Current date |
| Yesterday | -1 day |
| Last Week | ~4 days ago |
| This Month | ~14 days ago |
| Earlier/Older | ~42 days ago |
Note: Raycast only shows relative date sections, not exact timestamps.
The script uses macOS Accessibility APIs to:
- Find the Raycast AI Chat window
- Read chat titles and date sections from the sidebar
- Select each chat using AppleScript row selection
- Scroll through the chat content to capture all messages (handles virtualized lists)
- Extract message content from both simple text areas and nested rich content structures
- Detect message roles by checking for AI command icons (distinguishes user vs assistant)
Make sure the Raycast AI Chat window is open (not the main Raycast command bar).
Go to System Settings > Privacy & Security > Accessibility and add your terminal app.
Try increasing the delay with -d 1.5 to give more time for content to load.
Use --debug to see scroll progress. Long chats are extracted by scrolling through the content area. If messages are missing, the scroll timing may need adjustment - try -d 1.5.
The script may lose window focus. Keep the AI Chat window visible and don't interact with other apps.
| Chats | Default (1s delay) | Fast (0.8s delay) |
|---|---|---|
| 50 | ~1 min | ~45 sec |
| 200 | ~3.5 min | ~2.5 min |
| 400 | ~7 min | ~5.5 min |
Add to your .zshrc or .bashrc (adjust the path to where you cloned the repo):
alias raycast-export='uv run --with pyobjc-framework-Cocoa --with pyobjc-framework-Quartz --with pyobjc-framework-ApplicationServices python3 ~/Dev/raycast-ai-exporter/raycast_export.py'Then use:
raycast-export --all
raycast-export -n 50This exporter was built to feed into Central Chat, a local-first app that unifies AI conversations from multiple platforms into a single searchable interface. Your data never leaves your computer.
Central Chat supports imports from:
- Raycast AI → Use this exporter (Raycast has no native export)
- ChatGPT → Use OpenAI's built-in export
- Claude → Use Anthropic's built-in export
Once you have exports from each platform, upload them to Central Chat for unified search across all your AI conversations.
- Sign in to ChatGPT
- Click your profile icon in the top right corner
- Click Settings → Data Controls
- Under "Export Data", click Export
- Click Confirm export
- You'll receive an email with a download link (expires in 24 hours)
The export includes your conversations in JSON format plus account data. Note: Team/Enterprise workspace conversations and images are not included.
More info: OpenAI Help Center
- Sign in to Claude
- Click your initials in the lower left corner
- Select Settings
- Navigate to the Privacy section
- Click Export data
- You'll receive a download link via email (expires in 24 hours)
The export includes your conversation data and account information. Available on Free, Pro, and Max tiers. Not available on iOS/Android apps—use the web app or Claude Desktop.
More info: Claude Support
