Windsurf .windsurfrules / .windsurf/rules Not Working — Character Cap, Trigger Mode & Fix
Symptom: Windsurf Cascade ignores workspace rules or silently truncates your .windsurf/rules/*.md file.
Windsurf enforces tight size ceilings on workspace rules (6,000 characters per individual rule file and 12,000 characters total across active rules) and requires valid trigger frontmatter (always_on, glob, model_decision, or manual) inside .windsurf/rules/*.md. Split oversized files, pick the right trigger mode, or keep shared rules in AGENTS.md.
Broken vs. Fixed Configuration
# .windsurf/rules/backend.md (15,200 chars, no trigger header) Always follow these 300 backend guidelines...
# .windsurf/rules/backend.md (1,400 chars) --- trigger: glob globs: src/server/**/*.ts description: Server API validation and error handling rules --- - Run fast API check: npx vitest run src/server/orders.test.ts - Map all DB errors through toHttpError() before returning responses.
Why This Happens
Teams copy a 20,000-char CLAUDE.md directly into .windsurfrules or omit the trigger: frontmatter key when migrating into .windsurf/rules/*.md, causing Cascade to truncate or never activate the rule.
Step-by-Step Fix
- 01Check the 6,000-char per-file and 12,000-char total limit
Use the AgentLint Token Counter to confirm every Windsurf rule stays well under 6,000 characters.
- 02Set explicit trigger frontmatter in .windsurf/rules/*.md
Use trigger: glob with globs: src/**/*.ts for scoped rules, or trigger: always_on for compact global rules.
- 03Adopt AGENTS.md for cross-IDE teams
Keep universal commands in AGENTS.md so Windsurf, Cursor, Codex, and Claude Code share one compact truth.
Automated AgentLint Checks That Catch This
Frequently Asked Questions
Should I still use .windsurfrules or migrate to .windsurf/rules/*.md?
Migrate to modular .windsurf/rules/*.md files with trigger: glob so you stay well beneath the 6,000-char per-rule cap.
Does Windsurf support AGENTS.md?
Yes. Windsurf Cascade reads AGENTS.md at the workspace root, making AGENTS.md ideal for shared team commands.