Capture
One read of Claude Code CLI
1 pages moved out of 187 read.
best-practices Changed · +3 / -29 lines
from line 153
CLAUDE.md is a special file that Claude reads at the start of every conversation. Include Bash commands, code style, and workflow rules. This gives Claude persistent context it can't infer from code alone. -The `/init` command analyzes your codebase to detect build systems, test frameworks, and code patterns, giving you a solid foundation to refine. - There's no required format for CLAUDE.md files, but keep it short and human-readable. For example: ```markdown CLAUDE.md theme={null}
from line 183
You can tune instructions by adding emphasis (e.g., "IMPORTANT" or "YOU MUST") to improve adherence. Check CLAUDE.md into git so your team can contribute. The file compounds in value over time. -CLAUDE.md files can import additional files using `@path/to/import` syntax: +CLAUDE.md files can import additional files using `@path/to/import` syntax. For import rules and where CLAUDE.md files can live, see [CLAUDE.md files](/docs/en/memory#claude-md-files). -```markdown CLAUDE.md theme={null} -See @README.md for project overview and @package.json for available npm commands. - -# Additional Instructions -- Git workflow: @docs/git-instructions.md -- Personal overrides: @~/.claude/my-project-instructions.md -``` - -You can place CLAUDE.md files in several locations: - -* **Home folder (`~/.claude/CLAUDE.md`)**: applies to all Claude sessions -* **Project root (`./CLAUDE.md`)**: check into git to share with your team -* **Project root (`./CLAUDE.local.md`)**: personal project-specific notes; add this file to your `.gitignore` so it isn't shared with your team -* **Parent directories**: useful for monorepos where both `root/CLAUDE.md` and `root/foo/CLAUDE.md` are pulled in automatically -* **Child directories**: Claude pulls in child CLAUDE.md files on demand when it reads a file in those directories - ### Configure permissions <Tip>
from line 311
## Communicate effectively -The way you communicate with Claude Code significantly impacts the quality of results. +Ask Claude the questions you'd ask another engineer, and for larger features have Claude interview you and write a spec before you start implementing. ### Ask codebase questions
from line 400
refresh, and whether we have any existing OAuth utilities I should reuse. ``` -The subagent explores the codebase, reads relevant files, and reports back with findings, all without cluttering your main conversation. +You can also use subagents for verification after Claude implements something. See [Add an adversarial review step](#add-an-adversarial-review-step). -You can also use subagents for verification after Claude implements something: - -```text wrap theme={null} -use a subagent to review this code for edge cases -``` - ### Rewind with checkpoints <Tip>
from line 429
## Automate and scale Once you're effective with one Claude, multiply your output with parallel sessions, non-interactive mode, and fan-out patterns. - -Everything so far assumes one human, one Claude, and one conversation. But Claude Code scales horizontally. The techniques in this section show how you can get more done. ### Run non-interactive mode