Study guides / CCAR-F

Quick reference

One condensed cheat-sheet per domain - the tables and rules worth re-reading right before the exam.

Configuration Hierarchy

CLAUDE.md files are concatenated into context, not overridden. Every applicable file loads together, in a documented order from broadest scope to most specific:

Load orderLocationScopeCommitted to Git?
1 (broadest)~/.claude/CLAUDE.mdUser-global, all projectsNo
2.claude/CLAUDE.md (project root)Project-wideYes
3CLAUDE.md (any directory)Directory and belowYes
4 (most specific).claude/rules/*.mdConditional, path-matchedYes

Key rule: This is a load order, not a precedence chain - no file replaces another. If two rules contradict each other, Claude may pick one arbitrarily, so fix contradictions at the source. Distractors claiming "more specific scope wins" or "user-level overrides project-level" are wrong.

.claude/rules/ - Conditional Rules

Files in .claude/rules/ use YAML frontmatter with a paths field for conditional loading:

Rules are loaded only when Claude Code operates on files matching the glob patterns. This prevents irrelevant rules from consuming context window space.

Skills System

PropertyProject SkillsPersonal Skills
Location.claude/skills/~/.claude/skills/
Entry pointSKILL.md in skill directorySKILL.md in skill directory
Shared with teamYes (committed)No (personal)

Skill properties:

Skills are reusable capability modules. They encapsulate a workflow (e.g., "run tests", "deploy to staging") with tool access configured in frontmatter.

Commands

TypeLocationScope
Project commands.claude/commands/Shared with team
Personal commands~/.claude/commands/Personal only

Commands are invoked with / prefix. They are templates - predefined prompts that can include $$ARGUMENTS placeholders for user input.

Difference from skills: Commands and skills have been merged into one system - both create /commands. A command is a single flat .md file (a prompt template, $$ARGUMENTS supported); a skill is a directory with a SKILL.md entrypoint that adds supporting files, frontmatter configuration, and automatic invocation when relevant.

Hooks - Deterministic Enforcement

HookFires WhenUse For
PreToolUseBefore a tool executesBlock dangerous calls, validate parameters, require confirmation
PostToolUseAfter a tool returnsValidate output, sanitise results, audit logging, trigger side effects

Critical property: Hooks are deterministic - they run as code, not as model instructions. They cannot be bypassed by prompt injection or model reasoning.

Contrast with prompt instructions:

Working Modes

ModeWhen to Use
Plan modeComplex tasks, multiple possible approaches, need to think before acting
Direct executionClear scope, well-defined task, no ambiguity about approach
-p flag (non-interactive)CI/CD pipelines, automated workflows, no human present

Plan mode signals: The task is complex, has multiple valid approaches, or the consequences of a wrong approach are high. Plan mode forces Claude to outline its approach before executing.

-p flag: Runs Claude Code in non-interactive mode. Essential for CI/CD integration. No confirmation prompts, no interactive input - the command must be self-contained.

CLI Flags (Headless & Non-Interactive)

-p is the most-tested flag, but know the rest of the headless toolkit too.

FlagWhat it does
-p / --printNon-interactive (print) mode for CI/CD and piping
-c / --continueResume the most recent conversation in this directory
-r / --resume <id|name>Resume a specific session
--bareMinimal mode: skips hooks, skills, plugins, MCP, memory, and CLAUDE.md for faster scripted runs
--output-format text|json|stream-jsonOutput shape for -p (json and stream-json are parseable)
--json-schema '<schema>'Schema-validated output for -p (lands in the JSON envelope's structured_output field)
--max-turns <n>Cap agentic turns in print mode
--permission-mode <mode>default, acceptEdits, plan, auto, dontAsk, bypassPermissions
--allowedTools / --disallowedToolsAllow or deny tool calls without prompting
--add-dir <path>Add a readable/editable working directory
--model <alias|name>Set the session model

System prompt - append vs replace (exam favourite):

FlagEffect
--append-system-prompt "<text>"Adds to the default prompt; keeps tool guidance and safety instructions
--system-prompt "<text>"Replaces the whole default prompt; you own everything it needs

The *-file variants (--append-system-prompt-file, --system-prompt-file) load the same text from a file.

Feedback Techniques

Permissions & Security

Decision Rules for the Exam

If the question says...The answer is likely...
"guaranteed enforcement", "cannot be bypassed"Hooks (PreToolUse/PostToolUse)
"style guidance", "preferred approach"Prompt instructions in CLAUDE.md
"applies only to specific file paths".claude/rules/ with paths frontmatter
"reusable workflow with restricted tools"Skills (.claude/skills/)
"prompt template with arguments"Commands (.claude/commands/)
"CI/CD pipeline", "automated", "non-interactive"-p flag
"extra rules but keep default coding behaviour"--append-system-prompt (not --system-prompt)
"fast scripted run, skip project config/hooks/skills"--bare
"machine-parseable / schema-validated CI output"--output-format json + --json-schema
"review quality of generated code"Independent session (not the writing session)
"multiple approaches, complex task"Plan mode first
"personal preference, not shared"~/.claude/ (user-level config)

Common Exam Traps

TrapCorrect Answer
"Put all rules in the project CLAUDE.md"Wrong - use .claude/rules/ for path-specific rules
"Hooks are prompt-based guardrails"Wrong - hooks are deterministic code, not prompt instructions
"Review code in the same session that wrote it"Wrong - model retains reasoning bias; use independent session
"A flat .md file directly inside .claude/skills/ creates a command"Wrong - skills are directories with a SKILL.md entrypoint; flat files belong in .claude/commands/
"User CLAUDE.md overrides project CLAUDE.md"Wrong - CLAUDE.md files are concatenated, none overrides another; contradictions may be resolved arbitrarily
"-p flag enables plan mode"Wrong - -p enables non-interactive (piped) mode for CI/CD
"--append-system-prompt replaces the system prompt"Wrong - it appends and keeps the defaults; --system-prompt replaces

Previous

Domain 2: Tool Design & MCP Integration

Next

Domain 4: Prompt Engineering & Structured Output