The short answer
Windsurf forgets project rules because .windsurfrules and global_rules.md are static text injected at the top of every chat, both have a practical character cap of around 6,000 characters, and Cascade auto-summarizes long sessions — which compresses rule detail into a one-line restatement. A retrievable project memory keeps rules enforceable on every turn.
Why Windsurf forgets project rules
Cascade does try to obey your rules. Three mechanics quietly undermine it:
1. Rules are a prefix, not active memory. .windsurfrules and global_rules.md are prepended to your prompt. Cascade reads them once at the start of the session. They live in the same context window as your code and your conversation, and they compete for room as the session grows.
2. The rules files are capped. Windsurf documents a practical limit of around 6,000 characters per file before rules start losing effect. Combine workspace rules, global rules, and the AGENTS.md convention some teams use, and you can hit the ceiling in one sprint.
3. Summarization compresses rule detail. Codeium has acknowledged in its changelog that prior Cascade summarization was aggressive enough to drop important context. Even with improvements, summary passes are lossy. A 12-line rule on safe DB operations can come back through summarization as "be careful with the database" — which is not a rule, it is a vibe.
The result: rules work for a while, drift gradually, and fail at the worst time.
What you lose when Windsurf forgets project rules
A rule that does not stick is worse than no rule at all — it gives a false sense of safety:
- Unsafe operations slip through. The "never touch prod" rule that worked on turn 5 quietly fails on turn 40, when Cascade is deep in a refactor and proposes exactly the operation you forbade.
- House conventions go out the window. "Always use server actions for mutations" works for the first three files. By the sixth, Cascade is reaching for an old API route pattern because rule detail got summarized away.
- You re-state the same rule, every session, forever. And the moment you forget to re-state it, Cascade reverts to defaults.
Windsurf's built-in workarounds (and where each falls short)
Windsurf has three native mechanisms for rules. Each helps; none holds the line on its own.
`.windsurfrules` (workspace) is the per-repo rules file. Cascade loads it every session. It is static, capped, and competes with conversation for context room. Long sessions compress it.
`global_rules.md` (cross-workspace) lives in your Windsurf config and applies everywhere. Same shape, same cap, same compression problem.
Cascade Memories auto-generate short workspace-scoped notes during chats. Useful for "remember user runs pnpm test". Not useful for nuanced project rules that span multiple lines or include examples.
You can read the official Cascade Memories docs for the full feature breakdown.
For a handful of stable rules, the natives work. For a real project rulebook that evolves week to week, they fall short.
Where Windsurf's built-in memory falls short
Project rules live above the editor. The "never touch prod" rule applies whether you are in Cascade, Cursor, Claude Code, or ChatGPT. .windsurfrules does not travel to any of them. Each tool gets its own copy, those copies drift, and the project loses its single source of truth.
Rules belong to the project. Memory needs to live with the project, not the editor.
How MemoryLake fixes Windsurf forgetting project rules
MemoryLake is a cross-model memory layer that connects to Windsurf via Cascade's native MCP support. Instead of prepending a truncated rules string, you load the full rulebook into a project, and Cascade retrieves the relevant rule per turn.
- Rules as retrievable memory, not a prepended string. Load your full rulebook — DB safety, branch hygiene, deploy checks, naming, testing — into the project. Cascade pulls the relevant rule at the moment of decision, so the rule does not have to fight for context room.
- 10,000× more context than raw prompting. MemoryLake's retrieval engine reads from billions of tokens of project memory and surfaces what is relevant per turn. No more 6,000-character cap.
- One rulebook, every AI tool. The same rules govern Cursor, Claude Code, ChatGPT, Claude Desktop, and Gemini. When the rule changes once, it changes everywhere.
MemoryLake scored 94.03% on the LoCoMo long-context benchmark — the top published result as of 2026 — with millisecond retrieval and AES-256 end-to-end encryption.
Connect MemoryLake to Windsurf in 3 steps
- Create a project and load your rulebook. Sign in to MemoryLake, open Project Management, click Create Project, and name it after your repo (e.g., "acme-platform — project rules"). Upload your existing
.windsurfrules,AGENTS.md, runbooks, and safety docs through the Document Drive (PDF, Markdown, Word, Excel, images all supported). Add short imperative rules in the Memories tab — one rule per memory works well for retrieval. - Generate an MCP Server endpoint. Open the MCP Servers tab inside your project, click Add MCP Server, name it "Windsurf integration", and click Generate. MemoryLake returns an API key ID, secret, and endpoint URL. Copy the secret immediately — it is shown only once.
- Add the server to Cascade's MCP config. In Windsurf, open Settings → Cascade → Manage MCPs → View raw config, then add a
memorylakeentry with the endpoint URL and your Bearer token. Save and restart Cascade. Cascade now has amemorylaketool it can call to fetch the applicable rule whenever it is about to take a risky action.