Automatic Claude Code session sync
Project description
Prompt Vault
Automatic Claude Code session backup and search. Your conversations, synced and searchable.
Features
- Auto-Sync: Automatically uploads sessions after each
claudecommand - Manual Sync: Bulk sync recent sessions with
pv sync - Full-Text Search: Search across all your conversations
- Web Dashboard: Browse and view sessions from any device
- Multi-User: Each user's data is isolated with Row Level Security
- Raw File Storage: Complete session files stored in Supabase Storage
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Claude Shim │────▶│ FastAPI │────▶│ Supabase │
│ (Auto-upload) │ │ Backend │ │ PostgreSQL │
└─────────────────┘ └─────────────────┘ │ + Storage │
▲ └─────────────────┘
│
┌─────────────────┐ │
│ Next.js │────────────┘
│ Frontend │
└─────────────────┘
Quick Start
1. Install CLI
git clone https://github.com/rstar327/prompt-vault.git
cd prompt-vault
pip install -e .
2. Authenticate
pv auth
This opens your browser for GitHub login. Once approved, the CLI stores a refresh token locally.
3. Enable Auto-Sync
pv install
This installs a shim that intercepts claude commands and automatically uploads sessions when they complete.
4. Use Claude Normally
claude
Sessions are automatically synced after each conversation.
CLI Commands
| Command | Description |
|---|---|
pv auth |
Authenticate with GitHub via device flow |
pv sync |
Manually sync recent sessions (last 7 days) |
pv sync --days 30 |
Sync sessions from last 30 days |
pv install |
Install the claude shim for auto-sync |
pv uninstall |
Remove the claude shim |
pv status |
Show authentication and shim status |
Web Dashboard
Visit your deployed frontend to:
- Browse all synced sessions
- Search across conversations
- View full message threads
- Filter by project
Project Structure
prompt-vault/
├── src/prompt_vault/ # Python CLI package
│ ├── cli.py # CLI commands (pv)
│ ├── auth.py # Device flow authentication
│ ├── sync.py # Session parsing and upload
│ ├── shim.py # Claude command interceptor
│ ├── install.py # Shim installation
│ └── config.py # Config management
├── backend/
│ ├── app.py # FastAPI server
│ ├── storage.py # Supabase Storage integration
│ ├── store.py # Device flow token management
│ └── supabase_client.py # Database operations
├── frontend/
│ ├── app/ # Next.js App Router
│ ├── components/ # React components
│ └── lib/ # API client
├── database/
│ ├── schema.sql # Main database schema
│ └── add_storage_path.sql # Storage path migration
├── scripts/
│ ├── install.sh # One-line installer
│ └── uninstall.sh # Uninstaller
└── pyproject.toml # Python package config
Deployment
Prerequisites
- Supabase account (free tier)
- Clerk account (free tier)
- Vercel account (free tier)
- Render account (free tier)
1. Supabase Setup
- Create a new project
- Run
database/schema.sqlin SQL Editor - Run
database/add_storage_path.sqlfor storage support - Create a Storage bucket named
sessions - Get your project URL and keys from Settings > API
2. Clerk Setup
- Create a new application
- Enable GitHub OAuth
- Get your publishable key and secret key
3. Backend (Render)
Deploy as a Web Service with these environment variables:
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-service-role-key
CLERK_SECRET_KEY=sk_live_...
JWT_SECRET=your-random-secret-for-cli-tokens
4. Frontend (Vercel)
Deploy with these environment variables:
NEXT_PUBLIC_API_URL=https://your-backend.onrender.com
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_...
CLERK_SECRET_KEY=sk_live_...
How It Works
Device Flow Authentication
- User runs
pv auth - CLI requests a device code from backend
- Browser opens to approval page
- User logs in with GitHub via Clerk
- CLI polls for approval, receives refresh token
- Refresh token stored in
~/.config/prompt-vault/config.yaml
Auto-Sync (Shim)
pv installcreates a shim script in~/.local/bin/claude- Shim records session files before running real claude
- After claude exits, shim detects new/modified sessions
- Sessions are silently uploaded in background
Data Storage
- PostgreSQL: Session metadata and searchable messages
- Supabase Storage: Raw JSONL files for complete history
Configuration
CLI config is stored at ~/.config/prompt-vault/config.yaml:
api_base_url: https://your-backend.onrender.com
refresh_token: eyJ...
user_id: user_abc123
Claude Code Data Location
Sessions are read from:
- Windows:
%LOCALAPPDATA%\claude\projects\ - Mac/Linux:
~/.claude/projects/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cc_vault-0.1.0.tar.gz.
File metadata
- Download URL: cc_vault-0.1.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
709c3cb6e3d574cc34289a883172cef37ea5b4cf23fe1e53c25509a524ed400c
|
|
| MD5 |
621240daefeba33c5dfb820c07ea74fe
|
|
| BLAKE2b-256 |
438a0a7ecc274937aa412dadafb3fd967fd203cdf3c86f273e47a3e6beb33bd5
|
File details
Details for the file cc_vault-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cc_vault-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57214f5c56b1266050e72d892db448d74e8326ebfbeb09403a1b2dd4c0edc965
|
|
| MD5 |
9ee04317116917515634e06449487712
|
|
| BLAKE2b-256 |
2464264b19a7c2796a33a65cfa52a25085335ff6bc05547d8ff75b5644d7e80a
|