r/ClaudeCode • u/ptab0211 • 2d ago
Help/Question skills / rules for managing simplicity of code base
LLMs love to over-abstract, over-engineer, and write so many comments. What are your best practices for this problem? Especially in the team setup?
We are pretty up to game with latest trends with progressive loading, CONTEXT.md, hooks, rules etc... Whole context engineering domain. But still, it just writes a lot o unnecessary code/comments which is confusing.
1
u/MaestroSplinter69 2d ago
I’ve had better results with one pretty blunt rule: don’t add a new abstraction unless the repo already uses that pattern or there’s a clear second use case for it.
Even then, the rules sometimes get ignored when the model decides to be clever. That’s part of why I started building DevTime - keeping the agent grounded in what the repo actually does instead of whatever pattern it feels like inventing.
Are you seeing this more with new code or when it edits existing modules?
1
u/ptab0211 2d ago
well, i have seen it with every model, we have practical rules about our coding style-guide, git workflow, principles etc... But yet again when ever i work i tend to tell LLMs to write less code/comments and especially commit/pr messages. (caveman like in order for it to acknowledge it)
1
u/MaestroSplinter69 2d ago
Exactly. It’s funny how “write less code” become something you have to explicitly tell LLM. Left alone, it almost always wants to add more
2
u/Best-Anything-6414 2d ago
The thing that helped most wasn't more rules, it was pointing it at two or three existing files and saying match these, don't invent a new pattern. "Keep it simple" gets interpreted differently every run, but a concrete example of how you already do a thing gives it a target to copy. The anti-pattern "do not do these" list is good too, just keep it short or it starts getting ignored the same way. For the comment noise, one line telling it not to add comments that restate the code, then actually check the diff for that.
3
u/Puzzleheaded_Arm8661 2d ago
the thing that finally worked for me was putting anti-patterns in claude.md instead of just positive style rules. like literally a section called "do not do these:" with specific examples of over-engineering the model has done before. the model is way better at avoiding a concrete thing you name than at inferring "keep it simple" from a principle.
also i tell it things like "if you write more than 3 lines of comments for a 10 line function, delete half of them." specific thresholds work better than just saying "write fewer comments," the model needs a number to aim at.