Tips // Claude in practice

Tips for working better with Claude

One short tip at a time, with an example you can copy. Move through them at random or search for what you need.

Claude CodeIntermediateClaude Code

Rules per folder: .claude/rules with paths in the frontmatter

Guidance that only applies to one part of the repo does not have to load in every session; limit it with a glob.

A file in .claude/rules/ with a paths field in its frontmatter is loaded only when Claude works with matching files. The frontmatter sets the scope, not the folder: a rule without paths always loads, just like CLAUDE.md, wherever it lives. Universal material goes in CLAUDE.md; module-specific material goes in a rule with paths.

Example
# .claude/rules/database.md
---
paths:
  - "src/db/**/*.sql"
---
All SQL in this module must include an explicit transaction boundary.
#rules#context#paths