Windsurf Setup & Configuration
Getting Windsurf configured correctly from the start β the right model, keybindings, context settings, and memories β determines your productivity ceiling. This module covers every step from download to first agentic edit, with screenshots at each stage.
Step 1 β Download & Install
Download Windsurf
Go to codeium.com/windsurf and download for your OS (macOS, Windows, Linux). Windsurf installs as a standalone VS Code-compatible editor β all VS Code extensions, themes, and keybindings work inside it.
Import VS Code Settings (Optional)
On first launch, Windsurf detects any existing VS Code installation and offers to migrate your extensions, keybindings, and settings.json. Accept this for a zero-friction transition.
Sign In to Codeium
Click Sign In in the bottom-left status bar. For enterprise, use your SSO provider. Your account manages model access, usage limits, and Cascade Memories synced across devices.
Windsurf β Cascade in Action
Step 2 β Select Model & Configure Cascade
| Setting | Location | Recommended Value |
|---|---|---|
| Default model | Settings β Cascade β Model | claude-sonnet-4-6 (best balance) |
| Context scope | Settings β Cascade β Context | Workspace-wide for most projects |
| Auto-indexing | Settings β Cascade οΏ½οΏ½οΏ½ Index | Enabled β updates as you edit |
| Max output tokens | Settings β Cascade β Tokens | 8192 (increase for large edits) |
| Confirmation for writes | Settings β Cascade β Safety | Enabled for production repos |
Step 3 β Create .windsurfrules
The .windsurfrules file lives in your project root and is read by Cascade automatically on every session. It encodes your team's conventions once so you never have to repeat them.
# ββ Language & Runtime βββββββββοΏ½οΏ½οΏ½βββββββββββββββββββββββββββββοΏ½οΏ½οΏ½ Python: 3.11+. Use type hints everywhere. Never use bare `except`. Node: 20 LTS. TypeScript strict mode. ESM imports only. # ββ Code Style ββββββββββββββββββββββββββββββββββββββββββββββββ Formatter: black (Python), prettier (TS/JS). Linter: ruff (Python), eslint (TS/JS). Max line length: 100 chars. Imports: stdlib β third-party β local, sorted alphabetically. # ββ Architecture βββββββββββοΏ½οΏ½βββββββββββββββββββββββββββββοΏ½οΏ½ββββ Pattern: Clean architecture. Routes β Services β Repositories. Forbidden: No business logic in route handlers. Database: SQLAlchemy ORM. Never raw SQL in application code. Tests: pytest. Every public function needs a test. Coverage > 80%. # ββ AI / Claude Integration βββββββββββββββββββββββββββββββββββ Client: Always use the shared `client` singleton from `core/ai.py`. Model: claude-sonnet-4-6 for production. Haiku for classification. Errors: Catch anthropic.RateLimitError and retry with backoff. Tokens: Log input/output tokens for every production API call. # ββ What NOT to do βββββββββββββββββββββοΏ½οΏ½οΏ½ββββββββββββββββββββββ NEVER: Hardcode API keys. Use environment variables. NEVER: Delete tests. Fix them. NEVER: Use print() for debugging. Use logging.getLogger(__name__).
Step 4 β Set Up Cascade Memories
Memories persist across sessions and devices. Open the Memories panel with Cmd/Ctrl+Shift+M and add entries for your project context:
# Add these in the Memories panel (Cmd+Shift+M) "This is ShopMate β an AI customer support assistant for ThreadCo, a T-shirt e-commerce brand. Backend: FastAPI + PostgreSQL." "Primary AI model: claude-sonnet-4-6. All Claude calls go through shopmate/core/ai.py. Never instantiate Anthropic() directly." "Test framework: pytest with fixtures in conftest.py. Run tests with: make test. CI runs on every push to main." "Database migrations with Alembic. Never modify existing migrations. Create new ones with: alembic revision --autogenerate -m 'description'"
Essential Keybindings
| Action | Mac | Windows / Linux |
|---|---|---|
| Open Cascade chat | Cmd+L | Ctrl+L |
| Start new Cascade Flow (inline) | Cmd+I | Ctrl+I |
| Accept inline completion | Tab | Tab |
| Accept next word only | Cmd+β | Ctrl+β |
| Dismiss completion | Esc | Esc |
| Open Memories panel | Cmd+Shift+M | Ctrl+Shift+M |
| Toggle AI sidebar | Cmd+Shift+A | Ctrl+Shift+A |
| Accept all Cascade changes | Cmd+Enter | Ctrl+Enter |
| Reject all Cascade changes | Cmd+Backspace | Ctrl+Backspace |
A well-crafted .windsurfrules file that captures your team's conventions, preferred patterns, and forbidden anti-patterns is worth more than any individual prompt. Invest 30 minutes writing it on day one β it compounds over every session thereafter. Commit it to your repository so the whole team benefits.