Skip to content

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

  1. Contox writes your project brain between <!-- contox:start --> and <!-- contox:end --> markers in .windsurfrules
  2. Windsurf reads the file and uses the context for all AI interactions
  3. 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

  1. Run Contox: Setup Wizard from the VS Code command palette
  2. In Step 4, check Windsurf
  3. The extension creates or appends to .windsurfrules with 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:

bash
contox export -f windsurfrules

To preview the output without writing files:

bash
contox export -f windsurfrules --stdout

Option 3: Manual setup

Create .windsurfrules in your project root:

markdown
# 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:

bash
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:

markdown
# 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