Claude Code के लिए जाँचने योग्य CLAUDE.md rules
स्पष्ट boundaries, commands और safe secret handling वाला छोटा, verify होने योग्य CLAUDE.md।
विषय-सूची
Claude Code के लिए जाँचने योग्य CLAUDE.md rules
लंबी preferences list agent को predictable नहीं बनाती। rule में permission, prohibition और verify होने वाला result होना चाहिए। workflow API उपयोग करता है तो BetterToken Claude Code की मौजूदा guide खोलें, अपनी API Key configure करें और छोटा test चलाएं। Dashboard में expected model, status और token usage दिखना चाहिए; Key को CLAUDE.md नहीं, environment में रखें।
छोटे contract से शुरू करें
## Goal
- Keep changes limited to the requested feature.
## Checks
- Run `npm test` after code changes.
## Forbidden
- Do not read, print, or commit `.env`.
“quality code लिखो” जाँचा नहीं जा सकता; command और exit code जाँचे जा सकते हैं।
scope और hierarchy
मौजूदा Claude Code Memory documentation बताती है कि अलग scope की instructions कैसे खोजी जाती हैं। इस example में “local package rule सामान्य root rule को override कर सकता है, लेकिन root security को नहीं” project का लिखा contract है, Claude Code का universal built-in exception नहीं। Visible rules जाँचें और duplicate हटाएँ।
rules के प्रकार अलग रखें
| प्रकार | उदाहरण | प्रमाण |
|---|---|---|
| goal | profile पढ़ना | केवल target module बदले |
| boundary | migration नहीं | diff में नहीं |
| check | npm test | exit 0 |
| style | existing names | extra refactor नहीं |
लंबे explanations link के साथ docs/ में रखें।
conflict और concrete example
edit से पहले package.json, task files और local instructions पढ़ें। जो command project में नहीं है उसे न गढ़ें। दो rules अलग checks दें तो एक verify होने योग्य local rule रखें।
reversible test
test file में local variable rename करें, फिर चलाएँ:
git diff --check
git diff --stat
npm test
दूसरी file बदल जाए या documented check न चले तो result reject करें।
secrets और maintenance
API Key, CI token, personal data या .env कभी CLAUDE.md में न रखें। API_KEY=your_api_key_here placeholder लें और actual values environment या secret store से दें। tests, packages या directories बदलने पर contract review करें।