Claude Code के लिए CLAUDE.md: जाँच योग्य rules
छोटे project rules लिखें जिनमें scope, निषेध, verification commands और secrets की सीमा स्पष्ट हो।
लंबी preference list Claude Code को predictable नहीं बनाती। उपयोगी rule बताता है कि क्या बदलना है, सीमा क्या है और प्रमाण क्या होगा: file, diff, command और exit code।
छोटा contract
Goal
- Keep changes limited to the requested feature.
Checks
- Run npm test and report command, exit code, and changed files.
Forbidden
- Do not read .env or run deploy.
Scope
- packages/payments/CLAUDE.md wins only inside that directory.
- Root security rules always apply.
Secrets और conflicts
CLAUDE.md में API Key, CI token या वास्तविक personal data न रखें। Placeholder उपयोग करें और जरूरी values environment या CI secret store से दें। सामान्य rules root में और package rules package के पास रखें। Local exception global security rule को रद्द नहीं कर सकती।
Reversible test
- एक test file में केवल local variable rename कराएँ।
git diff --checkऔरgit diff --statदेखें।- Contract में लिखा test command चलाएँ।
- दूसरी file बदले या command और exit code न मिलें तो result reject करें।
अलग Claude Code API workflow के लिए Base URL और model BetterToken documentation में जाँचें।