This document describes the foundational architecture of Cascade, Windsurf's agentic AI coding assistant, with specific focus on the AI Flow paradigm that distinguishes it from traditional AI assistants. The page covers Cascade's identity, operational model, core architectural components, and the revolutionary paradigm that enables both autonomous and collaborative work modes. For detailed information about Cascade's specific tool implementations, see Tool Ecosystem and Categories. For browser interaction capabilities, see Browser Preview and Page Interaction.
Sources: Windsurf/Prompt Wave 11.txt1-126
Cascade is identified as "the world's first agentic coding assistant" developed by the Windsurf engineering team in Silicon Valley, California. The system operates on what it calls the "revolutionary AI Flow paradigm," which fundamentally differs from traditional request-response AI models by enabling the agent to work both independently and collaboratively with users.
The AI Flow paradigm represents a shift from purely reactive assistants to proactive agents that can:
Sources: Windsurf/Prompt Wave 11.txt3-5
Diagram: Comparison of Traditional Request-Response Model vs AI Flow Paradigm
The key distinction is that AI Flow enables continuous agent operation within a single user turn, with the agent working "until the user's query is completely resolved, before ending your turn and yielding control back to the user."
Sources: Windsurf/Prompt Wave 11.txt4-5 Windsurf/Prompt Wave 11.txt14
Cascade's operational model is defined by several critical autonomy principles:
| Autonomy Aspect | Implementation | Citation |
|---|---|---|
| Code Research | Proactively search codebase without asking permission | Windsurf/Prompt Wave 11.txt98-101 |
| Memory Creation | Create memories immediately upon encountering important context | Windsurf/Prompt Wave 11.txt89-94 |
| Terminal Commands | Run safe commands automatically; require approval for unsafe operations | Windsurf/Prompt Wave 11.txt103-109 |
| External APIs | Select and use best-suited APIs without explicit permission | Windsurf/Prompt Wave 11.txt114-115 |
| Browser Preview | Automatically invoke after starting web servers | Windsurf/Prompt Wave 11.txt111 |
| Plan Updates | Update project plan whenever scope or direction changes | Windsurf/Prompt Wave 11.txt123-125 |
The system distinguishes between operations that are "safe to auto-run" and those requiring user confirmation. Commands with "destructive side-effects" (deleting files, mutating state, installing system dependencies, making external requests) are classified as unsafe and must never be executed automatically, even if the user requests it.
Sources: Windsurf/Prompt Wave 11.txt103-109 Windsurf/Prompt Wave 11.txt114-117
Diagram: Command Safety Classification and Execution Flow
Sources: Windsurf/Prompt Wave 11.txt106-108
Cascade maintains awareness of the user's environment through metadata attached to each request. This includes:
windows)The workspace architecture uses a mapping structure where multiple URIs can map to the same CorpusName, enabling unified context across related directories.
Sources: Windsurf/Prompt Wave 11.txt8-12
Diagram: User Context and Workspace Architecture
Sources: Windsurf/Prompt Wave 11.txt8-12
Cascade's architecture centers on a tool-based execution model where capabilities are exposed through discrete, callable tools. The system follows strict rules for tool invocation:
Sources: Windsurf/Prompt Wave 11.txt13-22
Diagram: Tool Invocation Decision Flow
Sources: Windsurf/Prompt Wave 11.txt17-22
The code editing system enforces strict principles to ensure generated code is "immediately runnable":
Diagram: Code Editing Pipeline with Runnability Guarantees
Key constraints:
TargetFile argument first, before any other arguments"Sources: Windsurf/Prompt Wave 11.txt45-79
The planning system is managed by a "plan mastermind" that updates the project plan through the update_plan tool. The system mandates plan updates in several scenarios:
| Update Trigger | Description | Priority |
|---|---|---|
| New User Instructions | When receiving new directives from user | High |
| Completed Items | After finishing tasks from the plan | Medium |
| Scope Changes | When learning information that changes project direction | Critical |
| Before Significant Actions | Before major research or code writing | High |
| After Major Work | Before ending turn after completing substantial work | Medium |
The philosophy is: "It is better to update plan when it didn't need to than to miss the opportunity to update it." The plan must "always reflect the current state of the world before any user interaction."
Sources: Windsurf/Prompt Wave 11.txt123-125
Diagram: Planning System Architecture with update_plan Tool Integration
Sources: Windsurf/Prompt Wave 11.txt123-125
The memory system provides persistent context storage with a liberal creation policy. The system design addresses the fundamental limitation: "Remember that you have a limited context window and ALL CONVERSATION CONTEXT, INCLUDING checkpoint summaries, will be deleted."
Cascade's memory system operates under these principles:
Users can reject memories that don't align with their preferences, providing feedback to the system.
Sources: Windsurf/Prompt Wave 11.txt87-97
Diagram: Memory System with Persistent Storage and Context Window Management
Sources: Windsurf/Prompt Wave 11.txt87-97
The command execution system includes critical architectural decisions:
CRITICAL CONSTRAINT: "When using the run_command tool NEVER include cd as part of the command. Instead specify the desired directory as the cwd (current working directory)."
This design separates directory context from command execution, likely to:
Sources: Windsurf/Prompt Wave 11.txt104
Diagram: Command Execution with CWD Separation Pattern
Sources: Windsurf/Prompt Wave 11.txt104
The browser preview system has a mandatory invocation rule: "The browser_preview tool should ALWAYS be invoked after running a local web server for the USER with the run_command tool."
This rule ensures automatic preview capability when web servers are started, but explicitly excludes non-web applications (pygame apps, desktop apps).
Diagram: Browser Preview Automatic Invocation Logic
Sources: Windsurf/Prompt Wave 11.txt110-112
Cascade implements a proactive external API strategy:
This design philosophy aligns with the AI Flow paradigm's emphasis on autonomous operation, enabling the agent to make architectural decisions independently.
Sources: Windsurf/Prompt Wave 11.txt113-117
Cascade follows specific communication standards:
| Aspect | Standard | Citation |
|---|---|---|
| Person Reference | Refer to USER in second person, self in first person | Windsurf/Prompt Wave 11.txt119-120 |
| Format | All responses in markdown | Windsurf/Prompt Wave 11.txt120 |
| Code References | Use backticks for files, directories, functions, classes | Windsurf/Prompt Wave 11.txt120 |
| URLs | Format URLs in markdown | Windsurf/Prompt Wave 11.txt120 |
| Code Output | NEVER output code to user unless requested; use edit tools instead | Windsurf/Prompt Wave 11.txt46 |
Sources: Windsurf/Prompt Wave 11.txt46 Windsurf/Prompt Wave 11.txt119-121
The architecture includes an ephemeral message channel: "There will be an <EPHEMERAL_MESSAGE> appearing in the conversation at times. This is not coming from the user, but instead injected by the system as important information to pay attention to."
The agent must:
This provides a back-channel for system-level communication separate from user interaction.
Sources: Windsurf/Prompt Wave 11.txt122
When debugging, Cascade follows specific best practices:
This conservative approach prevents thrashing and focuses on understanding before action.
Sources: Windsurf/Prompt Wave 11.txt80-86
Diagram: Debugging Decision Flow with Best Practices
Sources: Windsurf/Prompt Wave 11.txt80-86
When asked about the underlying model, Cascade responds with GPT 4.1, indicating the base LLM powering the system. The knowledge cutoff is June 2024.
Sources: Windsurf/Prompt Wave 11.txt1 Windsurf/Prompt Wave 11.txt14
Refresh this wiki