# Best Practices for Claude Code ![rw-book-cover](https://claude-code.mintlify.app/_next/image?url=%2F_mintlify%2Fapi%2Fog%3Fdivision%3DCore%2Bconcepts%26appearance%3Dsystem%26title%3DBest%2BPractices%2Bfor%2BClaude%2BCode%26description%3DTips%2Band%2Bpatterns%2Bfor%2Bgetting%2Bthe%2Bmost%2Bout%2Bof%2BClaude%2BCode%252C%2Bfrom%2Bconfiguring%2Byour%2Benvironment%2Bto%2Bscaling%2Bacross%2Bparallel%2Bsessions.%26logoLight%3Dhttps%253A%252F%252Fmintcdn.com%252Fclaude-code%252Fo69F7a6qoW9vboof%252Flogo%252Flight.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253Do69F7a6qoW9vboof%2526q%253D85%2526s%253D536eade682636e84231afce2577f9509%26logoDark%3Dhttps%253A%252F%252Fmintcdn.com%252Fclaude-code%252Fo69F7a6qoW9vboof%252Flogo%252Fdark.svg%253Ffit%253Dmax%2526auto%253Dformat%2526n%253Do69F7a6qoW9vboof%2526q%253D85%2526s%253D0766b3221061e80143e9f300733e640b%26primaryColor%3D%25230E0E0E%26lightColor%3D%2523D4A27F%26darkColor%3D%25230E0E0E%26backgroundLight%3D%2523FDFDF7%26backgroundDark%3D%252309090B&w=1200&q=100) ## Metadata - Author: [[Claude Code Docs]] - Full Title: Best Practices for Claude Code - Category: #articles - Summary: Claude Code is a smart coding assistant that reads files, runs commands, and builds code based on your instructions. It works best when you keep its context clear and provide focused, helpful information like concise CLAUDE.md files and skills. Using plugins, hooks, and clear communication helps Claude solve problems faster and more accurately. - URL: https://code.claude.com/docs/en/best-practices ## Highlights - Most best practices are based on one constraint: Claude’s context window fills up fast, and performance degrades as it fills. ([View Highlight](https://read.readwise.io/read/01kfw0vvw8k283axskmjh7x7ee)) - When the context window is getting full, Claude may start “forgetting” earlier instructions or making more mistakes. The context window is the most important resource to manage. ([View Highlight](https://read.readwise.io/read/01kfw0w5k8v0jaj9x85snfhaza)) - Claude performs dramatically better when it can verify its own work, like run tests, compare screenshots, and validate outputs. Without clear success criteria, it might produce something that looks right but actually doesn’t work. You become the only feedback loop, and every mistake requires your attention. Strategy Before After **Provide verification criteria** *”implement a function that validates email addresses"* *"write a validateEmail function. example test cases: [[email protected]](mailto:[email protected]) is true, invalid is false, [[email protected]](mailto:[email protected]) is false. run the tests after implementing”* **Verify UI changes visually** *”make the dashboard look better"* *"[paste screenshot] implement this design. take a screenshot of the result and compare it to the original. list differences and fix them”* **Address root causes, not symptoms** *”the build is failing"* *"the build fails with this error: [paste error]. fix it and verify the build succeeds. address the root cause, don’t suppress the error”* ([View Highlight](https://read.readwise.io/read/01kfw0xda3q5ykvvw3cj7jcmc0)) - Planning is most useful when you’re uncertain about the approach, when the change modifies multiple files, or when you’re unfamiliar with the code being modified. If you could describe the diff in one sentence, skip the plan. ([View Highlight](https://read.readwise.io/read/01kfw10dc61869k65t50pwkh3m)) - Vague prompts can be useful when you’re exploring and can afford to course-correct. A prompt like `"what would you improve in this file?"` can surface things you wouldn’t have thought to ask about. ([View Highlight](https://read.readwise.io/read/01kfw11rkqat7dqe9ysq4ren5t))