claude-copilot-bridge
v1.2.1
Published
Bridge tool to migrate Claude Code sessions and memories to Copilot CLI
Downloads
890
Maintainers
Readme
Claude Copilot Bridge
Bridge tool to migrate Claude Code sessions and memories to GitHub Copilot CLI.
Installation
npm install -g claude-copilot-bridgeQuick Start
# Navigate to your project
cd /path/to/your/project
# See available Claude Code sessions
bridge list
# Migrate session [1] to Copilot CLI (creates real resumable session)
bridge migrate 1
# Resume in Copilot CLI
copilot --resumeCommands
bridge resume - Resume a Session
Show available sessions and resume them in Copilot CLI:
# List available sessions for current project
bridge resume
# Output:
# [1] e6ae82de... - My company must get us to move to Copilot CLI...
# [2] 34e9f755... - In this folder is the application AgentCore...
# Resume by number (easiest)
bridge resume 1
# Resume by partial ID
bridge resume e6ae82de
# Resume by full ID
bridge resume e6ae82de-d24a-4ad3-86ba-bdfbbcdd30daIntegration options:
# Launch Copilot CLI with session context
bridge resume 1 --copilot
# Creates ./claude-session-context.md and starts Copilot CLI
# Copy context to clipboard (paste into any tool)
bridge resume 1 --copy
# Save to specific file
bridge resume 1 --output my-context.mdFormat options:
# Summary format (default) - condensed, good for context
bridge resume 1 --format summary
# Full format - complete conversation
bridge resume 1 --format full
# Last N exchanges only
bridge resume 1 --format last --last-n 5bridge list - List Projects and Sessions
# List sessions for current project
bridge list
# List all projects
bridge list --all
# Verbose output (shows topics and message counts)
bridge list -v
# List specific project
bridge list --project C--Development-Local-MyProjectbridge export - Export Memories to Copilot
Export Claude Code project memories to .github/copilot-instructions.md:
# Export current project's memories
bridge export
# Preview without writing
bridge export --preview
# Export specific project
bridge export C--Development-Local-MyProject
# Custom output directory
bridge export --output /path/to/repobridge search - Search Session History
# Search current project
bridge search "authentication"
# Search all projects
bridge search "API design" --project C--Development-Local-MyProject
# Limit results
bridge search "bug fix" --limit 3bridge backup - Complete Backup
Create a full backup of ALL Claude Code data - sessions, memories, plans, tasks, history, and settings:
# Create backup in current directory
bridge backup
# Output:
# 📦 Creating Claude Code backup...
# 📝 Backing up sessions...
# 🧠 Backing up memories...
# 📋 Backing up plans...
# 📜 Backing up history...
# ✅ Backup complete!
# 📁 Location: ./claude-code-backup-2024-01-15
# Sessions: 90
# Memories: 43
# Plans: 8
# History entries: 501
# Task folders: 12
# Custom output directory
bridge backup --output ~/my-backup
# Include raw JSONL files (not just parsed JSON)
bridge backup --fullWhat's backed up:
| Component | Format | Notes | |-----------|--------|-------| | Sessions | JSON (parsed) | All conversations, stripped of tool metadata | | Memories | Markdown | All brain files (feedback, project, reference, user) | | Plans | Markdown | All saved plans | | Tasks | JSON | All task folders and files | | History | JSON + JSONL | Global command history | | Settings | JSON | Settings and local settings |
Output structure:
claude-code-backup-2024-01-15/
├── manifest.json # Backup metadata and stats
├── README.md # Human-readable summary
├── sessions/ # Parsed session conversations
│ └── {project}/
│ └── {session-id}.json
├── memories/ # Brain files by project
│ └── {project}/
│ └── *.md
├── plans/ # All saved plans
├── tasks/ # Task folders
├── history.json # Parsed global history
└── settings.json # Claude Code settingsbridge migrate - True Migration to Copilot CLI
This is the key feature. Creates REAL Copilot CLI sessions from your Claude Code sessions. These sessions show up in copilot --resume and can be truly continued.
# Migrate single session (memories included by default)
bridge migrate 1
# Output:
# Migrating session: 34e9f755...
# Migration complete!
# Copilot session ID: 12068eca-ca7a-4609-90bc-0750f1e1393c
# Messages: 300
# Memories: included
#
# Resume in Copilot CLI:
# copilot --resume 12068eca
# Migrate all sessions for current project
bridge migrate --all
# Preview without creating (dry run)
bridge migrate 1 --dry-run
# Skip memories (lightweight migration)
bridge migrate 1 --no-memoriesWhat gets migrated:
- Full conversation history (user messages + assistant responses)
- Project memories/brain files (as system context)
- Session metadata (timestamps, project path)
How it works:
- Reads your Claude Code session from
~/.claude/projects/ - Converts messages to Copilot CLI's event format
- Injects your memories as system context
- Creates a new session in
~/.copilot/session-state/ - The session is immediately available via
copilot --resume
How It Works
Session Resume
- Reads Claude Code's JSONL session files
- Extracts user prompts and assistant responses (strips tool calls/metadata)
- Outputs as clean markdown for Copilot CLI consumption
When using --copilot:
- Saves context to
./claude-session-context.md - Launches
gh copilot -iwith a prompt to read that file - Copilot CLI reads the file and has full conversation context
Memory Export
Consolidates Claude Code's memory files into Copilot's format:
feedback_*.md→ User Preferences sectionproject_*.md→ Project Knowledge sectionreference_*.md→ Reference Documentation section
Output: .github/copilot-instructions.md
Project Detection
Automatically detects your current project by matching your working directory to Claude Code's project folders in ~/.claude/projects/.
Data Locations
| Component | Location |
|-----------|----------|
| Sessions | ~/.claude/projects/{project}/{uuid}.jsonl |
| Memories | ~/.claude/projects/{project}/memory/ |
| Plans | ~/.claude/plans/ |
| Tasks | ~/.claude/tasks/ |
| Global History | ~/.claude/history.jsonl |
| Settings | ~/.claude/settings.json |
Requirements
- Node.js 18+
- Claude Code (creates
~/.claude/directory) - GitHub CLI with Copilot (for
--copilotflag)
License
MIT
