Claude Code Plugin
Theclaude-code-sync plugin syncs your Claude Code sessions to OpenSync. It reads session data from Claude Code’s local storage and pushes it to your dashboard in real time.
Source identifier: claude-code
Installation
Install globally with npm:Setup
1
Generate an API key
Log in to opensync.dev, go to Settings, and click Generate API Key. Copy the key (starts with
osk_).2
Run login
- Convex URL:
https://polished-penguin-622.convex.cloud(for hosted) or your self-hosted URL - API Key: The key you copied from Settings
3
Verify the connection
Connected: true with your Convex URL.Config file
Credentials are stored in~/.claude-code-sync/config.json:
Commands
claude-code-sync login
Prompts for Convex URL and API key, then saves them to the config file.claude-code-sync status
Shows connection info and sync stats:claude-code-sync sync
Force a manual sync of all sessions.Sessions sync automatically. Use manual sync after a network interruption or to catch any missed sessions.
claude-code-sync logout
Clears stored credentials.How syncing works
- Claude Code stores session data in
~/.claude/projects/and related directories. - The plugin scans for new and updated sessions.
- Each session is pushed to the
/sync/sessionendpoint withsource: "claude-code". - Each message is pushed to
/sync/messagewith its role, text content, token counts, and any tool call data. - Deduplication uses
externalId, so re-syncing is safe.
What gets synced
Session data
Each synced session maps to these database fields:Troubleshooting
Sessions not appearing
- Run
claude-code-sync statusto verify the connection. - Check that Claude Code is active and has sessions in
~/.claude/projects/. - Run
claude-code-sync syncto force a manual push.
Duplicate sessions
Duplicates can occur if Claude Code regenerates session IDs. The plugin usesexternalId for dedup, but if the source ID changes, a new session is created. Contact support if duplicates persist across syncs.
Authentication errors
If you see “Unauthorized” or “Invalid API key”:- Check that your API key is active in the dashboard Settings.
- Re-run
claude-code-sync loginto refresh credentials. - Verify the Convex URL matches your deployment.