← Back to blog

How I Stopped Repeating Myself with Claude Code Using .clinerules

23 February 2026 · 5 min read


You know that feeling when you're working with an AI coding assistant and you find yourself saying the same thing over and over again?

"Can you add documentation to that file?"

"Don't forget the JSDoc comments."

"Also, could you add type definitions with descriptions?"

Yeah, I was doing that every single time I asked Claude Code to create a new feature or file. It was getting old fast.

The Lightbulb Moment

Then I discovered .clinerules – and honestly, it's been a game-changer.

Turns out, Claude Code (which used to be called "Cline," hence the file name) has this built-in way to give it persistent context. It's like setting ground rules for your entire project that Claude actually remembers between tasks.

Instead of me being the nagging developer going "documentation please!" after every file creation, I just wrote down my expectations once in a .clinerules file, and now Claude just does it automatically.

What Changed

Before:

1. "Hey Claude, create a PropertyCard component"

2. Claude creates the file

3. "Great! Now can you add JSDoc comments?"

4. "And type the props interface with descriptions?"

5. "Also add a file header explaining what this does?"

6. Repeat for every. single. file.

After:

1. "Hey Claude, create a PropertyCard component"

2. Claude creates the file with documentation, typed props, JSDoc comments, AND a descriptive file header

3. Done.

How I Set It Up

Super simple, actually:

1. Created a .clinerules file in my project root

2. Added my documentation standards and React/TypeScript coding practices

3. Saved it

4. That's it!

Now every new file Claude creates follows the same unified format. Same structure, same documentation style, same everything.

The Real Win: Readability

Here's the thing I didn't expect – having consistent documentation and code structure across all my files makes the codebase SO much easier to navigate.

When every component has:

- A clear file header explaining its purpose

- JSDoc comments on all exported functions

- Properly typed and documented props

- Consistent code organization

...you don't have to guess what anything does. You can jump into any file and immediately understand what's going on.

It's like the difference between a messy closet where you have to dig for stuff versus everything being labeled and organized in the same way. Future me is going to be very grateful.

What I Put in My .clinerules

I included all my React + TypeScript standards:

- Documentation requirements (the star of the show)

- File organization patterns

- TypeScript best practices

- Chakra UI styling conventions

- GraphQL query structure

- Error handling patterns

- Accessibility requirements

Basically, all the things I used to have to remind Claude about are now just... handled.

It's one of those small quality-of-life improvements that adds up over time. Less mental overhead for me. More consistent code. Better documentation without the nagging. And I can focus on actually building features instead of being the documentation police.

If you're using Claude Code and finding yourself repeating the same instructions over and over, do yourself a favor and create a .clinerules file. Write down your standards once, and let Claude remember them for you.

Your future self will thank you. (And honestly, so will anyone else who has to read your code.) 🙌