Add a "Bad Patterns" Section to CLAUDE.md
Telling Claude what to build only gets you halfway there. The real productivity unlock is also telling it what you never want to see.
Add a ## Bad Patterns section to your CLAUDE.md with concrete code examples you always reject:
## Bad Patterns
Never do these:
- Don't use `any` in TypeScript without a type guard
- Never import from `src/legacy/utils` -- use `src/utils` instead
- Don't use raw SQL strings -- always use the query builder
- Never define business logic inside a controller
- Don't use `console.log` for error handling -- use the logger service
Claude reads CLAUDE.md at the start of every session, so it absorbs your no-go list before writing a single line. One developer reported dropping their suggestion rejection rate from around 40% to around 10% after adding this section -- same model, far fewer back-and-forth corrections.
The existing ## Rules or ## Guidelines sections tell Claude what to aim for. A dedicated ## Bad Patterns section tells it what to avoid entirely. Together they create a much tighter feedback loop than prompting alone.
The more specific the example, the stronger the rule. Vague guidance gets vague compliance.
Positive rules set the target -- negative rules remove the misses.
via @gagansaluja08
Log in to leave a comment.
The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.
The language setting makes Claude respond in your preferred language by default, across every session and project.
The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.