MemoryLake
Back to all articles
Pain PointMay 22, 20267 min read

Why does Windsurf forget my project rules?

You have a `.windsurfrules` file at the root of your repo. It says, clearly: "Never write to `prod_*` tables without a confirmation prompt." Cascade reads it on turn 1, agrees enthusiastically, and on turn 38 cheerfully proposes a `DELETE FROM prod_users` without a single asterisk of warning.

The rules file is real. Cascade saw it. So what happened?

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

  1. 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.
  2. 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.
  3. Add the server to Cascade's MCP config. In Windsurf, open Settings → Cascade → Manage MCPs → View raw config, then add a memorylake entry with the endpoint URL and your Bearer token. Save and restart Cascade. Cascade now has a memorylake tool it can call to fetch the applicable rule whenever it is about to take a risky action.

Frequently asked questions

Does Windsurf remember project rules?

Windsurf loads .windsurfrules (workspace) and global_rules.md (global) into every Cascade chat. Cascade follows them at the start of a session. As long sessions auto-summarize earlier context, rule detail can get compressed, which is why detailed rules often drift partway through.

How do I make Cascade follow my project rules consistently?

Connect Cascade to an external memory layer like MemoryLake through Windsurf's native MCP support. Rules live in the project memory as retrievable items, so Cascade can fetch the specific rule that applies to the current action instead of relying on a prepended string that competes with everything else for context.

Why does Cascade ignore my .windsurfrules file?

It is usually not ignored at the start — it is compressed later. Windsurf has a practical cap of around 6,000 characters per rules file, and long sessions summarize earlier turns aggressively. A 12-line rule can come back as a vague paraphrase that no longer carries enforceable detail.

What is the difference between .windsurfrules and global_rules.md?

.windsurfrules lives in your repo and applies only to that workspace. global_rules.md lives in your Windsurf config and applies everywhere. Both have the same character cap, both load as static text, and both face the same summarization drift in long sessions.

Can I share my project rules between Windsurf and Cursor?

.windsurfrules and .cursorrules are tool-specific and do not transfer. MemoryLake stores rules in a model-neutral Project, so the same rulebook works in Windsurf, Cursor, Claude Code, Claude Desktop, ChatGPT, and any tool that speaks MCP or REST.