claude-copilot-sessions
Bring your Copilot CLI sessions into Claude Code.
claude-copilot-sessions is a Claude Code plugin (and a command-line tool) that imports your GitHub Copilot CLI sessions for the current repository into Claude Code. Run /copilot-sessions:import, then use /resume (or claude --resume) to browse the imported [copilot] … conversations and press Enter to continue one.
Features
No model call, no tokens. The import runs in a Claude Code hook and prints its report directly. Tokens are only spent once you resume a session and start typing, just like any other conversation.
No duplicates, ever. A session whose content hasn’t changed since its last import is skipped. A session that changed gets a new copy with the next suffix: Title, Title (1), Title (2)…. Existing files are never overwritten.
Only this repository. Scoping works like /resume: the current git worktree by default, or --worktrees for all worktrees of the repo.
Reads Copilot CLI’s own session files directly, read-only. No database, no CLI call, no network access.
Prerequisites
Python 3.10+
Installation
As a Claude Code plugin
claude plugin marketplace add barseghyanartur/claude-sessions-importer
claude plugin install copilot-sessions@barseghyanartur
Or inside a Claude Code session:
/plugin marketplace add barseghyanartur/claude-sessions-importer
/plugin install copilot-sessions@barseghyanartur
Update later with claude plugin update copilot-sessions@barseghyanartur, or turn on auto-update for the marketplace under Marketplaces in /plugin.
The plugin runs the code bundled in the plugin itself, so it does not need the PyPI package. It needs a Python >= 3.10 on PATH (python3, python3.1x) or uv. Note that /usr/bin/python3 on macOS is 3.9. brew install python or uv python install 3.12 fixes that, or set CCS_PYTHON=/path/to/python.
As a command-line tool
uv tool install claude-copilot-sessions # or: pipx install claude-copilot-sessions
uvx claude-copilot-sessions list # one-off run without installing
Usage in Claude Code
/copilot-sessions:import # sessions of the current worktree
/copilot-sessions:import --worktrees # every worktree of the repository
/copilot-sessions:import --dry-run # show what would happen
/copilot-sessions:import --with-tool-output # include (truncated) tool output
/resume # pick a "[copilot] …" session
Example report:
Copilot CLI → Claude Code import · git worktree /Users/me/repos/brrn
into ~/.claude/projects/-Users-me-repos-brrn
imported [copilot] Clarify Project Objectives
1 imported
Open them with /resume — titles start with "[copilot]".
What an imported conversation contains
One transcript per Copilot CLI session, in Claude Code’s own session folder for this project (~/.claude/projects/<project>/<uuid>.jsonl).
User messages and assistant replies as text. Each tool call becomes one line (→ view: `path/to/file.py`), and its output is left out unless you pass --with-tool-output. Reasoning content is left out, same as Claude Code’s own thinking blocks.
A first line saying which Copilot CLI session it came from. Claude reads this when you resume, so it knows the context.
The title Copilot CLI itself gave the session, or the first line of your first message when it didn’t.
How duplicates are prevented
The Claude session id is uuid5(Copilot session id + hash of the converted content). Importing unchanged content maps to a file that already exists, so it is skipped. The first line of each imported file records the Copilot session id, content hash and suffix, so changed content gets the next free suffix (the highest existing one + 1). New files are written under a temporary name and hard-linked into place, which can’t overwrite an existing file. Continuing an imported conversation in Claude doesn’t count as a change: only the Copilot CLI side is compared.
Claude Code’s transcript format is internal and may change between Claude Code versions. The importer writes only a minimal, stable subset of it.
Command line
The same package works in the terminal:
claude-copilot-sessions import --dry-run # same as /copilot-sessions:import
claude-copilot-sessions import --worktrees
claude-copilot-sessions list # sessions in scope, newest first
claude-copilot-sessions list --all --format json
claude-copilot-sessions doctor # environment + sessions report
Scoping
Mode |
Flag |
Sessions whose directory is… |
/resume equivalent |
|---|---|---|---|
worktree |
(default) |
inside the current git worktree (its top-level directory or below). Outside git: the current directory or below |
default view |
repo |
--worktrees |
inside any worktree of the repository |
Ctrl+W |
all |
--all (list only) |
anywhere |
Ctrl+A |
Configuration
Variable |
Purpose |
|---|---|
COPILOT_HOME |
Copilot CLI’s own config/data directory. Default: ~/.copilot. Sessions are read from $COPILOT_HOME/session-state/<uuid>/{workspace.yaml,events.jsonl} |
CCS_PYTHON |
Interpreter for the plugin launcher (scripts/copilot-sessions) |
Every command also accepts --copilot-home PATH.
How it works
Copilot CLI keeps one directory per session under $COPILOT_HOME/session-state/<uuid>/: a workspace.yaml with the session’s directory, title and timestamps, and an events.jsonl with the conversation itself. There’s also a session-store.db SQLite index, but everything this importer needs is already in the two per-session files, so the database is never opened. See docs/design.md for the full format notes.
Development
make install # uv sync (creates .venv with dev tools)
make test # pytest (tests live in src/claude_copilot_sessions/tests)
make check # ruff + mypy --strict + pytest + manifest validation
make run ARGS="list --all"
make dev # claude --plugin-dir . (live plugin; /reload-plugins after edits)
make install-local / make uninstall-local
Troubleshooting
If /copilot-sessions:import makes Claude answer instead of printing a report, the hook didn’t run. Check the Python requirement above and run claude-copilot-sessions doctor, or sh ~/.claude/plugins/…/scripts/copilot-sessions doctor. It shows the Python in use, the Copilot home in use, the session count and the scope roots for the current directory.
License
MIT
Support
For security issues contact me at the e-mail given in the Author section.
For overall issues, go to GitHub.
Metadata
Release files for claude-copilot-sessions 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| claude_copilot_sessions-0.1.0.tar.gz | 31.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| claude_copilot_sessions-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 72.2 kB
Release files / claude_copilot_sessions-0.1.0.tar.gz
| Download URL | claude_copilot_sessions-0.1.0.tar.gz |
|---|---|
| Size | 31.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9047d7830efb8ca6ee9b614e75898f49b919a8d1c1ff67679a7a8023fbd2b01
|
|
BLAKE2b-256 checksum How to use checksums |
1fc84145ceeef5adbf393c5e27f8dc0a061f05b5920424447b9b7f9da8069c27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.11
|
Release files / claude_copilot_sessions-0.1.0-py3-none-any.whl
| Download URL | claude_copilot_sessions-0.1.0-py3-none-any.whl |
|---|---|
| Size | 41.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d9b6367af04f22e7d4f42c0b63f42857671e1d398830880d29b88259094f054b
|
|
BLAKE2b-256 checksum How to use checksums |
9d1610b98bc500315707286632f41f176f44713869aad35a5d56a273b7359887
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.11
|