Demo, all content is generated
Question

Windsurf ignores everything in the bottom half of my .windsurfrules

Solved · 242 views · asked by jules_v · edited

My .windsurfrules has grown into a proper style guide (naming, folder structure, our API response shape, and at the very bottom: "never touch the /legacy folder").

Cascade follows the naming stuff at the top fine. The /legacy rule it ignores completely, it edited legacy/invoice.ts twice this week. When I asked it "what are your rules about the legacy folder" it said it doesn't have any. Like it never saw the end of the file?

What I’ve tried

Moved the legacy rule into the middle, that made it work but then a different rule at the bottom stopped working. Restarted Windsurf.

Comment
How long is the file? There's a character limit on rules. henrik_l · edited

3 answers

Marked as helpful by the asker
elif_y · edited

Your guess is right. Windsurf has a character limit on rules: roughly 6,000 characters per rule file and around 12,000 across all active rules. Anything past that is cut off without a warning.

wc -c .windsurfrules

If that's above 6000, that's your answer. Fix:

  1. Move to .windsurf/rules/ with several small files instead of one big file.
  2. Give each file an activation mode. Only the few hard rules (like the legacy folder) should be "Always On". Folder-specific stuff can be "Glob" (e.g. api/**).
  3. Put the style guide itself in a normal markdown doc and have one short rule say "for naming and folder structure, follow docs/STYLE.md".
Comment
11,240 characters. Oops. Splitting now. jules_v · edited
Update: 4 files, legacy one is 3 lines and Always On. Cascade refused to touch legacy/ today and told me why. Perfect. jules_v · edited
gus_fullstack · edited

Also: for "never touch folder X" don't rely on rules alone. A rule is a request, not a lock. Put a README in /legacy that says the same thing (agents read it when they open the folder) and add a CODEOWNERS entry so any PR that touches it needs your review.

Comment
sanne_dev · edited

Also check Cascade's auto-generated Memories (in the Customizations panel). It saved one for me like 'user prefers editing legacy files directly' after a single session, and that memory kept winning over my rule. Deleted it, problem gone.

Comment
I had 23 memories I never knew about. Some of them were wrong. jules_v · edited