Skip to main content

Bidirectional synchronization tool for custom agents and settings between Claude Code and GitHub Copilot.

Project description

Agent Sync

A universal synchronization tool for custom agents, permissions, and slash commands (saved prompts) between Claude Code and GitHub Copilot.

Support for Codex and Gemini CLI coming soon!

Manage your configuration in your preferred tool's native settings files, and automatically sync and convert those changes to all your other supported AI coding agents.

Features

  • Bidirectional Sync: Automatically syncs changes in both directions between Claude and Copilot configurations.
  • Permission Management: Translates and syncs permission configurations (Claude settings.json ↔ Copilot .perm.json).
  • Slash Commands: Syncs slash command definitions and prompt files.
  • Smart Conflict Resolution: Detects conflicts and offers interactive or automatic resolution strategies.
  • State Tracking: Intelligently tracks file modifications and deletions to keep directories clean.
  • Format Conversion: Seamlessly converts between format-specific schemas (e.g., Markdown structure, YAML frontmatter).
  • Dry-Run Mode: Preview changes safely before applying them to your file system.

Installation

The recommended way to install Agent Sync is via pip:

pip install agent-sync

Building from Source

If you prefer to build from source or create a standalone executable:

Requirements: Python 3.12+

# Clone the repository
git clone https://github.com/ZacheryGlass/agent-sync.git
cd agent-sync

# Install dependencies
pip install -r requirements.txt

# Run via module
python -m cli.main

Usage

Agent Sync is a Command Line Interface (CLI) tool.

CLI Mode

The general syntax for the CLI is:

agent-sync [options]

CLI Options

The tool offers various flags to customize the synchronization process.

Core Configuration

  • --source-dir: Specifies the directory containing your source configuration files.
  • --target-dir: Specifies the directory where files should be synced to.
  • --source-format: Defines the format of the source files (claude or copilot).
  • --target-format: Defines the format for the destination files (claude or copilot).
  • --config-type: Determines what type of data is being synced. Options are:
    • agent: For AI agent definitions.
    • permission: For tool use permissions and settings.
    • slash-command: For prompt and command definitions.
  • --direction: Controls the synchronization flow.
    • both: Bidirectional sync (default).
    • source-to-target: One-way sync from source to target.
    • target-to-source: One-way sync from target to source.

Operation Control

  • --dry-run: Simulates the operation and prints what would happen without modifying any files.
  • --force: Automatically resolves conflicts by choosing the newest file, bypassing interactive prompts.
  • --state-file: Path to a custom state file (defaults to ~/.agent_sync_state.json). This file tracks sync history.
  • --verbose, -v: Enables detailed logging output for debugging.

Single File Operations

  • --convert-file: Path to a single file to convert. Mutually exclusive with directory options.
  • --output: Destination path for the single converted file.
  • --sync-file & --target-file: Used for in-place merging of two specific files.

Format-Specific Flags

  • --add-argument-hint: Adds an argument-hint field (useful for Copilot) based on the description when converting from Claude.
  • --add-handoffs: Adds a handoffs placeholder field when converting to Copilot format.

Configuration Details

File Matching Strategy

Files are matched between formats based on their base names:

  • Agents: planner.md (Claude) ↔ planner.agent.md (Copilot)
  • Permissions: settings.json (Claude) ↔ settings.perm.json (Copilot)
  • Slash Commands: command.md (Claude) ↔ command.prompt.md (Copilot)

Field Mapping

Claude → Copilot

Claude Field Copilot Field Notes
name name Direct mapping
description description Direct mapping
description argument-hint Optional (requires --add-argument-hint)
tools tools Converts comma-separated string to array
model model Maps model names (e.g., sonnetClaude Sonnet 4)
permissionMode - Dropped (handled via Permission Sync)

Copilot → Claude

Copilot Field Claude Field Notes
name name Direct mapping
description description Direct mapping
tools tools Converts array to comma-separated string
model model Maps model names (e.g., Claude Sonnet 4sonnet)
argument-hint - Dropped

Permission Conversion

The tool handles complex logic to translate between Claude's permission system and VS Code's (Copilot) permission structure.

VS Code (Copilot) uses specific boolean flags for commands and URLs (e.g., "chat.tools.terminal.autoApprove"). Claude Code uses categories (allow, ask, deny) with specific patterns.

  • Auto-Approve: Maps between VS Code true and Claude allow.
  • Require Approval: Maps between VS Code false and Claude ask.
  • Regex Patterns: Preserved as-is during conversion.
  • Lossy Conversions: Since VS Code does not support a hard "deny" (block) state, Claude deny rules are converted to "require approval" in VS Code, and a warning is logged.

Contributing

Contributions are welcome! Please submit a Pull Request or open an issue to discuss proposed changes.

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/amazing-feature).
  3. Commit your changes (git commit -m 'Add some amazing feature').
  4. Push to the branch (git push origin feature/amazing-feature).
  5. Open a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_sync-1.1.0.tar.gz (141.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_sync-1.1.0-py3-none-any.whl (57.8 kB view details)

Uploaded Python 3

File details

Details for the file agent_sync-1.1.0.tar.gz.

File metadata

  • Download URL: agent_sync-1.1.0.tar.gz
  • Upload date:
  • Size: 141.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agent_sync-1.1.0.tar.gz
Algorithm Hash digest
SHA256 dfbec1a84cd23d8a40058034d9134274c908f0c6e0096edcdc84667097dab1a4
MD5 7a46e2ea0a452655bedc3bafbf896c5d
BLAKE2b-256 b00cce6b72d5657cf5b0f07f65a447e44f7a17149b153500c22dbdb4f7095daa

See more details on using hashes here.

File details

Details for the file agent_sync-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: agent_sync-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 57.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agent_sync-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6d1f72344888441778c9681dbee6309cfc7387e307a3281881952aa561e0e2b
MD5 3ccb85aa2bbe9cd0c9ef5091752405c8
BLAKE2b-256 2ad07aaa7ae7c325548a73dfd1e2e2efb45eebd1017d162a8cba3d1bb5091daa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page