Windsurf Integration
Windsurf reads project-specific instructions from a .windsurfrules file in your workspace root. Contox injects your project brain into this file so Windsurf has access to your full project memory.
How it works
- Contox writes your project brain between
<!-- contox:start -->and<!-- contox:end -->markers in.windsurfrules - Windsurf reads the file and uses the context for all AI interactions
- At session end, you save work via the CLI:
contox save "summary"
Your own custom rules 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 Windsurf
- The extension creates or appends to
.windsurfruleswith Contox instructions
The extension also writes .contox/memory.md and injects the brain into .windsurfrules between the contox markers.
Option 2: Setup via CLI export
Generate the .windsurfrules file from the command line:
contox export -f windsurfrules
To preview the output without writing files:
contox export -f windsurfrules --stdout
Option 3: Manual setup
Create .windsurfrules in your project root:
# Contox AI Memory
At the START of each session, run: `contox memory`
At the END of each session, run: `contox save "Brief summary"`
Keeping memory up to date
Refresh the brain document after new sessions or scans:
contox export -f windsurfrules
If you use the VS Code extension, running Contox: Load Memory automatically refreshes the injection in .windsurfrules.
Combining with your own rules
Place your custom rules outside the contox markers:
# My Windsurf Rules
- Prefer server components
- Use Tailwind for styling
<!-- 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
- GitHub Copilot Integration -- Setup for Copilot instructions
- CLI Reference -- Full CLI command documentation