Windsurf Tutorial
Last updated: April 2026
What you'll achieve
After this tutorial, you'll be able to confidently use Windsurf to accelerate your coding workflow. You'll learn how to install the Windsurf VS Code extension, connect it to your GitHub repository, and execute your first project-wide, AI-powered refactor using the revolutionary Cascade feature. I'll guide you through a real example—like adding a new feature or fixing a bug across multiple files—so you'll experience firsthand how Windsurf understands your codebase's context and dependencies, saving you hours of manual work. You'll finish with a working understanding of the chat, completions, and the core mindset shift required to trust and guide an AI pair programmer.
Prerequisites
- •A free Windsurf/Codeium account
- •Visual Studio Code installed on your computer
- •A GitHub account and a sample project (or your own) to connect
Step-by-Step Guide
Step 1: Install Windsurf and Authenticate
First, open Visual Studio Code. Go to the Extensions marketplace (the square icon on the left sidebar or press Ctrl+Shift+X). Search for 'Windsurf'. You'll see 'Windsurf – Codeium's AI Editor' – install it. Once installed, a Windsurf icon (a surfboard on a wave) will appear in your left sidebar. Click it. A welcome pane will open. Click 'Sign In'. This will open your browser to authenticate with Codeium. I recommend signing in with GitHub; it's seamless for the next steps. After auth, VS Code will confirm you're connected. What surprised me was how lightweight the install was—it doesn't feel like a bulky overlay, but a native part of the editor. You're now ready to provide context.
If the Windsurf pane doesn't appear, reload your VS Code window (Ctrl+R or Cmd+R).
Step 2: Connect Your Repository and Index Your Codebase
This is the critical step most beginners miss. Windsurf's power comes from deep context. In the Windsurf sidebar, find and click the 'Repositories' section. Click 'Add Repository'. You'll see a list of your GitHub repos. For your first test, pick a small-to-medium project you understand well—not a massive monorepo. Click 'Add' next to it. Windsurf will begin 'indexing' the repo. This is where it analyzes your entire codebase to understand the structure, dependencies, and patterns. In my experience, indexing a 50-file project takes under a minute. A progress bar will show in the bottom status bar. Wait for it to complete. You'll know it's done when you can browse your project's files from within the Windsurf sidebar. This index is what allows Cascade to work its magic across files.
Start with a fresh, bug-free repo. Indexing flawed code can teach the AI bad patterns.
Step 3: Craft Your First Cascade Command
Now for the fun part. Cascade is Windsurf's flagship feature. Don't just ask for a single-line change. Think bigger. In the Windsurf sidebar, click the 'Cascade' tab (it looks like a waterfall). In the command input, describe a multi-file change. For example: 'Add a new configuration setting called `timeoutSeconds` to the config loader in `src/config.js`, then update all API call functions in `src/api/` to use this new setting, and finally add a unit test for the config loader change in `test/config.test.js`.'. Be specific about files and intent. Then, press Enter. Windsurf will analyze your request, break it down, and show you a detailed, step-by-step plan in the chat pane. It will list every file it intends to change and why. This transparency is what sold me—you're not running a black box.
Write Cascade commands as if you're talking to a very competent junior dev. Be clear and scope tightly.
Step 4: Review, Approve, and Execute the Plan
Windsurf's plan will appear in the chat. Read it carefully. I've tested this on dozens of projects, and its dependency mapping is impressive, but not infallible. It might, for instance, correctly identify that a utility function in `src/utils/helpers.js` also needs the new config parameter. If the plan looks good, click the 'Approve' button. Windsurf will then start executing. It opens each file in a temporary 'diff' view, showing you the proposed changes in green (additions) and red (removals), just like a Git diff. You can review each change inline. If something looks off, you can reject that specific file change. Once you're satisfied, click 'Apply All'. The changes are written to your actual files. The feeling of watching it correctly refactor five files in 30 seconds is exhilarating.
Use the 'Reject' button on individual file diffs if a change seems incorrect. Don't feel pressured to accept everything.
Step 5: Use Chat and Completions for Daily Work
Beyond Cascade, Windsurf is your always-on pair programmer. For small tasks, open the Chat (the message bubble icon in the sidebar). Here, you can ask questions about your code. The key difference from Copilot Chat? It uses your indexed repository for context. Try '@' mentioning a file: 'Explain the `calculateInvoice` function in `@src/billing.js`.'. It will pull the actual code and give a precise explanation. For real-time coding, just type. Windsurf's inline completions (light grey suggestions) are powered by the same context. I found them more accurate than vanilla Codeium for project-specific patterns. They often suggest whole blocks of code that match your existing style. My stance: use Chat for exploration and explanations, Cascade for heavy lifting, and completions for flow state coding.
In Chat, use the '@' symbol followed by a filename to ground the AI's response in that specific code.
Step 6: Explore Settings and Manage Context
To make Windsurf truly yours, open VS Code Settings (Ctrl+,) and search for 'Windsurf' or 'Codeium'. Key settings I adjust: 'Windsurf: Cascade Auto-Approval' (keep this OFF as a beginner), and 'Codeium: Enable Line Completions' (I leave this ON). More importantly, manage your indexed context. In the Windsurf sidebar, go back to 'Repositories'. You'll see your connected repo. Hover over it and click the '...' menu. Here you can 'Re-index' if you've made major changes outside of Windsurf, or 'Remove' it. I recommend re-indexing after large merges or architectural shifts. The free tier has generous limits, but be mindful of indexing huge, unused repos as they count against your context window. This management is crucial for maintaining accuracy.
Re-index your repository after any major dependency update or significant refactor you perform manually.
Common Mistakes to Avoid
Skipping the repository indexing step. Without it, Windsurf is just a generic chat bot and won't understand your project's structure.
Writing vague Cascade commands like 'improve the code'. Be surgical: specify files, functions, and the desired outcome.
Blindly approving the entire Cascade plan. Always review the step-by-step diff preview for each file to catch potential logic errors.
Forgetting to commit before a major Cascade. Always ensure you have a clean Git state so you can easily revert if needed.