CLI Reference
Complete reference for all claude-sync commands.
| Command | Description |
|---|---|
claude-sync login | Authenticate with Claude Sync via browser OAuth |
claude-sync logout | Revoke access tokens and clear local configuration |
claude-sync device add | Register the current machine as a new device |
claude-sync device list | Show all registered devices for your account |
claude-sync device remove | Unregister a device by name or ID |
claude-sync device rename | Change the display name of the current device |
claude-sync sync | Push local sessions and pull remote sessions |
claude-sync status | Show current sync state and project information |
claude-sync whoami | Display current user, device, and account details |
login
Authenticate with Claude Sync using your browser. This command opens a browser window where you can log in with GitHub, Google, or email/password. After successful authentication, access and refresh tokens are stored locally.
$ claude-sync login Opening browser for authentication... Visit: http://localhost:3000/auth/cli?token=abc123... Waiting for authentication... ✓ Successfully authenticated as user@example.com ✓ Device registered: MacBook Pro ✓ Tokens saved to ~/.claude-sync/config.json
logout
Revoke your access tokens and clear the local configuration file. This does not remove your device registration from the server; use device remove for that.
$ claude-sync logout ✓ Tokens revoked ✓ Configuration cleared ✓ Logged out successfully
device add
Register the current machine as a new device. Optionally provide a custom name; if omitted, the system hostname is used. You must be logged in before adding a device.
$ claude-sync device add "Work Laptop" ✓ Device registered: Work Laptop ID: 550e8400-e29b-41d4-a716-446655440000 Created: 2026-02-05 10:30:00
device list
Display all devices registered to your account. The current device is marked with (current).
$ claude-sync device list Devices for user@example.com: MacBook Pro (current) ID: 550e8400-e29b-41d4-a716-446655440000 Last seen: 2026-02-05 10:30:00 Work Laptop ID: 660e8400-e29b-41d4-a716-446655440001 Last seen: 2026-02-04 15:20:00 Home Desktop ID: 770e8400-e29b-41d4-a716-446655440002 Last seen: 2026-02-01 09:10:00
device remove
Unregister a device by its name or ID. This removes the device from your account and prevents it from syncing. You can specify a device by name or UUID.
$ claude-sync device remove "Work Laptop" ✓ Device removed: Work Laptop
device rename
Change the display name of the current device. This updates both the server record and the local configuration file.
$ claude-sync device rename "My MacBook Pro" ✓ Device renamed: My MacBook Pro
sync
Synchronize Claude Code sessions with the cloud. This performs both a push (upload local changes) and a pull (download remote changes). Use --dry-run to preview changes without uploading or downloading. Use --verbose to see detailed file-level output.
$ claude-sync sync Syncing project: /Users/john/my-app Pushing local changes... ✓ Manifest built: 42 files ✓ Diffing with remote: 3 new, 2 modified, 1 deleted ✓ Uploading files: 5/5 ✓ Push finalized Pulling remote changes... ✓ Available devices: Work Laptop, Home Desktop ✓ Downloading files: 8/8 ✓ Creating symlinks ✓ Pull finalized Sync complete: 5 uploaded, 8 downloaded
status
Display the current sync state for the active project. This shows API connection status, device info, project details, local file counts, and pending changes.
$ claude-sync status Status for /Users/john/my-app API: Connected (https://api.claude-sync.com) Device: MacBook Pro (550e8400-e29b-41d4-a716-446655440000) User: user@example.com Project: my-app (770e8400-e29b-41d4-a716-446655440003) Local state: Sessions: 12 files Todos: 3 files Artifacts: 8 files Total: 42 files Changes: Modified: 2 files New: 1 file Deleted: 0 files Last sync: 2026-02-05 09:45:00
whoami
Display your current authentication status, user information, and device details.
$ claude-sync whoami User: user@example.com Plan: Pro Device: MacBook Pro (550e8400-e29b-41d4-a716-446655440000) API: https://api.claude-sync.com Logged in: Yes