Memories is the system for sharing and persisting context across conversations.
There are two mechanisms for this in Windsurf: Memories, which are automatically generated by Cascade, and Rules, which are manually defined by the user at the global, workspace, or system level.
Memories, Rules, Workflows, or Skills?
Windsurf offers several ways to customize Cascade. Use this table to pick the right one:| Feature | What it does | How it’s activated | When to use it |
|---|---|---|---|
| Rules | Tell Cascade how to behave (e.g. “use bun, not npm”) | always_on, glob, model_decision, or manual (see below) | Coding conventions, style guides, project constraints |
| AGENTS.md | Location-scoped rules with zero config | Automatic — root = always-on, subdirectory = glob | Directory-specific conventions without frontmatter |
| Workflows | Prompt templates for repeatable multi-step tasks | Manual only via /[workflow-name] slash command | Deployments, PR reviews, release checklists |
| Skills | Multi-step procedures bundled with supporting files (scripts, templates) | Dynamically invoked by the model, or @mention | Complex tasks where Cascade needs reference files — invest here |
| Memories | Context Cascade auto-generates during conversations | Automatic retrieval when relevant | Let Cascade remember one-off facts; for durable knowledge, prefer Rules or AGENTS.md |
How to Manage Memories
Memories and Rules can be accessed and configured at any time by clicking on theCustomizations icon in the top right slider menu in Cascade, or via “Windsurf - Settings” in the bottom-right hand corner. To edit an existing memory, simply click into it and then click the Edit button.
Memories
During conversation, Cascade can automatically generate and store memories if it encounters context that it believes is useful to remember. Additionally, you can ask Cascade to create a memory at any time. Just prompt Cascade to “create a memory of …”. Cascade’s autogenerated memories are associated with the workspace they were created in and are stored locally in~/.codeium/windsurf/memories/. Cascade retrieves them when it believes they’re relevant. Memories generated in one workspace are not available in another, and they are not committed to your repository.
Auto-generated memories live only on your machine. If you want Cascade to remember something durably — and share it with your team — ask Cascade to write it to a Rule in
.windsurf/rules/ or to your repo’s AGENTS.md instead.Rules
Users can explicitly define their own rules for Cascade to follow. Rules can be defined at the global, workspace, or system level, and can also be inferred from AGENTS.md files.| Scope | Location | Notes |
|---|---|---|
| Global | ~/.codeium/windsurf/memories/global_rules.md | Single file, applied across all workspaces. Always on. Limited to 6,000 characters. |
| Workspace | .windsurf/rules/*.md | One file per rule, each with its own activation mode. Limited to 12,000 characters per file. |
| AGENTS.md | Any directory in your workspace | Processed by the same Rules engine — root-level = always-on, subdirectory = auto-glob for that directory. |
| System (Enterprise) | OS-specific (e.g. /etc/windsurf/rules/) | Deployed by IT, read-only for end users. |
Rules Discovery
Windsurf automatically discovers rules from multiple locations to provide flexible organization:- Current workspace and sub-directories: All
.windsurf/rulesdirectories within your current workspace and its sub-directories - Git repository structure: For git repositories, Windsurf also searches up to the git root directory to find rules in parent directories
- Multiple workspace support: When multiple folders are open in the same workspace, rules are deduplicated and displayed with the shortest relative path
Rules Storage Locations
Rules can be stored in any of these locations:.windsurf/rulesin your current workspace directory.windsurf/rulesin any sub-directory of your workspace.windsurf/rulesin parent directories up to the git root (for git repositories)
.windsurf/rules directory of your current workspace, not necessarily at the git root.
To get started with Rules, click on the Customizations icon in the top right slider menu in Cascade, then navigate to the Rules panel. Here, you can click on the + Global or + Workspace button to create new rules at either the global or workspace level, respectively.
Workspace rule files are limited to 12,000 characters each. The global rules file is limited to 6,000 characters.
Activation Modes
Each workspace rule declares an activation mode in its frontmatter via thetrigger field. This controls when the rule’s content is given to Cascade and how much context window it consumes:
| Mode | trigger: value | How it reaches Cascade | Context cost |
|---|---|---|---|
| Always On | always_on | Full rule content is included in the system prompt on every message. | Every message |
| Model Decision | model_decision | Only the description is shown in the system prompt. Cascade reads the full rule file when it decides the description is relevant. | Description always; full content on demand |
| Glob | glob | Rule is applied when Cascade reads or edits a file matching the globs pattern (e.g. *.js, src/**/*.ts). | Only when matching files are touched |
| Manual | manual | Rule is not in the system prompt. You activate it by typing @rule-name in the Cascade input box. | Only when @mentioned |
The global rules file (
global_rules.md) and root-level AGENTS.md files don’t use frontmatter — they are always on.Best Practices
To help Cascade follow your rules effectively, follow these best practices:- Keep rules simple, concise, and specific. Rules that are too long or vague may confuse Cascade.
- There’s no need to add generic rules (e.g. “write good code”), as these are already baked into Cascade’s training data.
- Format your rules using bullet points, numbered lists, and markdown. These are easier for Cascade to follow compared to a long paragraph. For example:
- XML tags can be an effective way to communicate and group similar rules together. For example:
System-Level Rules (Enterprise)
Enterprise organizations can deploy system-level rules that apply globally across all workspaces and cannot be modified by end users without administrator permissions. This is ideal for enforcing organization-wide coding standards, security policies, and compliance requirements. System-level rules are loaded from OS-specific directories: macOS:.md files) in the appropriate directory for your operating system. The system will automatically load all .md files from these directories.
How System Rules Work
System-level rules are merged with workspace and global rules, providing additional context to Cascade without overriding user-defined rules. This allows organizations to establish baseline standards while still permitting teams to add project-specific customizations. In the Windsurf UI, system-level rules are displayed with a “System” label and cannot be deleted by end users.Important: System-level rules should be managed by your IT or security team. Ensure your internal teams handle deployment, updates, and compliance according to your organization’s policies. You can use standard tools and workflows such as Mobile Device Management (MDM) or Configuration Management to do so.