Skip to content

Cursor Integration

Cursor reads project-specific instructions from a .cursorrules file in your workspace root. Contox injects your project brain into this file so Cursor has access to your full project memory.

How it works

  1. Contox writes your project brain between <!-- contox:start --> and <!-- contox:end --> markers in .cursorrules
  2. Cursor reads the file at session start and uses the context for all 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

The fastest way to configure Cursor:

  1. Run Contox: Setup Wizard from the VS Code command palette
  2. In Step 4, check Cursor
  3. The extension creates or appends to .cursorrules with Contox instructions

The extension also runs contox.loadMemory which writes .contox/memory.md and injects the brain into .cursorrules between the contox markers.

Option 2: Setup via CLI export

Generate the .cursorrules file from the command line:

bash
contox export -f cursorrules

This creates or updates .cursorrules in your project root with the Contox brain document.

To preview what would be written without modifying files:

bash
contox export -f cursorrules --stdout

Option 3: Manual setup

Create .cursorrules in your project root and add Contox instructions:

markdown
# Contox AI Memory

At the START of each session, run this command to load project memory:

    contox memory

At the END of each session, save what you did:

    contox save "Brief summary of what was accomplished"

For structured saves with categories:

    echo '{"summary":"...","changes":[...]}' | contox save --json

Keeping memory up to date

The brain document in .cursorrules is a snapshot. To refresh it after new sessions or scans:

bash
contox export -f cursorrules

If you use the VS Code extension, running Contox: Load Memory (contox.loadMemory) automatically refreshes the injection in .cursorrules.

Combining with your own rules

You can have custom Cursor rules alongside Contox memory. Place your rules outside the contox markers:

markdown
# My Custom Rules

- Use TypeScript strict mode
- Prefer functional components
- Always add JSDoc comments

<!-- 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