Domain 3: Claude Code
3.1% of examIdentify Claude Code's core component types
Key Points
- Five component types: Rules (standing conventions, often in CLAUDE.md), Skills (SKILL.md, loaded when relevant), Commands (built-in + custom slash commands in .claude/commands/), Agents (delegated subagents), Agent Memory (persisted context, notably CLAUDE.md).
- Skill vs. Command distinction: Skills load implicitly on relevance; Commands are explicitly invoked by name.
- CLAUDE.md is the primary instance of Agent Memory, not a separate mechanism.
- Built-in slash commands include /clear (reset context), /init (bootstrap CLAUDE.md), /help.
Decision Rules
When: A capability is invoked explicitly by name (/foo)
→It's a Command, whether built-in or custom.
When: A capability loads automatically because Claude judges it relevant to the task
→It's a Skill, defined by a SKILL.md.
When: A subtask is delegated to a focused-role, focused-tool-set helper
→It's an Agent (subagent), not a Command.
✗ Anti-Patterns to Reject
- Confusing Skills with Commands because both are Markdown-authored, reusable instructions -- the distinguishing factor is invocation.
- Treating Agent Memory and CLAUDE.md as two separate mechanisms.
Apply the CLAUDE.md memory hierarchy
Key Points
- CLAUDE.md is auto-loaded project memory, not executable configuration.
- Four hierarchy levels, broadest to most specific: enterprise/system, user (~/.claude/CLAUDE.md), project (./CLAUDE.md), subdirectory.
- More specific files layer on top of broader ones -- they refine, they don't replace.
- Project-level CLAUDE.md is checked into version control so the whole team shares the same guidance.
- /init bootstraps a starter CLAUDE.md from an existing codebase.
Decision Rules
When: A team wants the same conventions applied for everyone on a repo
→Use a project-level CLAUDE.md committed to version control.
When: Bootstrapping CLAUDE.md for an existing repository
→Run /init.
When: Permission rules, hooks, or tool allow/deny lists need a home
→Put them in settings.json, never in CLAUDE.md.
✗ Anti-Patterns to Reject
- Assuming the user-level ~/.claude/CLAUDE.md is what a team shares -- it is personal, not committed to the repo.
- Storing permission rules or hooks in CLAUDE.md.
Configure behavior and permissions via settings.json
Key Points
- settings.json (user: ~/.claude/settings.json, project: .claude/settings.json) configures tool allow/deny lists, hooks, environment variables, model selection, and MCP servers.
- It is the deterministic control surface -- an allow/deny rule or hook blocks a dangerous command regardless of what the model proposes.
- CLAUDE.md is context/memory (probabilistic influence on the model); settings.json is executable configuration (deterministic enforcement).
Decision Rules
When: A rule must block a destructive shell command regardless of model behavior
→Put it in settings.json as a permission rule or hook, not in CLAUDE.md.
When: Configuring tool allow/deny lists, hooks, environment variables, model choice, or MCP servers
→settings.json is the surface, at the correct scope (user vs. project).
✗ Anti-Patterns to Reject
- Putting permission rules, hooks, or tool allow/deny lists in CLAUDE.md.
- Assuming a well-written CLAUDE.md instruction is an adequate substitute for a settings.json permission rule.
Distinguish Claude Code's session and operating-mode features
Key Points
- Session management: conversations persist as resumable sessions; /clear resets context to stay focused.
- Headless mode runs non-interactively (e.g., claude -p) for scripting/CI, with no interactive TUI.
- Streaming mode emits incremental output, including structured stream-JSON, for programmatic consumption.
- Auto-mode is reduced-friction autonomous operation with fewer confirmations -- pair it with settings.json permission rules and hooks.
- Headless mode (interactivity) and auto-mode (autonomy) are independent axes, frequently confused.
- Best-practice loop: gather context -> plan -> act -> verify, tightened with custom commands and hooks rather than long, brittle prompts.
Decision Rules
When: Running Claude Code non-interactively in a CI pipeline
→Use headless mode (e.g., claude -p).
When: Output must be consumed incrementally or programmatically
→Use streaming mode.
When: Using auto-mode
→Pair it with settings.json permission rules and hooks -- never use it unguarded.
✗ Anti-Patterns to Reject
- Confusing headless mode (interactivity) with auto-mode (autonomy) -- they are independent axes.
- Using auto-mode without corresponding permission rules or hooks.