Hello, Dev.to friends! Today I want to share something genuinely game-changing for developers using AI tools.
While the AI boom has made writing code faster, we've all hit that wall — the AI spits out spaghetti code, ignores your project's conventions, or confidently generates something that breaks everything at 2 AM. Not great for your career outlook at that hour.
The fix? A CLAUDE.md file in your project root.
Think of CLAUDE.md as Claude's persistent brain — a long-term memory for your project. Claude auto-injects this file into every session, so it always knows your rules before touching a single line of code. I started using this on my current projects and the productivity difference was immediate.
Here are the 10 entries that completely transformed my agentic AI coding workflow.
1. Architecture Blueprint
Give Claude the 10,000-foot view of your stack upfront. With a clear picture of how everything connects, it stops making wild architectural guesses.
## The Core Architecture
This project is a full-stack app with a React frontend and Node.js backend:
- Frontend: React 19 single-page app
- Backend: Express.js REST API
- Database: SQLite3
2. Command Center
Never let Claude forget how to build, run, or test your app. This simple cheat sheet saves it from scanning your package.json on every request.
## Bash Commands
- `npm run dev` – Start the development server
- `npm run test` – Run the test suite
- `npm run lint` – Lint all files
3. Style Guide Sheriff
Nothing is worse than an AI that flip-flops coding styles mid-project. Lay down the law on conventions so every file feels like one developer wrote it.
## Code Style Guidelines
- Formatting: 2 spaces for indentation, single quotes for strings
- Naming: camelCase for variables/functions, PascalCase for React components
4. Test Bench Coach
Make testing a first-class citizen. For every feature or bugfix, Claude should write or update tests as part of its default workflow.
## Testing Instructions
- Always follow a TDD mindset
- Aim for high coverage on core business logic
- Run `npm run test` and ensure all tests pass before finishing
5. Error Handling Mantra
Teach Claude to approach bugs like a grizzled architect — not slap on band-aid fixes. This stops it from blindly changing code when it doesn't understand the root cause.
## Error Handling & Debugging
- Diagnose, Don't Guess: Explain possible causes step-by-step before proposing a fix
- Graceful Handling: All code should handle errors gracefully without crashing
6. Clean Code Commandments
Encode your unwritten clean code rules. AI-generated 100-line monster functions are a real problem — preempt them here.
## Clean Code Guidelines
- Function Size: Aim for functions ≤ 50 lines
- Single Responsibility: Each function/module should have one clear purpose
7. Security Sentry
AI models can miss security context unique to your stack. A mandatory checklist keeps it from casually storing plaintext passwords or skipping input validation.
## Security Guidelines
- Input Validation: Validate and sanitize all user inputs
- Authentication: Never store passwords in plain text — always use bcrypt
- Secrets: Never hardcode API keys or credentials; use environment variables
8. Teamwork Protocol
Keep Claude aligned with your team's collaboration conventions, from Git etiquette to documentation discipline.
## Collaboration & Workflow
- Git Branches: Follow GitFlow (feature/*, hotfix/*, etc.)
- Commit Messages: Use Conventional Commits format
- Documentation: Update relevant Markdown docs whenever endpoints or APIs change
9. Edge-Case Oracle
AI loves the happy path. Force it to think about corner cases a junior dev might miss — null inputs, zero values, invalid states.
## Edge Case Considerations
- Always handle empty or null inputs explicitly
- Consider invalid or unexpected states
- Fail fast on bad input rather than proceeding with wrong assumptions
10. Agentic Workflow Guardrails (The Meta-Hack)
This one is the most powerful. For complex tasks, don't let Claude jump straight into coding — enforce a mini Agile loop: Plan → Confirm → Implement → Review.
## Workflow & Planning Guidelines
- Always output a clear plan or outline before writing any code
- Incremental Development: Implement in logical, reviewable chunks
- User Approval: Pause and wait for confirmation after presenting a plan
Putting It All Together
Drop all 10 of these into a CLAUDE.md at your project root and you've essentially baked your senior engineering wisdom directly into Claude's context. Your chaotic AI intern transforms into a disciplined software architect who actually knows your codebase.
The best part? You only write it once. Every session, every feature, every bugfix — Claude starts already knowing the rules.
What's your killer CLAUDE.md entry? Drop it in the comments — I'd love to steal some ideas. 👇
Myanmar Version
Dev.to က သူငယ်ချင်းတို့အားလုံး မင်္ဂလာပါ။ ဒီနေ့တော့ Developer တွေအတွက် တော်တော်လေး အသုံးဝင်မယ့် အကြောင်းအရာလေးတစ်ခုကို မျှဝေပေးချင်ပါတယ်။
AI တွေခေတ်စားလာတော့ Code ရေးရတာ ပိုမြန်လာတယ်ဆိုပေမယ့်၊ တစ်ခါတလေ AI ကရေးပေးတဲ့ Code တွေက ကိုယ့် Project နဲ့ မကိုက်ညီတာမျိုး၊ ရှုပ်ထွေးနေတာမျိုး ကြုံဖူးကြမှာပါ။ ညဘက် ၂ နာရီလောက်မှာ Bug တွေထိုင်ရှင်းရင်း ကိုယ့်ရဲ့ Career ကိုတောင် ပြန်ပြီး စဉ်းစားစေမိပါတယ်။
အဲ့ဒီလို ပြဿနာတွေကို ဖြေရှင်းဖို့ ရှာဖွေရင်း တွေ့ရှိလာတဲ့ အဖြေကတော့ — Project ထဲမှာ CLAUDE.md ဖိုင်လေးတစ်ခု တည်ဆောက်ပြီး သုံးတာပဲ ဖြစ်ပါတယ်။
CLAUDE.md ဆိုတာက Claude လို AI အတွက် ကိုယ့် Project ရဲ့ မှတ်ဉာဏ် (Persistent Brain) လိုပါပဲ။ Session အသစ်တစ်ခုစတိုင်း Claude က ဒီဖိုင်ကို အလိုအလျောက် ဖတ်ပြီး ကိုယ့် Project ရဲ့ Rule တွေ၊ Convention တွေကို သိပြီးမှ Code ရေးပေးပါတယ်။ ဒီနည်းလမ်းကို စသုံးကြည့်တော့ ကွာခြားချက်က ချက်ချင်းပဲ သိသိသာသာ ထင်ရှားလာပါတယ်။
ဒါကြောင့် ကျွန်တော့်ရဲ့ Coding Workflow ကို လုံးဝပြောင်းလဲသွားစေတဲ့ CLAUDE.md ထဲက အရေးကြီးတဲ့ အချက် ၁၀ ချက် ကို ပြန်လည်မျှဝေပေးလိုက်ပါတယ်။
၁။ System Architecture ကို အရင်ရှင်းပြပါ
ကိုယ့် Project ရဲ့ အဓိက တည်ဆောက်ပုံကို ချရေးပြပါ။ ဥပမာ — Frontend အတွက် React ကိုသုံးမယ်၊ Backend အတွက် Express ကိုသုံးပြီး Database ကို SQLite သုံးထားတယ်ဆိုတာမျိုးပေါ့။ ဒါမှ AI က Code တွေရေးတဲ့အခါ လမ်းကြောင်းမှန်ပေါ်ကနေ ရေးပေးမှာပါ။
## The Core Architecture
This project is a full-stack app with a React frontend and Node.js backend:
- Frontend: React 19 single-page app
- Backend: Express.js REST API
- Database: SQLite3
၂။ အမြဲသုံးတဲ့ Command တွေကို ပြောပြထားပါ
Project ကို ဘယ်လို Run ရမလဲ ဆိုတာ AI က အမြဲ သိနေဖို့ လိုပါတယ်။ ကိုယ် နေ့စဉ်သုံးနေတဲ့ Command တွေကို ထည့်ရေးထားလိုက်ရင် ခဏခဏ ရှင်းပြနေစရာ မလိုတော့ပါဘူး၊ package.json ကိုလည်း ခဏခဏ ရှာဖွေနေစရာ မလိုတော့ပါ။
## Bash Commands
- `npm run dev` – Start the development server
- `npm run test` – Run the test suite
- `npm run lint` – Lint all files
၃။ Code Style ကို သတ်မှတ်ပါ
Code တွေက တစ်ယောက်တည်း ရေးထားသလို သပ်ရပ်နေဖို့ အရေးကြီးပါတယ်။ AI က Coding Style ကို Session တိုင်း ပြောင်းလဲမနေအောင် ကိုယ့်ရဲ့ စံနှုန်းတွေကို အတိအကျ သတ်မှတ်ပေးထားပါ။
## Code Style Guidelines
- Formatting: 2 spaces for indentation, single quotes for strings
- Naming: camelCase for variables/functions, PascalCase for React components
၄။ Test Code တွေကို အမြဲရေးခိုင်းပါ
Feature အသစ်တစ်ခု ရေးပြီးတိုင်း Unit Test တွေ တစ်ခါတည်း ရေးပေးဖို့ AI ကို လမ်းညွှန်ထားပါ။ ဒါက နောက်ပိုင်းဖြစ်လာမယ့် ပြဿနာတွေကို အများကြီး လျှော့ချပေးနိုင်ပါတယ်။
## Testing Instructions
- Always follow a TDD mindset
- Aim for high coverage on core business logic
- Run `npm run test` and ensure all tests pass before finishing
၅။ Error တွေကို ချက်ချင်း မပြင်ခိုင်းပါနဲ့
Bug တစ်ခုတွေ့ရင် AI က ချက်ချင်း Fix လုပ်ဖို့ ကြိုးစားတတ်ပါတယ်။ အဲ့ဒီလို မလုပ်ခိုင်းဘဲ Error ရဲ့ အကြောင်းရင်းကို အရင်ဆုံး လေ့လာပြီးမှ ဖြေရှင်းခိုင်းပါ — ဒါမှ Root Cause ကို မသိဘဲ Code ကို အလွယ်တကူ ပြင်မနေတော့ပါ။
## Error Handling & Debugging
- Diagnose, Don't Guess: Explain possible causes step-by-step before proposing a fix
- Graceful Handling: All code should handle errors gracefully without crashing
၆။ Clean Code ဖြစ်ဖို့ ဦးစားပေးပါ
စာကြောင်းရေ ရာနဲ့ချီရှည်တဲ့ Function အကြီးကြီးတွေ ရေးမယ့်အစား ဖတ်ရလွယ်ပြီး တိကျတဲ့ Function သေးသေးလေးတွေပဲ ခွဲရေးဖို့ AI ကို ကြိုတင် လမ်းညွှန်ထားပါ။
## Clean Code Guidelines
- Function Size: Aim for functions ≤ 50 lines
- Single Responsibility: Each function/module should have one clear purpose
၇။ Security ကို အမြဲ သတိပေးပါ
API Key တွေ၊ Database Password တွေကို Code ထဲမှာ အလွယ်တကူ ထည့်မရေးမိစေဖို့ တင်းကျပ်ထားပါ။ AI တွေဟာ တစ်ခါတလေ ဒီ Security Context တွေကို လျစ်လျူရှုသွားတတ်ပါတယ်။
## Security Guidelines
- Input Validation: Validate and sanitize all user inputs
- Authentication: Never store passwords in plain text — always use bcrypt
- Secrets: Never hardcode API keys or credentials; use environment variables
၈။ Team Workflow ကို သင်ပေးပါ
အဖွဲ့လိုက် အလုပ်လုပ်တဲ့အခါ သတ်မှတ်ထားတဲ့ ပုံစံတွေကို AI ကိုလည်း သင်ပေးထားပါ။ ဥပမာ — Endpoint တွေ ပြောင်းလဲတိုင်း Documentation ကို အမြဲ Update လုပ်ဖို့ ညွှန်ကြားထားနိုင်ပါတယ်။
## Collaboration & Workflow
- Git Branches: Follow GitFlow (feature/*, hotfix/*, etc.)
- Commit Messages: Use Conventional Commits format
- Documentation: Update relevant Markdown docs whenever endpoints or APIs change
၉။ Edge-case တွေကို ကြိုတွေးခိုင်းပါ
AI ဟာ "Happy Path" ကိုပဲ ကြည့်တတ်ပါတယ်။ Data မရှိတဲ့ အခြေအနေ၊ Invalid Input တွေ၊ Null Value တွေမှာ System ပျက်မကျသွားအောင် ဘယ်လို ကာကွယ်မလဲဆိုတာ ကြိုတင် စဉ်းစားခိုင်းပါ။
## Edge Case Considerations
- Always handle empty or null inputs explicitly
- Consider invalid or unexpected states
- Fail fast on bad input rather than proceeding with wrong assumptions
၁၀။ အဆင့်လိုက် အလုပ်လုပ်ခိုင်းပါ (အကောင်းဆုံး Meta-Hack)
ဒါကတော့ အကောင်းဆုံး Entry ပါ။ AI ကို Task ကြီးကြီးတစ်ခု ခိုင်းတော့မယ်ဆိုရင် ချက်ချင်း Code မရေးခိုင်းပါနဲ့။ Plan အရင်ဆွဲ → ကိုယ် Confirm လုပ် → တစ်ဆင့်ချင်း Implement ဆိုတဲ့ Mini Agile Cycle ကို enforce လုပ်ထားပါ။
## Workflow & Planning Guidelines
- Always output a clear plan or outline before writing any code
- Incremental Development: Implement in logical, reviewable chunks
- User Approval: Pause and wait for confirmation after presenting a plan
အားလုံး ပေါင်းစပ်လိုက်ရင်
ဒီ Entry ၁၀ ခုကို Project Root မှာ CLAUDE.md ဖိုင်တစ်ခုထဲ ထည့်ရေးလိုက်တာနဲ့ ကိုယ့်ရဲ့ Senior Engineering အတွေ့အကြုံတွေကို Claude ရဲ့ Context ထဲ တိုက်ရိုက် ပေါင်းသွင်းလိုက်သလိုပါပဲ။ ရှုပ်ထွေးတဲ့ AI Intern တစ်ယောက်ဟာ ကိုယ့် Codebase ကို နားလည်တဲ့ Software Architect တစ်ယောက် ဖြစ်သွားပါတယ်။
အကောင်းဆုံး သဘောကတော့ — တစ်ကြိမ်ပဲ ရေးရပါတယ်။ Session တိုင်း၊ Feature တိုင်း၊ Bug Fix တိုင်း Claude က Rule တွေကို အလိုအလျောက် သိပြီး စဆင်းလာပါတယ်။
သူငယ်ချင်းတို့ရော ကိုယ့် CLAUDE.md ထဲမှာ ဘာ Entry တွေ ထည့်ထားလဲ? Comment မှာ မျှဝေပေးသွားပါဦး 👇
Top comments (0)