A real-time sync system for Claude Code data across multiple devices.
- Real-time Sync: Automatically sync Claude Code data (sessions, MCP configs, slash commands, settings) across devices
- Smart Conflict Resolution: Keep both versions, auto-merge, or manually resolve conflicts
- API Key Authentication: Secure authentication with Google OAuth + API keys
- Rate Limiting: Abuse prevention with tiered rate limits
- Storage Quotas: 100MB free tier, 1GB pro tier
- Beautiful CLI: OpenTUI-powered terminal interface
cc-sync/
βββ packages/
β βββ cli/ # OpenTUI CLI application
β βββ convex-backend/ # Convex real-time backend
β βββ auth-web/ # Better Auth web UI
β βββ shared/ # Shared types & utilities
βββ turbo.json # TurboRepo configuration
βββ package.json # Root workspace
- Bun >= 1.3.1
- Node.js >= 18 (for Convex CLI)
- Google OAuth credentials (for authentication)
bun installCopy .env.example to .env and fill in your credentials:
cp .env.example .envGet Google OAuth credentials from Google Cloud Console:
- Create a new project
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
http://localhost:3000/auth/callback/google
First time setup:
cd packages/convex-backend
npx convex devThis will:
- Prompt you to create/select a project
- Create your development deployment
- Generate the necessary files
- Open the Convex dashboard
After first-time setup, you can run from the root:
bun dev:convexbun dev:webNavigate to http://localhost:3000 to test authentication.
bun dev:clibun devThis starts all packages concurrently using TurboRepo.
bun type-checkbun cleanOpenTUI-powered CLI for syncing Claude Code data.
Commands:
cc-sync login- Authenticate with API keycc-sync sync- Manual synccc-sync status- Show sync statuscc-sync conflicts- List/resolve conflictscc-sync watch- Start background sync
Real-time backend with:
- Schema: Users, synced files, conflicts, rate limits, API keys
- Auth Functions: API key management, user creation
- Sync Functions: Push, pull, subscribe to changes
- Conflict Resolution: Smart merging for JSON/JSONL files
- Rate Limiting: Tiered limits (100/min free, 1000/min pro)
Simple web UI for Google OAuth and API key generation.
Endpoints:
GET /- Login pageGET /auth/google- OAuth initiationGET /auth/callback/google- OAuth callbackPOST /api/keys/generate- Generate API key
Shared TypeScript types, constants, and utilities:
- Types:
SyncedFile,SyncConflict,User, etc. - Constants: Claude data paths, storage tiers, rate limits
- Utils: Hash computation, path normalization, file size formatting
- API keys are hashed with SHA-256 before storage
- Rate limiting prevents abuse
- Storage quotas enforce limits
- HTTPS required in production
- Session expires after 7 days
- Storage: 100MB
- Rate limit: 100 requests/minute
- Sessions: 5 most recent
- Storage: 1GB
- Rate limit: 1000 requests/minute
- Sessions: 5 most recent
cd packages/convex-backend
npx convex devbun install
bun type-check- Check Google OAuth credentials in
.env - Verify redirect URI matches:
http://localhost:3000/auth/callback/google - Ensure
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETare set
cd packages/convex-backend
npx convex deploycd packages/auth-web
vercel deploycd packages/cli
bun run buildThe foundation is complete! Here's what's next:
Phase 4: CLI Implementation
- Implement auth flow (login command)
- File watching for auto-sync
- Sync manager with push/pull
- Conflict resolution UI
- Status dashboard
Phase 5: Smart Features
- Session limiting (5 most recent)
- Progress indicators
- Desktop notifications
- Debounced sync
- Offline mode handling
Phase 6: Polish & Deploy
- Error handling
- Tests
- CI/CD
- Package CLI as binary
- Production deployment
- Fork the repository
- Create a feature branch
- Make your changes
- Run
bun type-check - Submit a pull request
MIT
- Built with Convex
- Auth powered by Better Auth
- CLI powered by OpenTUI
- Monorepo managed by TurboRepo