How to Get Claude Code to Follow My CLAUDE.md Instructions?

0
8
Asked By CreativeCoder42 On

Hey everyone! I've been working with Claude Code ever since it was released on Claude Max, and while I have my workflow set up through Trello, I've been facing some issues. My CLAUDE.md file has a section with key instructions on how I want things done, like always creating branches from ticket names and consistently following the TDD approach. However, Claude doesn't seem to stick to these rules. Instead, it often generates implementation tasks instead of tests first, and even when it writes tests, it fails to run or commit them beforehand. I'm curious if anyone has tips for improving the clarity of my CLAUDE.md file or suggestions on how to troubleshoot those moments when Claude doesn't follow the instructions properly. Should I be resetting the git or updating the memory files for better results?

4 Answers

Answered By CodeCrafter88 On

I’ve had similar troubles, especially with TDD. It might be more efficient to have Claude generate entire applications with everything included, rather than following a strict TDD process. When you break the steps down too much, it can lead to token inefficiency and missing context. Instead, focus on getting Claude to draft a plan for an entire feature in one go and then run everything. Sometimes, using extended reasoning aids in getting better results overall.

Answered By TechSavvySam On

I think Claude might be getting overloaded with instructions in your CLAUDE.md. Try simplifying the content and adding occasional reminders for Claude to review the instructions before tackling a task. It could help clarify what you expect. Also, you could experiment by asking Claude directly what changes it thinks would help it follow the guidelines better.

Answered By DevGuru99 On

It sounds like your CLAUDE.md might not be having the impact you hope for since it sits in the system prompt that Claude only reads once. For better results, try embedding clear directions within your prompts themselves or have Claude read the file directly. You might also want to consider using a linter or an AI tool for code reviews to enhance compliance with your guidelines.

Answered By CodeNinja77 On

Have you tried asking Claude what it thinks should change in your .md file to follow your directions? Sometimes, understanding where it gets lost could reveal what to fix. It worked wonders for me when I experimented with questions like that!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.