Foundations domain 3 · Claude Code configuration and workflows
CLAUDE.md, rules and skills
- CLAUDE.md files load from the filesystem root down to the working directory and are concatenated, not overridden, so the nearest file is read last. Subdirectory files load when Claude works there.
~/.claude/CLAUDE.mdis personal and never reaches teammates. Team standards belong in the project's CLAUDE.md.CLAUDE.local.mdis personal per project.- Keep CLAUDE.md short (under about 200 lines). Conventions that follow a file pattern belong in
.claude/rules/with apathsglob. Conventions that vary by directory can live in nested CLAUDE.md files.@pathimports organise content but still load at launch. - Multi-step procedures belong in skills, which load only when used and can bundle supporting files. Custom commands in
.claude/commands/still work; they've been merged into skills. - CLAUDE.md is guidance, not enforcement. For guarantees, use permissions and hooks.
See also: Professional domain 2 · Prompt reuse: caching, modular prompts and Skills and Foundations domain 1 · Hooks: deterministic enforcement.
Settings precedence
Highest first: managed policy › command-line arguments › .claude/settings.local.json (personal, not committed) › .claude/settings.json (shared, committed) › ~/.claude/settings.json (personal defaults). More specific wins, except that managed policy sits above everything, including the command line. Permission deny rules win over allow rules wherever they're set.
Permission modes
| Mode | What runs without asking |
|---|---|
default (Manual) | Reads only; you approve the rest |
acceptEdits | Reads, file edits and common filesystem commands |
plan | Reads and analysis; no edits until you accept a plan |
auto | A classifier reviews actions instead of you |
dontAsk | Anything that would prompt is denied (for CI) |
bypassPermissions | Everything, with no prompts (from v2.1.309, rm and rmdir are still denied in the Desktop app and VS Code) |
There's no "read only" mode; a likely distractor. Plan mode is the one for analysis where nothing should change, but it is a workflow, not a lock: in an interactive terminal session where bypass permissions is available, edits Claude attempts while planning run without asking. Permissions, hooks and managed settings are what make a change impossible.
auto, the starting mode for interactive sessions in recent versions, and dontAsk.Flags for headless and CI use
-p/--print: non-interactive, run once and exit. The fix when a CI job hangs waiting for input.--output-format json: machine-readable result, includingsession_idandtotal_cost_usd.stream-jsonemits events as they happen.--append-system-promptadds to Claude Code's system prompt.--system-promptreplaces it, removing the built-in instructions.--add-dirgives access to another directory. It doesn't load that directory's CLAUDE.md by default.--max-turnscaps the agent loop, in print mode.
Commands, by symptom
| Symptom | Command |
|---|---|
| Is my CLAUDE.md loaded? What's filling the context? | /context: usage by category, and the memory files loaded in this session |
| I want to edit memory files or toggle auto memory | /memory |
| Undo Claude's bad edit, keeping my own uncommitted work | /rewind: restores a checkpoint of Claude's changes (not edits made through Bash) |
| The conversation is long | /compact summarises; /clear starts fresh |
| Switching to an unrelated task | /clear |
| What has this cost? | /usage (/cost is an alias) |
| Something's wrong with the installation or setup | /doctor |
| New project, no CLAUDE.md yet | /init |
/memory shows which memory files are loaded. In today's Claude Code, /memory lists and opens memory files, and /context is the command that shows which CLAUDE.md and rules files loaded into the current session.Skills and commands: syntax
$ARGUMENTS: everything typed after the command name. Individual arguments:$ARGUMENTS[0]or the shorthand$0for the first,$1for the second.@pathinlines a file's contents;!`command`runs a shell command and inlines its output (it goes through the normal permission check).- Frontmatter:
allowed-toolspre-approves tools while the skill runs;disallowed-toolsremoves tools;context: forkruns the skill in an isolated context that doesn't see the conversation;disable-model-invocation: truemeans only a person can start it;argument-hintonly shows a hint in autocomplete.
$0 is the first argument. Older material uses $1 for the first. Also, allowed-tools pre-approves rather than restricts; restriction is disallowed-tools.Plan mode or direct execution?
Plan mode for changes with many files, design decisions, a wide blast radius or an unknown cause. Direct execution for small, clear, low-risk changes. Save an agreed plan to a file if the work spans sessions.
See also: Exam guide vs today · Foundations (CCAR-F) and Professional domain 7 · Developer productivity and operational enablement.
Docs: Memory and CLAUDE.mdSettingsPermission modesCLI referenceHeadless modeCommandsSkillsCheckpointing
Practise Domain 3