README.md

May 31, 2025 · View on GitHub

Logo
ClaudeSync

Sync your code easily with Claude.ai Projects without leaving your IDE.
Download · Quick Start · Configuration

About

One of the most underrated features of Claude.ai is "projects". You can sync your code with a project, and then simply talk to Claude about your code, without needing to worry about supplying context. ChatGPT has a similar feature, but only works with their "4o" model as of now, and is not as good as Claude.

Claude Sync aims to make it easier to use Claude.ai projects by directly letting you sync your code from your IDE, with features like auto-syncing, exclude/include files, and more.

Inspired by ClaudeSync by jahwag.

Quick Start Guide

Note

This extension requires a Claude.ai account with the Pro plan.

1. Install the Extension

You can install ClaudeSync directly from the VS Code Marketplace!

2. Get Your Claude Token

To connect ClaudeSync with your Claude.ai account, you'll need your session token. Here's how to get it:

  1. Visit claude.ai and sign in to your account.
  2. Open Developer Tools:
    • Windows/Linux: F12 or Ctrl+Shift+I
    • Mac: Cmd+Option+I
  3. Navigate to: Application → Cookies → claude.ai → sessionKey
  4. Copy the token value (starts with "sk-ant")

Tip: Make sure you copy the raw token value, not the URL-encoded version!

3. Configure the Extension

  1. Open the Command Palette in VS Code:
    • Windows/Linux: Ctrl+Shift+P
    • Mac: Cmd+Shift+P
  2. Type "ClaudeSync: Set Token"
  3. Paste your Claude session token
  4. You're ready to go!

Available Commands

Access these commands through the Command Palette (Ctrl+Shift+P or Cmd+Shift+P):

CommandDescription
ClaudeSync: Set TokenConfigure your Claude session token
ClaudeSync: Initialize ProjectSet up a new Claude project for the workspace
ClaudeSync: Sync Current FileSync the active file
ClaudeSync: Sync WorkspaceSync all workspace files
ClaudeSync: Configure Auto-syncManage automatic file syncing
ClaudeSync: Configure Startup SyncControl syncing on VS Code startup
ClaudeSync: Sync Project InstructionsUpdate project instructions
ClaudeSync: Open in BrowserView project in Claude.ai's Web UI
ClaudeSync: Configure Remote File CleanupConfigure cleanup of remote files
ClaudeSync: Show Current SettingsDisplay current extension settings
ClaudeSync: Exclude from SyncExclude specific files from syncing
ClaudeSync: Include in SyncInclude previously excluded files in syncing
ClaudeSync: Show Output ChannelShow the extension's output/logs
ClaudeSync: Update Project InstructionsUpdate project instructions in Claude.ai
ClaudeSync: Toggle Auto-Add to GitignoreToggle automatic .gitignore management

Configuration

Customize ClaudeSync through .vscode/claudesync.json for workspace settings and VS Code's settings for global options:

{
  "excludePatterns": [
    "node_modules/**",
    ".git/**",
    "dist/**",
    "build/**",
    "**/*.pyc",
    "**/__pycache__/**",
    ".env"
    // ... many other patterns
  ],
  "maxFileSize": 2097152, // 2MB
  "autoSync": false,
  "autoSyncInterval": 30,
  "syncOnStartup": false,
  "cleanupRemoteFiles": false
}

Configuration Options

OptionDescriptionDefaultScope
sessionTokenClaude.ai session token for authentication""Global
addToGitignoreAutomatically add claudesync.json to .gitignoretrueGlobal
excludePatternsGlob patterns for excluded filesSee example aboveWorkspace
maxFileSizeMaximum file size in bytes2097152 (2MB)Workspace
autoSyncEnable automatic file syncingfalseWorkspace
autoSyncIntervalDelay in seconds between auto-syncs (min: 10, max: 180)30Workspace
syncOnStartupSync workspace when VS Code startsfalseWorkspace
cleanupRemoteFilesRemove remote files that don't exist locallytrueWorkspace

Project Instructions

Need to give Claude specific instructions for your project? Create a .projectinstructions file in your workspace root. These instructions sync when initializing a new project, or when running "Sync Project Instructions" manually.

Contributing

Feel free to contribute to this project by opening an issue or submitting a pull request.

Development

Setup

  1. Clone the repository and install dependencies:

    git clone https://github.com/rexdotsh/claudesync-vscode.git
    cd claudesync-vscode
    yarn install
    
  2. Start the build watcher:

    yarn dev  # Start watch mode
    
  3. Press F5 in VS Code to launch the Extension Development Host

  4. Make changes to src/ files and reload the extension host (Ctrl+R) to test

License

ClaudeSync is open source software licensed under the MIT License. See the LICENSE file for details.


Warning

This extension is not officially affiliated with Anthropic's Claude.ai service.