Memory and Rules for Claude Codes
Memory and rules in Claude Code control what the agent knows and may do. CLAUDE.md files hold persistent instructions such as build commands and conventions that load at the start of a session, while settings files and permission rules allow, ask about or deny specific tools, commands and file paths.
Stage: Customisation · Part of the Claude Code roadmap · Last reviewed 19 November 2026
What to learn in Memory and Rules
- Write a CLAUDE.md with build, test and style instructions
- Place instructions at project, user and folder levels appropriately
- Allow safe commands and deny risky ones in permission rules
- Understand how settings from different scopes combine
- Keep memory short, specific and free of stale advice
Memory and Rules interview questions
What belongs in a CLAUDE.md file?
Facts the agent cannot infer easily: how to build, test and lint, repository layout, naming and style conventions, and project-specific warnings. Keep it concise and current, because long or outdated instructions waste context and can mislead.
How do permission rules protect a project?
Rules classify tool use into allow, ask and deny, matching tools, commands or paths. Denying access to secrets or destructive commands prevents them even when a prompt asks, while allowing routine commands cuts repeated approval prompts.
Where Memory and Rules fits in the Claude Code roadmap
Memory and Rules belongs to the Customisation stage (beginner level), which takes about 8 hours. Make it yours.
Other units in this stage
Back to the full Claude Code roadmap