GitHub Copilot Integration
GitHub Copilot reads project-specific instructions from .github/copilot-instructions.md. Contox injects your project brain into this file so Copilot has access to your full project memory.
How it works
- Contox writes your project brain between
<!-- contox:start -->and<!-- contox:end -->markers in.github/copilot-instructions.md - Copilot reads the instructions file and uses the context for AI interactions
- At session end, you save work via the CLI:
contox save "summary"
Your own custom instructions outside the markers are never modified.
Prerequisites
- Contox CLI installed:
npm install -g contox-cli - CLI authenticated:
contox login -k <your-api-key> - Project initialized:
contox init -t <team-id> -p <project-id>
Option 1: Setup via VS Code extension
- Run Contox: Setup Wizard from the VS Code command palette
- In Step 4, check GitHub Copilot
- The extension creates the
.githubdirectory if needed and writescopilot-instructions.mdwith Contox instructions
Option 2: Setup via CLI export
Generate the Copilot instructions file from the command line:
contox export -f copilot
This creates or updates .github/copilot-instructions.md in your project root.
To preview the output without writing files:
contox export -f copilot --stdout
Option 3: Manual setup
Create .github/copilot-instructions.md in your project:
mkdir -p .github
Then add the Contox instructions:
# Contox AI Memory
At the START of each session, run: `contox memory`
At the END of each session, run: `contox save "Brief summary"`
For structured saves: `echo '{"summary":"...","changes":[...]}' | contox save --json`
Categories: architecture, conventions, implementation, decisions, bugs, todo
Keeping memory up to date
Refresh the brain document after new sessions or scans:
contox export -f copilot
If you use the VS Code extension, running Contox: Load Memory automatically refreshes the injection in .github/copilot-instructions.md.
Combining with your own instructions
Place your custom Copilot instructions outside the contox markers:
# Project Instructions
- This is a Next.js 14 project with TypeScript
- Use server components by default
- Follow the existing code style
<!-- contox:start -->
# Contox — Project Memory
...auto-generated brain content...
<!-- contox:end -->
The section between the markers is replaced on each sync. Everything else is preserved.
Next steps
- Other Tools -- Setup for Cline, Aider, Antigravity, and more
- CLI Reference -- Full CLI command documentation