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

Why does Windsurf forget my coding style?

You spent half a Friday teaching Cascade your house style: no default exports, named exports only, Zod schemas in `lib/schemas/`, snake_case in Postgres, camelCase in app code, and please stop wrapping single statements in braces. By Monday morning, Cascade is generating default exports again. The `.windsurfrules` file is right there in your repo. It still does not stick.

This is not a Cascade bug. It is how Windsurf's memory model handles style. Here is what is happening and how to make style choices actually persist.

The short answer

Windsurf forgets coding style because .windsurfrules is static text loaded into every chat — not active memory — and Cascade Memories are short auto-generated notes, not a structured style guide. As the context window fills, even loaded rules get compressed in summarization. A persistent project memory layer keeps style decisions retrievable on every turn.

Why Windsurf forgets coding style

Cascade does try to follow your style. Three mechanics make it slip:

1. `.windsurfrules` is read, not memorized. When you open a Cascade chat, Windsurf prepends your .windsurfrules (workspace) and global_rules.md (global) to the prompt. Cascade reads them on turn 1. Forty turns later, after Cascade has summarized the conversation to free up context, those rules can get compressed into a one-line restatement — and the specifics drift.

2. The rules file is capped. Windsurf documents a soft limit on rule length (around 6,000 characters per file is the practical ceiling before behavior degrades). Real style guides — naming, error handling, file structure, test patterns, lint exceptions — easily exceed that.

3. Auto-generated Memories are too short for style. Cascade Memories captures things like "user prefers TypeScript". It is not designed to hold a full style guide with examples. So a 30-line rule on how you handle Zod, error types, and result returns has nowhere to live durably.

The result: style works for the first few turns, then quietly drifts.

What you lose when Windsurf forgets coding style

Style drift is a slow, expensive paper-cut:

  • Inconsistent code that has to be rewritten in review. Cascade generates a default export against your house rule. Your reviewer flags it. You re-prompt. The cycle repeats next session.
  • Linter and formatter wars. Cascade follows the rule for one file and ignores it for the next, leaving you with a mixed codebase that fails CI in odd places.
  • Onboarding pain. New devs assume the AI-written code reflects house style. It does not, and now the codebase teaches new people the wrong patterns.

Windsurf's built-in workarounds (and where each falls short)

Windsurf has three native mechanisms aimed at style. Each helps; none fully solves it.

`.windsurfrules` (workspace) and `global_rules.md` (cross-workspace) are the official place for durable rules. They load into every Cascade chat. They are also static text with a soft length limit and zero retrieval — if your style guide grows past a few thousand characters, Cascade gets a truncated version. Workspace rules also do not travel between repos cleanly.

Cascade Memories auto-generate workspace-scoped notes during chats. They will quietly remember "user prefers Tailwind". They are not designed to hold an Airbnb-style style guide with 30 examples. The store at ~/.codeium/windsurf/memories/ keeps short observations, not long-form rules.

Workflows let you script repeatable agent procedures — useful for "run lint, fix, format" — but they are an execution feature, not a memory feature.

You can read the official Cascade Memories docs for the full breakdown.

For tiny style notes, the natives are fine. For a real, evolving house style, they fall short.

Where Windsurf's built-in memory falls short

The deeper issue is that style guides are project-level artifacts, not editor-level. You almost certainly use other AI tools — Cursor, Claude Code, ChatGPT for design discussions — and your style guide needs to apply to all of them. .windsurfrules does not travel. Cursor rules do not travel either. So style fragments across tools and your codebase pays the cost.

A real fix needs to be model-agnostic and project-scoped, not workspace-scoped.

How MemoryLake fixes Windsurf forgetting coding style

MemoryLake is a cross-model memory layer that connects to Windsurf via Cascade's native MCP support. Instead of relying on a static rules file that gets summarized away, you give the project its own memory, and Cascade reads style guidance from it on demand.

  • Your style guide as a first-class memory. Load the full guide — naming, error handling, file layout, examples — into the project. Cascade fetches the relevant slice per turn instead of loading a truncated string at the top of every chat.
  • 10,000× more context than raw prompting. MemoryLake's retrieval engine reads from billions of tokens of project memory and returns only the bits that matter for the current turn, so style detail does not get crowded out by code.
  • One style guide across every AI you use. The same guide governs Cursor, Claude Code, ChatGPT, Claude Desktop, and Gemini. No more divergent rules per tool, no more re-pasting the conventions every Monday.

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 style guide. Sign in to MemoryLake, open Project Management, click Create Project, and name it after your codebase (e.g., "acme-web — house style"). Upload your style guide, lint config, and any example files through the Document Drive (PDF, Markdown, Word, Excel, images all supported). Add short, durable rules ("no default exports", "Zod schemas live in lib/schemas/") in the Memories tab.
  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 pull the relevant slice of your style guide on every code-generation turn.

Frequently asked questions

Does Windsurf remember my coding style?

Windsurf loads .windsurfrules and global_rules.md into every Cascade chat, so simple style preferences usually stick for the first part of a session. Long chats summarize earlier context, and detailed style guidance often drifts because rules files have a practical length cap.

How do I make Cascade follow my house coding style consistently?

Connect Cascade to an external memory layer like MemoryLake via Windsurf's native MCP support. Your full style guide lives in the project memory and Cascade fetches the relevant slice per turn, instead of relying on a truncated rules file at the top of the prompt.

Why does Cascade keep generating code that ignores my conventions?

Because .windsurfrules is static text that competes with everything else in the context window. As Cascade summarizes long sessions, rule detail gets compressed. Cascade Memories captures only short notes, not multi-line style rules with examples.

What is the size limit on .windsurfrules?

Windsurf documents a soft cap of roughly 6,000 characters per rules file before behavior degrades. Real-world style guides easily exceed that, which is why structured style guidance benefits from sitting in a retrievable memory store instead of a single prepended string.

Can I use the same style guide in Cursor and Claude Code?

.windsurfrules does not transfer. MemoryLake stores style guidance in a model-neutral Project, so the same guide works in Windsurf, Cursor, Claude Code, Claude Desktop, ChatGPT, and any tool that speaks MCP or REST.