Skip to content

evnchn-agentic/copilot-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

copilot-bridge

One-way bridge: GitHub Copilot CLI reads Claude Code's auto-memory as single-source-of-truth. Race-safe by design — Claude writes, Copilot reads, and a scratch file captures Copilot's learnings for human promotion.


Why

Claude Code has a frontmatter-indexed auto-memory tree under ~/.claude/projects/<enc-home>/memory/. It's human-curated, synced across nodes (memory-share), and the most durable context a multi-agent setup can reference.

GitHub Copilot CLI (GA Feb 2026) supports three things that make bridging cheap:

  1. $HOME/.copilot/copilot-instructions.md — auto-loaded every session.
  2. hooks.sessionStart in $HOME/.copilot/config.json — can inject additionalContext at session open.
  3. Per-repo AGENTS.md and model-specific CLAUDE.md at repo root — Copilot already reads these natively.

Point Copilot at Claude's memory with an instructions file + SessionStart hook and you get one context across both agents without copying, syncing, or duplicating schema.

Design decisions

  • One-writer rule. Claude owns memory/. Copilot reads only. Avoids the race two agents writing a shared store would create. Copilot's own learnings land in $HOME/.copilot/bridge-scratch.md, and the human promotes them into Claude memory when they're worth it.
  • Instructions file + hook, not MCP. An MCP memory server (mem0, OpenMemory, SuperMemory) would give Copilot a symmetric write path and add a background process. That path breaks the one-writer rule and duplicates Claude's schema. Skipped deliberately.
  • Coexist with Copilot's native Agentic Memory. Public preview since Jan 2026. Repo-scoped, 28-day expiry, auto-captured with citations. Orthogonal — it handles per-repo transient; Claude memory handles user-scoped durable. Leave it on.
  • Hook is read-only. Worst case: script fails, no injection, session still works because copilot-instructions.md tells the agent to Read the files itself.

What's in this repo

copilot-bridge/
├── README.md                          # this file
├── TEMPLATE-copilot-instructions.md   # user-level instructions, fill in the blanks
├── hooks/
│   └── inject-memory.sh               # SessionStart hook, emits CLAUDE.md + MEMORY.md as additionalContext
├── config.json.patch.md               # how to register the hook
├── verify.sh                          # probe that confirms bridge is live
├── NOTES.md                           # measurements, options weighed, caveats
└── examples/
    └── evnchn-bridge.md               # a working instantiation (scrubbed)

Setup — 3 steps

  1. Copy TEMPLATE-copilot-instructions.md to $HOME/.copilot/copilot-instructions.md. Fill in the User baseline block. The memory-path lines are already correct for macOS — Linux nodes need one path rewrite (-Users-evnchn-home-evnchn).
  2. Copy hooks/inject-memory.sh to $HOME/.copilot/hooks/ and chmod +x. Edit the mem_dir line if your home-encoded path differs.
  3. Register the hook in $HOME/.copilot/config.json using the patch in config.json.patch.md.

Run ./verify.sh to confirm the bridge loads from any cwd.

Measured impact

Baseline probe: "what is my dashboard URL", fresh session each time.

Instructions file only + SessionStart hook
Latency 38 s 7 s
Input tokens 75.9 k 19.1 k
Read calls 5 0

Hook pre-loads the CLAUDE.md + MEMORY.md index (~18 KB). Topical questions still drive Copilot to Read specific memory files per the instructions-file protocol.

Status

Private staging. Working end-to-end on MacBook Air M4 with gpt-5.2-codex. Awaiting Evan review before any public graduation or docs polish.

Prior art in this org

About

One-way bridge: GitHub Copilot CLI reads Claude Code's auto-memory as single-source-of-truth, via a user-level instructions file + SessionStart hook

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages