DEV Community

Knowhowseller
Knowhowseller

Posted on

5 rules for a Claude Code rules file that actually gets followed

When I started using Claude Code for non-coding work, I did what everyone does: every time something went wrong, I added a paragraph to the rules file. Tone, formatting, clients, exceptions, exceptions to exceptions.

The file got longer. The results didn't get better. Rules at the bottom were quietly ignored, and I couldn't tell which ones.

I'm not a developer, so I fixed it the non-developer way: by treating the rules file like a one-page office manual. Five habits made the difference.

1. One line, one rule

If a rule needs a paragraph, it's usually two or three rules glued together.

Before:

When writing emails to clients, be professional but warm, avoid jargon unless the client is technical, and always confirm with me before sending anything that includes a price or a deadline.

After:

  • Client emails: warm, plain words.
  • Never send anything with a price or a deadline without showing me first.

The second line is the one that matters. In the long version it was buried at the end.

2. The dangerous verbs go first

Four verbs get their own short section at the top: send, delete, pay, publish. Anything that leaves my computer or can't be undone needs my OK first. One approval covers one action, not the next one.

3. Every "don't" gets a purpose

A rule like "don't use client data in statistics" looks clear until it blocks something it was never meant to block. Now every restriction carries one more line: purpose and who decided it, when. When a rule gets in the way later, I can see what it was protecting and change it safely.

4. Details live elsewhere

Client lists, price tables, project paths — not in the rules file. They live in their own notes, and the rules file just says where to look. The rules file is a map, not the territory.

5. Review it on a schedule, using real conversations

Once a month I ask Claude to compare the rules file against recent sessions: which rules were broken, which instructions I keep repeating that aren't rules yet, which rules are stale or duplicated. Then I cut.

The test I use: if I can't explain a line in five seconds, it goes.

What's the one rule in your setup you'd never delete?

The free starter files from this series are also on Product Hunt. Feedback there is very welcome.

Disclosure: I drafted this with help from Claude and edited it myself.

Top comments (0)