
Ask Claude to write the rule, and name the folder it's for. Claude saves it as a short file in your project's .claude/rules/ folder. A paths list at the top of that file says where the rule applies: "**/checkout/**" means "anything inside a folder called checkout". Claude picks the rule up when it opens or edits a file that matches. A rule file with no paths list applies everywhere, like CLAUDE.md.
Set up a rule for this project: whenever you work on anything in the checkout folder, never change a price without asking me first. Put it in a rule file that only applies to the checkout folder.---
paths:
- "**/checkout/**"
---
# Checkout: never change a price without asking
When working on anything in the checkout folder, never change a price without asking the user first.
- Ask first, stating the current value, the proposed value, and the file. Wait for an explicit yes before editing.Why it works
In our test we asked Claude to make every price a round number. On the cart page, with the rule in place, it listed each change and waited for a yes. Without the rule, it changed them straight away. On the menu page, outside the checkout folder, it changed them without asking. A rule that only matters in one place doesn't crowd every other conversation.
Watch out
Claude asks before it saves anything in the .claude folder, so say yes when it does. A rule is guidance, not a lock. And it only kicks in once Claude opens a matching file, so for anything that must hold everywhere, use CLAUDE.md.