Summary
Full GitHub Copilot CLI integration for ctx, enabling persistent AI context management within the Copilot CLI ecosystem. This brings ctx's context system (.context/ files, session recall, drift detection) to GitHub Copilot CLI users with the same level of support as Claude Code and VS Code Copilot.
What's Included
Phase 1 — Hook Generation (cross-platform)
ctx hook copilot-cli --write generates .github/hooks/ctx-hooks.json
- Dual bash/PowerShell scripts for all lifecycle events:
sessionStart, preToolUse, postToolUse, sessionEnd
- Dangerous command blocking in preToolUse hooks
- Per-hook timeout control and working directory configuration
Phase 2 — Agent Instructions & Extras
AGENTS.md generation (ctx hook agents --write) with universal agent instructions
.github/agents/ctx.md — custom Copilot CLI agent for context delegation
.github/instructions/context.instructions.md — path-specific instructions for .context/ files
- Marker-based idempotent merge with existing files
Phase 3 — MCP Registration & Session Parser
- Auto-register ctx MCP server in
~/.copilot/mcp-config.json (respects COPILOT_HOME)
- Merge-safe config: reads existing config, adds ctx server entry, writes back
CopilotCLIParser implementing SessionParser interface for ctx recall
- Cross-platform session directory detection (macOS, Linux, Windows)
Phase 4 — Copilot CLI Skills
- 5 skill templates in
.github/skills/<name>/SKILL.md:
- ctx-status — context summary and health check
- ctx-recall — session history browsing
- ctx-drift — context drift detection
- ctx-compact — archive completed tasks
- ctx-next — advance to next task
- YAML frontmatter format matching Copilot CLI skill spec
- Embedded in ctx binary, written alongside hooks by
--write
Feature Matrix
See full comparison: specs/copilot-cli-integration.md
| Category |
Claude Code |
VS Code |
Copilot CLI |
| Context Injection |
✅ 6/6 |
✅ 4/6 |
✅ 5/6 |
| Hook System |
✅ 5/15 |
✅ 1/15 |
✅ 10/15 |
| MCP Server (11 tools) |
✅ |
✅ |
✅ |
| Session Recall |
✅ 5/7 |
✅ 5/7 |
✅ 5/7 |
| Skills |
✅ 37 |
— |
✅ 5 |
| Cross-Platform |
✅ 6/9 |
✅ 8/9 |
✅ 9/9 |
Deferred (Future Work)
- ACP (Agent Client Protocol) server mode
- Copilot Memory ↔ ctx memory bridge
- Additional lifecycle events (
agentStop, subagentStop, errorOccurred)
- Full session parser implementation (pending Copilot CLI session format stabilization)
Summary
Full GitHub Copilot CLI integration for ctx, enabling persistent AI context management within the Copilot CLI ecosystem. This brings ctx's context system (.context/ files, session recall, drift detection) to GitHub Copilot CLI users with the same level of support as Claude Code and VS Code Copilot.
What's Included
Phase 1 — Hook Generation (cross-platform)
ctx hook copilot-cli --writegenerates.github/hooks/ctx-hooks.jsonsessionStart,preToolUse,postToolUse,sessionEndPhase 2 — Agent Instructions & Extras
AGENTS.mdgeneration (ctx hook agents --write) with universal agent instructions.github/agents/ctx.md— custom Copilot CLI agent for context delegation.github/instructions/context.instructions.md— path-specific instructions for.context/filesPhase 3 — MCP Registration & Session Parser
~/.copilot/mcp-config.json(respectsCOPILOT_HOME)CopilotCLIParserimplementingSessionParserinterface forctx recallPhase 4 — Copilot CLI Skills
.github/skills/<name>/SKILL.md:--writeFeature Matrix
See full comparison: specs/copilot-cli-integration.md
Deferred (Future Work)
agentStop,subagentStop,errorOccurred)