Memories & Rules
Memories
is the system for sharing and persisting context across conversations.
There are two mechanisms for this in Windsurf: Memories, which can be automatically generated by Cascade, and rules, which are manually defined by the user at both the local and global levels.
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 that they were created in and Cascade will retrieve them when it believes that they are relevant. Memories generated in one workspace will not be available in another.
Managing Memories
The Memories panel can be accessed at any time by clicking on “Windsurf - Settings” in the bottom-right hand corner, selecting the “Settings” tab, and clicking “Manage” next to “Cascade-Generated Memories”. Alternatively, you can access the Memories panel by clicking the three dots in the top right corner of the Cascade window, and selecting “Manage Memories”.
.windsurfrules
Users can explicitly define their own rules for Cascade to follow. Cascade will be aware of your rules at all times, even if you change them in the middle of your conversation, and will try its best to follow them.
Rules are defined in designated rule files:
global_rules.md
- rules applied across all workspaces
.windsurfrules
- rules for the local workspace that the .windsurfrules
file is in
To ensure that the rules are only applied to your local project, add .windsurfrules
to your project’s .gitignore
.
Edit these rules files by clicking on the Windsurf - Settings menu, select the “Settings” tab, and clicking “Edit Rules” next to either Set Global AI Rules
or Set Workspace AI Rules
.
global_rules.md
and .windsurfrules
are limited to 6000 characters each. Any content above 6000 characters will be truncated and Cascade will not be aware of them.If your window has multiple workspaces, the .windsurfrules
from each workspace will be applied. If the total of your global rules and local rules exceed 12,000 characters, priority will be given to the global rules, followed by the workspace rules. Any rules beyond 12,000 characters will be truncated.
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: