Documentation

Everything you need to know about ContextSync — from setup to architecture.

What is Context Isolation?

When you use multiple AI coding tools, each one maintains its own isolated memory. Claude Code remembers what you tell Claude, Cursor remembers what you tell Cursor, and Windsurf starts fresh every time. This is called context isolation — and it's the single biggest pain point for developers using AI coding assistants.

The consequences of context isolation:

  • Re-explaining your project every time you switch tools
  • Inconsistent responses — different tools give different answers because they lack shared context
  • Duplicated rule files — maintaining CLAUDE.md, .cursorrules, .windsurfrules separately
  • Wasted tokens — each tool spends context window budget on the same explanations
  • No cross-device memory — your AI context is trapped on one machine

ContextSync solves context isolation by creating a unified memory layer that all your AI tools share.

How It Works

ContextSync uses the Model Context Protocol (MCP) to provide shared memory to each AI coding tool. Here's the flow:

1
Install
One-line install. The installer automatically launches login, which chains into initialization.
2
Detect
ContextSync scans your system for installed AI tools (Claude Code, Cursor, Windsurf, etc.) and lets you choose which to configure.
3
Configure
For each selected tool, ContextSync writes an MCP server entry with a --tool parameter, enabling tool-specific validation.
4
Sync
All configured AI tools connect to the same SQLite memory store via MCP. Pro users can sync across devices via cloud.

When an AI tool starts, it launches contextsync server --tool "Claude Code". The server validates the tool name against your configured list and license tier before starting the MCP connection.

Installation

One-line Install

The fastest way to install ContextSync on macOS or Linux. The installer automatically launches login and initialization after downloading:

curl -fsSL https://contextsync.yangqing.one/install | sh

Homebrew

Install via Homebrew on macOS:

brew install contextsync

Manual Download

Download the latest release for your platform from GitHub Releases.

Quick Start

After installation, the setup process is fully automated. Login chains into initialization:

# Login (automatically starts init after success)
contextsync login

That's it. The login command will:

  • Send a verification code to your email
  • Verify your identity and save your account
  • Automatically run contextsync init

If you need to re-initialize later:

contextsync init

Use Cases

Scenario 1: Multiple AI Tool Users

You use Claude Code for complex reasoning and Cursor for fast edits. Without ContextSync, each tool has no idea what the other knows about your project. With ContextSync, architectural decisions you discuss with Claude are immediately available when you switch to Cursor.

Scenario 2: Rule File Synchronization

You maintain coding standards in a rules file. Without ContextSync, you need to maintain separate copies: CLAUDE.md, .cursorrules, .windsurfrules. With ContextSync, you write rules once in ~/.contextsync/rules.md and they're automatically compiled to each tool's format.

Scenario 3: Multi-Device Development

You code on a desktop and a laptop. Without ContextSync, your AI context is trapped on one machine. Pro users can sync memories and rules across up to 3 devices via cloud sync.

Scenario 4: Reducing Token Costs

Re-explaining your project to each AI tool burns tokens. With ContextSync's shared memory, each tool already has your project context, reducing the tokens needed for each conversation.

Commands

contextsync login

Login to your ContextSync account using email verification. You will receive a 6-digit verification code via email. After successful login, initialization runs automatically.

contextsync login

Login (1/2) chains into init (2/2) automatically — no manual steps needed.

contextsync logout

Logout from your ContextSync account on this device.

contextsync logout

contextsync init

Initialize ContextSync and configure all detected AI coding tools. This command will:

  • Create the ~/.contextsync directory structure
  • Initialize the SQLite database
  • Register your device with the server
  • Detect installed AI tools (10+ supported)
  • Let you select tools (Free: max 2, Pro: unlimited)
  • Configure MCP server for each selected tool with --tool validation
  • Save encrypted tool list and sync to cloud
  • Create default rules file
  • Install and start the background daemon
contextsync init

Free tier users see an interactive selector to choose which 2 tools to configure. Pro users can configure all tools.

contextsync status

Show current status including version, account, license tier, device info, memory stats, and configured tools.

contextsync status

contextsync doctor

Run diagnostics to check your ContextSync installation, configuration, and detected AI tools.

contextsync doctor

Use this command to troubleshoot issues with your installation.

contextsync server

Start the Model Context Protocol (MCP) server. This provides tools and resources for AI coding assistants:

  • get_memories - Retrieve relevant memories (Free)
  • save_memory - Save important context (Pro)
  • get_rules - Get current coding rules (Free)
  • list_memories - List all memories (Free)

The server accepts a --tool flag for license validation:

contextsync server --tool "Claude Code"

The --tool flag is set automatically by each AI tool's MCP configuration. It validates that the tool is in your configured list before starting.

contextsync upgrade

Upgrade to ContextSync Pro. Opens the pricing page in your browser.

contextsync upgrade

Pro unlocks unlimited tools, permanent memory, cloud sync, and up to 3 devices.

contextsync activate <license-key>

Activate a Pro license key on your device.

contextsync activate YOUR_LICENSE_KEY

contextsync rules

Manage your coding rules. Rules are synced across all configured AI tools automatically via a background daemon.

contextsync rules edit
contextsync rules show
contextsync rules sync

Rules file is located at ~/.contextsync/rules.md. Changes are auto-compiled to CLAUDE.md, .cursorrules, .windsurfrules, etc.

contextsync memories

Manage your stored memories.

contextsync memories list
contextsync memories show <id>
contextsync memories delete <id>

contextsync version

Print version information.

contextsync version

contextsync update

Update ContextSync CLI to the latest version from GitHub releases.

contextsync update

If installed in a system directory like /usr/local/bin, you may need to run with sudo.

Features

Free Tier

  • 2 AI tools configured
  • 1 device
  • 14-day memory retention
  • Read-only memory access
  • Local SQLite storage
  • Rule file sync
  • Cloud sync across devices
  • Save new memories

Pro Tier

  • All 10 AI tools
  • Up to 3 devices
  • Permanent memory retention
  • Unlimited memory storage
  • Cloud sync across devices
  • Save new memories
  • Priority support
  • 14-day money-back guarantee

Architecture

ContextSync uses a local-first architecture built on the MCP standard:

  • Memory Store: Local SQLite database with FTS5 full-text search, stored at ~/.contextsync/data/memories.db
  • MCP Server: Each AI tool launches contextsync server --tool "ToolName" as a child process via stdio
  • Rule Engine: Watches ~/.contextsync/rules.md and auto-compiles to tool-specific formats
  • Background Daemon: macOS LaunchAgent that auto-compiles rule changes and syncs memories to cloud (Pro)
  • Cloud Sync: Pro users can sync memories and rules across up to 3 devices via HTTPS
  • Tool Validation: Encrypted tool list (~/.contextsync/tools.enc) + cloud API ensure only configured tools can start

Each AI tool connects independently to the same SQLite database through its own MCP server instance. There is no single point of failure — if one tool's server crashes, others continue working.

Supported Tools

ContextSync integrates with the following AI coding tools via MCP protocol:

Claude Code Native MCP
Cursor Native MCP
Windsurf Native MCP
Gemini CLI Native MCP
GitHub Copilot MCP Support
Cline / Roo Code MCP Support
Codex CLI MCP Support
Aider MCP Support

Configuration

Directory Structure

~/.contextsync/
├── config.json # Configuration file
├── rules.md # Coding rules (single source of truth)
├── tools.enc # Encrypted tool list (AES-GCM)
├── data/
│ └── memories.db # SQLite database with FTS5
├── backups/ # Backup directory
└── logs/ # Log files

Global Flags

--config string Config file (default is $HOME/.contextsync/config.json)
-v, --verbose Verbose output

Troubleshooting

MCP server refuses to start for a tool

If contextsync server --tool "ToolName" fails with "Tool not configured", it means the tool is not in your configured list. Run contextsync init to reconfigure your tools.

Free tier tool limit exceeded

Free tier supports a maximum of 2 AI tools. If you need more, upgrade to Pro with contextsync upgrade to unlock all 10 tools.

Rule files not syncing

Make sure the background daemon is running. Check with contextsync doctor. The daemon watches for changes to ~/.contextsync/rules.md and auto-compiles them.

Device registration failed

Free tier supports 1 device. If you've already registered on another device, remove it from your dashboard first. Pro supports up to 3 devices.

Memories not saving (Free tier)

Memory saving is a Pro feature. Free tier has read-only access to memories with 14-day retention. Upgrade to Pro to save new memories permanently.

Need Help?

If you have questions or encounter issues: