Windsurf Track
Module 24
Windsurf Track -- Module 24
Building ShopMate Faster: The ShopMate backend is now 4,000 lines of FastAPI code. The developer who built it also runs ThreadCo's Shopify store. She has 10 hours per week for development. The team adopts Windsurf so Cascade handles the repetitive expansion work -- new endpoints, tests, and integrations -- while she focuses on architecture and product decisions.

Windsurf -- AI-Native Coding IDE

Windsurf by Codeium is an AI-native IDE built from the ground up for agentic coding. Unlike plugin-based AI coding tools, Windsurf's Cascade engine maintains full codebase awareness and can autonomously plan, write, test, debug, and refactor across an entire project. This module covers what Windsurf is, how it works, and why it represents a fundamentally different approach to AI-assisted development.

What Is Windsurf?

Windsurf is a standalone code editor -- not a plugin, not an extension, not a wrapper around another tool. It is a full IDE based on the VS Code architecture (meaning your existing VS Code extensions, keybindings, and themes work) with AI capabilities woven into every layer of the editing experience. Codeium, the company behind Windsurf, built it after years of running one of the most widely-used free AI code completion services. Their insight: bolting AI onto an existing editor as a sidebar chat or autocomplete plugin hits a ceiling. To unlock truly agentic development -- where the AI can plan multi-step tasks, edit multiple files, run terminal commands, read output, and iterate -- the AI must be a first-class citizen of the editor itself.

When you open a project in Windsurf for the first time, it indexes your entire codebase into a semantic representation. This is not a simple text search index. Windsurf builds a graph of symbols, call relationships, import chains, and type hierarchies. When you later ask Cascade to "add a new endpoint following the same pattern as the existing /products endpoint," it knows exactly which files to read, which conventions to follow, and which tests to create -- because it has already mapped your project's structure.

i
VS Code Compatibility

Windsurf is a fork of VS Code, not a wrapper. Your settings.json, keybindings.json, installed extensions, and themes all transfer directly. If you use VS Code today, the switch to Windsurf requires zero relearning of editor fundamentals -- you gain AI capabilities on top of your existing muscle memory.

The Cascade Agentic Engine

Cascade is the AI engine that powers all of Windsurf's intelligent features. Think of it as an AI developer that sits alongside you with full access to your project. Cascade can:

  • Read any file in your project -- not just the file you have open, but any file in the repository, resolved through the semantic index
  • Edit multiple files in a single operation -- a feature implementation that touches a model, a service, a router, and a test file happens in one coordinated action
  • Run terminal commands -- Cascade can execute your test suite, run a build, start a dev server, or run any CLI command, then read the output and react to it
  • Iterate autonomously -- if a test fails after Cascade's edit, it reads the failure output, diagnoses the issue, applies a fix, and re-runs the test, looping until it passes or it needs your input
  • Remember context across sessions -- through Memories, Cascade retains key facts about your project architecture, coding conventions, and team preferences

The key distinction from other AI coding tools is the word "agentic." A traditional AI coding assistant waits for you to ask a question and gives you an answer. Cascade takes a goal, creates a plan, and executes it. You describe the destination; Cascade figures out the route.

!
Review Before Accepting

Cascade's agentic nature means it can make many changes quickly. Always review the diff before accepting changes. Use Windsurf's built-in diff viewer to see exactly what changed in each file. The speed of AI-generated code does not remove the need for human judgment -- it just means you spend your judgment on reviewing rather than typing.

How Cascade Works Internally

Understanding Cascade's internal process helps you write better prompts and debug unexpected behaviour. When you submit a Flow prompt, Cascade follows this sequence:

  1. Goal parsing: Cascade interprets your natural language description and identifies the concrete deliverables (new files, modified functions, tests to create, commands to run).
  2. Context gathering: Using the semantic index, Cascade retrieves all relevant files, types, functions, and conventions. If you used @ mentions, those files are prioritized. Pinned context and .windsurfrules are always included.
  3. Plan generation: Cascade creates a step-by-step plan, which it shows you before execution. The plan lists which files will be created or modified and in what order.
  4. Execution: Cascade makes the changes, creating or modifying files according to the plan.
  5. Verification: If the plan includes running commands (tests, builds, linters), Cascade executes them in the integrated terminal and reads the output.
  6. Iteration: If verification fails, Cascade diagnoses the issue and loops back to step 4, applying fixes until the verification passes or it determines it needs human guidance.

Key Features at a Glance

AI-Native by Design

Windsurf is a full VS Code-compatible editor with AI integrated at every layer -- not bolted on as a plugin. Completion, chat, refactoring, and agentic flows are all first-class features of the editor itself.

Cascade Agentic Engine

Cascade maintains a semantic understanding of your entire codebase. It plans multi-file edits, runs terminal commands, reads test output, and iterates -- completing long-horizon tasks with minimal human steering.

Flows

Flows are Windsurf's structured agentic workflows. Describe a goal in natural language; Cascade plans and executes it. A Flow is the primary interaction mode for non-trivial development tasks.

Model Flexibility

Windsurf supports Claude, GPT-4, and Codeium's own models. Select the model per task, optimising for quality, speed, or cost. Claude is the recommended model for complex reasoning and architecture tasks.

Windsurf vs. GitHub Copilot vs. Cursor

All three are AI coding tools, but they differ fundamentally in architecture and interaction model. Understanding these differences helps you choose the right tool and set realistic expectations.

GitHub Copilot is an extension that runs inside VS Code (or JetBrains, Neovim, etc.). Its primary interaction is inline autocomplete: it predicts the next line or block of code as you type. Copilot Chat adds a conversational interface, but it operates within the constraints of an extension -- it cannot run terminal commands, edit multiple files in one action, or maintain persistent project memory. Copilot is excellent for line-level productivity but limited for complex, multi-step tasks.

Cursor is, like Windsurf, a VS Code fork with deep AI integration. Cursor's Composer feature is similar to Windsurf's Flows -- it can plan and execute multi-file edits. The key differences are in the agentic engine: Cascade's terminal integration is tighter (it can autonomously run commands and react to output in a loop), and Windsurf's Memories system provides persistent cross-session context that Cursor lacks. Cursor compensates with a strong inline diff experience and a large community.

Windsurf occupies the most "agentic" position on the spectrum. Its terminal-loop capability -- where Cascade can run a command, read the output, make changes, and re-run the command autonomously -- is the standout feature. For teams doing test-driven development, CI/CD integration, or any workflow where the AI needs to verify its own work, this loop is transformative.

FeatureWindsurfGitHub CopilotCursor
ArchitectureStandalone IDE (VS Code fork)Extension (plugin)Standalone IDE (VS Code fork)
Agentic multi-file editsNative (Cascade)LimitedYes (Composer)
Terminal integrationFull (run + react + loop)NoPartial
Codebase semantic indexYesPartialYes
Memory across sessionsYes (Memories)NoLimited
Model choiceClaude, GPT-4, CodeiumGPT-4 onlyClaude, GPT-4
IDE baseVS Code forkVS Code extensionVS Code fork
Project rules file.windsurfrulesNo equivalent.cursorrules
Autonomous test loopYes (run-fail-fix-run)NoPartial
Pricing (as of 2025)Free tier + Pro$10-19/mo per seatFree tier + Pro

When to Choose Windsurf

Windsurf is the strongest choice when your workflow involves:

  • Multi-file feature implementation: You describe a feature and expect the AI to scaffold models, services, routes, and tests across multiple files.
  • Test-driven development: The autonomous terminal loop means Cascade can write tests, run them, see them fail, implement code, re-run, and iterate until green.
  • Small teams with large codebases: When you need one developer to do the work of three, Cascade's agentic capabilities handle the repetitive expansion work.
  • Convention-heavy projects: The .windsurfrules file and Memories system mean Cascade learns and enforces your team's specific patterns.

Windsurf is less differentiated for simple autocomplete-style coding (all three tools are comparable for line-level suggestions) or if your organisation mandates a specific IDE that is not VS Code-based.

Architecture Overview

Windsurf's architecture has three layers that work together:

Diagram -- Windsurf Architecture Layers
+----------------------------------------------------------+
|                    Windsurf Editor UI                      |
|  (VS Code fork: editor, file tree, terminal, extensions)  |
+----------------------------------------------------------+
                          |
                          v
+----------------------------------------------------------+
|                   Cascade Engine                          |
|  +-------------+  +-----------+  +-------------------+   |
|  | Semantic     |  | Planning  |  | Terminal           |   |
|  | Index        |  | Engine    |  | Integration        |   |
|  | (codebase    |  | (multi-   |  | (run commands,     |   |
|  |  graph)      |  |  step)    |  |  read output)      |   |
|  +-------------+  +-----------+  +-------------------+   |
|  +-------------+  +-----------+  +-------------------+   |
|  | Memories     |  | Context   |  | Model Router       |   |
|  | (persistent  |  | Manager   |  | (Claude, GPT-4,    |   |
|  |  facts)      |  | (@, pins) |  |  Codeium)          |   |
|  +-------------+  +-----------+  +-------------------+   |
+----------------------------------------------------------+
                          |
                          v
+----------------------------------------------------------+
|                  LLM Provider APIs                        |
|   Anthropic (Claude)  |  OpenAI (GPT-4)  |  Codeium      |
+----------------------------------------------------------+

The Editor UI is what you interact with directly -- it looks and feels like VS Code. The Cascade Engine sits between the UI and the LLM providers, handling codebase indexing, context assembly, plan generation, and terminal orchestration. The LLM Provider APIs are the actual language models that generate code and reasoning. Cascade's job is to send the right context to the right model and orchestrate the result into coherent multi-file edits.

The Interaction Modes

Windsurf provides four ways to interact with Cascade, each suited to different task types:

ModeShortcutBest ForEdits Files?
FlowsCmd+IMulti-file features, refactors, migrationsYes (multi-file)
ChatCmd+LUnderstanding code, exploring architectureNo
Slash CommandsSelect + /Single-function tasks: fix, test, explainYes (single file)
Inline CompletionTab to acceptLine-level autocomplete while typingYes (current line/block)

The golden rule: use the lightest-weight mode that gets the job done. Do not start a Flow to fix a typo -- use inline completion. Do not use inline completion to implement a feature across five files -- use a Flow. Matching mode to task is the single biggest factor in productive Windsurf usage.

i
Model Selection Per Task

For complex architecture and reasoning tasks (system design, debugging intricate issues, writing nuanced prompts), select Claude as your model. For fast utility tasks (simple completions, boilerplate generation, formatting), Codeium's own model or GPT-4 may be faster and cheaper. You can switch models per interaction -- you are not locked in for the whole session.

The .windsurfrules File

One of Windsurf's most impactful features is the .windsurfrules file -- a plaintext file you place in your project root that tells Cascade about your project's conventions. Cascade reads this file automatically for every interaction. Think of it as the briefing document you would give a new developer on day one: what stack you use, how code is structured, what patterns to follow, and what anti-patterns to avoid.

A good .windsurfrules file contains:

  • Stack declaration: Language version, framework, ORM, test runner, and key libraries
  • Architecture rules: Where business logic lives, how data access is structured, which layer calls which
  • Coding conventions: Naming patterns, docstring style, logging approach, error handling
  • Forbidden patterns: Anti-patterns your team has identified, deprecated APIs, things that "look right" but cause problems in your specific codebase

Without a .windsurfrules file, Cascade generates generic code that follows common best practices. With one, it generates code that follows your team's specific practices. The difference is the difference between "this looks right" and "this fits perfectly into our codebase." Module 28 (Context and Memory) covers .windsurfrules in full detail.

i
Where Windsurf Fits in the AI Coding Landscape

The AI coding tool landscape is evolving rapidly. Windsurf's position is "most agentic" -- it is optimised for developers who want to delegate multi-step tasks and have the AI verify its own work. If your workflow is primarily autocomplete-driven (typing code and accepting suggestions), Copilot is a lighter-weight choice. If you want agentic capabilities with a strong community and ecosystem, Cursor is a strong alternative. Windsurf's differentiator is the terminal loop and Memories system. The best approach: try all three on a real task and see which matches your workflow.

ShopMate -- First Windsurf Flow

Text -- Your First ShopMate Flow (Cmd+I)
# Open the shopmate/ folder in Windsurf, press Cmd+I, and type:

Add a wishlist notification feature to ShopMate.

When a product comes back into stock, ShopMate should send an email
to all customers who have it on their wishlist.

Email should:
- Have subject: "[product name] is back in stock!"
- Be written in ThreadCo's friendly brand voice (see .windsurfrules)
- Include the product price, available sizes, and a shop link
- Be generated by Claude, not hardcoded

Implementation:
- Function: generate_restock_email(product: dict, customer_name: str) -> str
- In: shopmate/emails/restock.py
- Tests: tests/test_restock_email.py -- mock the Claude call with respx
- Tests should verify: subject line, customer name personalisation, product details present

Follow conventions in .windsurfrules.

What to Expect When You Run This Flow

When you submit the prompt above, Cascade will:

  1. Read .windsurfrules to understand your project conventions
  2. Scan the existing codebase for patterns (how other features are structured, how tests are written, how Claude API calls are wrapped)
  3. Present a plan: "I will create shopmate/emails/restock.py with the generate_restock_email function, create tests/test_restock_email.py with 4 test cases, and update shopmate/api/main.py with a new endpoint"
  4. Execute the plan, creating or modifying each file
  5. Run pytest tests/test_restock_email.py in the terminal
  6. If tests fail, read the output and fix the issue automatically

The entire process typically takes 30-90 seconds for a feature of this scope. You watch the plan, review the diff, and accept or reject.

Getting Started: Your First 30 Minutes

Here is a structured approach to your first session with Windsurf, designed to build familiarity with each layer of the tool:

  1. Minutes 1-5: Open and Index. Open your project in Windsurf. Watch the status bar as the semantic index builds. For a typical project (1,000-10,000 files), indexing takes 30-120 seconds. You can start using Windsurf immediately -- the index builds in the background.
  2. Minutes 5-10: Explore with Chat. Press Cmd+L and ask: "Give me a 3-sentence summary of this project's architecture." Then ask: "What are the main entry points?" This tests the semantic index and gives you a baseline for Cascade's understanding of your project.
  3. Minutes 10-15: Try Inline Completions. Open a file you are working on and start typing a new function. Observe how Cascade completes based on surrounding context. Accept a few completions with Tab. Reject others with Escape. Get a feel for the completion quality.
  4. Minutes 15-20: Use a Slash Command. Select a function and type /explain. Then select another function and type /test. See how the output compares to what you would write manually.
  5. Minutes 20-25: Create a .windsurfrules File. Create a .windsurfrules file in your project root with 5-10 rules about your project's conventions. This immediately improves all future Cascade interactions.
  6. Minutes 25-30: Run Your First Flow. Press Cmd+I and describe a small feature or improvement. Review the plan, then let Cascade execute it. Check the tests. Review the diff.
!
Start Small

Your first Flow should be a small, reversible change -- not a major feature. This lets you learn the review and accept/reject workflow without risk. Once you are comfortable with the process, scale up to larger tasks. Think of your first few Flows as calibration: you are learning what Cascade does well, where it needs guidance, and how to write effective prompts for your specific codebase.

Key Terminology Reference

TermDefinition
CascadeWindsurf's AI engine that powers all intelligent features (completions, chat, flows, commands)
FlowA multi-step agentic workflow triggered by Cmd+I. Cascade plans and executes across multiple files.
Semantic IndexWindsurf's understanding of your codebase: symbols, relationships, patterns, and concepts
MemoriesPersistent facts about your project that Cascade remembers across sessions
.windsurfrulesA project-root file defining coding conventions, architecture rules, and forbidden patterns
Pinned ContextFiles explicitly pinned to always be included in Cascade's context for the current session
@ MentionA reference to a specific file or symbol in a prompt, guaranteeing it is included in context
Terminal LoopCascade's ability to run commands, read output, make changes, and re-run autonomously

Hands-On Exercises

i
Exercise 1: Install and Explore

Download Windsurf from windsurf.com. Open a project you are currently working on. Observe the indexing indicator in the bottom status bar as it builds the semantic index. Once indexing is complete, press Cmd+L (Chat) and ask: "What is the overall architecture of this project? List the main modules and their responsibilities." Compare the answer to your own understanding of the project. Note any files or relationships Cascade missed.

i
Exercise 2: Compare the Modes

Pick a small, well-understood function in your project. Perform the same task using all four modes: (1) Use inline completion to add a docstring by starting to type one. (2) Select the function and use /explain to get an explanation. (3) Use Chat to ask "How does [function name] work and what calls it?" (4) Use a Flow to add comprehensive tests for it. Compare the experience and output quality of each mode. Which felt most natural for this task?

i
Exercise 3: First Real Flow

Choose a small feature or improvement you have been meaning to add to a project. Write a Flow prompt following the structure in the ShopMate example above: describe the feature, specify the files and function signatures, list what the tests should verify, and reference any conventions. Submit it and observe Cascade's plan before it executes. Did the plan match your expectations? Were there files you forgot to mention that Cascade found on its own?

i
Exercise 4: The Comparison Test

If you currently use Copilot or Cursor, try implementing the same feature in both your current tool and Windsurf. Time yourself. Track: (a) how many manual interventions you needed, (b) whether the AI found the right files on its own, (c) whether tests passed on the first run. This is not about declaring a winner -- it is about understanding where each tool excels for your specific workflow.

i
Exercise 5: Model Selection Experiment

Run the same Flow prompt three times, each with a different model (Claude, GPT-4, Codeium). Compare the results on three axes: code quality (does it follow your conventions?), speed (how long did it take?), and completeness (did it create all the files and tests you asked for?). This will help you develop intuition for which model to use for which task type in your daily work.