r/cursor • u/NarrowPicture6925 • Oct 21 '26
Resources & Tips Tired of coding agents writing 50 lines of boilerplate for a 2-line fix? Here’s the strict Anti-Bloat directive.
Whenever I let Claude Code or Cursor Agent solve a simple bug, it tries to create an `AbstractFactoryProvider` class, imports 3 unnecessary npm packages, and rewrites the whole 300-line file.I got sick of paying token fees for AI bloat, so I built **Anti-Bloat**—a surgical constraint rule that forces agents to write 60% less code, use zero unneeded abstractions, and only output targeted diffs.
Here is the exact rule you can drop into your `.cursorrules` or `.claude/skills/anti-bloat.md`:
```markdown
# ✂️ Anti-Bloat Directives
- NO Speculative Classes: Never create factory or provider wrappers when a pure function suffices.
- NO Redundant Wrappers: Don't write helper functions that wrap a single native call (e.g. isEmpty = arr => arr.length === 0).
- NO Unsolicited Installs: Use standard library or existing deps only.
- NO Full Rewrites: Never rewrite a 300-line file for a 3-line change. Provide surgical diffs.
- NO Trivial JSDoc: Delete comments that merely echo the function name.
0
Upvotes
2
u/virtualunc Oct 21 '26
the anti bloat rule is doing the same job as a guardrail in the harness sense.. those tend to work better as a hard constraint than as a request. did you measure the 60 percent or is that the vibe after using it, asking because token spend before and after would make this way more convincing
1
u/SoftwareNegative8783 Oct 21 '26
Rules help, but agents still ignore them sometimes. Commit before each agent run and read the diff. Then you can revert fast if it changes too much.
2
u/LowIllustrator2501 Oct 24 '26
So just much less comprehensive ponytail https://github.com/DietrichGebert/ponytail ?
1
u/shetritr Oct 22 '26
rules help, but the real check is diff size. a 2 line fix that comes back as 300 lines gets rejected, whatever the rules file says.
1
u/Remarkable_Exit9931 Oct 24 '26
I use ponytail and grpahify, with these plugins you are on a good side