Domain 2 · 20% of the exam · 12 questions

Claude Code Workflows: Certification Study Guide and Cheat Sheet

20% of the exam, about 12 questions. Every config file, hook and flag on one printable page.

Updated , checked against Anthropic's docs.

Take the 12-question quiz

Domain 2 at a glance

Weight
20%
Questions
~12 of 60
Pass line
720/1000
Study time
~35 min

Claude Code Configuration & Workflows is the second largest domain on the exam. Scenario questions about which file, scope or exit code produces the behavior a team wants.

  • CLAUDE.md memory hierarchy (user, project, directory) and imports
  • settings.json, permission modes, and allow/ask/deny rules
  • Hooks: events, matchers, exit codes, and blocking behavior
  • Built-in and custom slash commands
  • Subagents in .claude/agents with YAML frontmatter
  • MCP server config and scopes (local, project, user)
  • Headless mode and GitHub Actions / CI/CD integration

CLAUDE.md memory hierarchy

Claude Code loads memory files at startup, from the broadest scope to the narrowest. More specific files are read later and win when instructions conflict. Files in subdirectories load on demand when Claude reads files there.

ScopeLocationShared withNotes
Managed policyOS-level managed path (set by IT)Everyone on the machineCannot be excluded by users
Project./CLAUDE.md or ./.claude/CLAUDE.mdThe team, via gitBuild commands, conventions, architecture
User~/.claude/CLAUDE.mdJust you, all projectsPersonal preferences
Project local./CLAUDE.local.mdJust you, this projectGitignored; personal project notes
Subdirectory./some/dir/CLAUDE.mdThe teamLoaded when Claude works in that directory
  • Import other files with @path/to/file inside CLAUDE.md. Imports can nest up to five hops deep.
  • /memory opens the loaded memory files in your editor; /init drafts a project CLAUDE.md from the codebase.
  • CLAUDE.md is guidance the model reads. It does not enforce anything; settings and hooks do.

settings.json, permission modes and rules

Settings precedence, highest first
RankFileCommitted?
1Managed settings (managed-settings.json, set by IT)No, deployed by policy
2Command line argumentsNo
3.claude/settings.local.jsonNo, gitignored
4.claude/settings.jsonYes, shared with the team
5~/.claude/settings.jsonNo, personal
Permission modes (`permissions.defaultMode`)
ModeBehavior
defaultPrompts the first time each tool is used
acceptEditsAuto-accepts file edits for the session; other tools still prompt
planRead-only analysis; no edits or commands until you approve a plan
bypassPermissionsSkips prompts. Only for isolated containers or VMs; admins can disable it
Permission rule syntax
RuleMatches
Bash(npm run test:*)Any command starting with npm run test:
Bash(git push)Exactly git push
Read(./.env)Reading .env in the project root
Edit(src/**)Edits anywhere under src/
WebFetch(domain:docs.example.com)Fetches from that domain
mcp__github__create_issueOne tool from one MCP server
  • Rules live in permissions.allow, permissions.ask and permissions.deny. Deny beats ask, and ask beats allow, across every scope.
  • Read-only tools (Read, Grep, Glob) do not prompt by default; Bash and file edits do.

Hooks: events, matchers and exit codes

Hooks are shell commands Claude Code runs at fixed points. They are configured under hooks in any settings file, keyed by event, with an optional matcher that filters by tool name (a regex such as Edit|Write, or mcp__github__.*). This is the most-tested table in the domain.

EventFiresMatcherCan it block?
PreToolUseBefore a tool runsTool nameYes: the tool call is prevented
PostToolUseAfter a tool succeedsTool nameThe tool already ran; exit 2 feeds stderr back to Claude
UserPromptSubmitWhen you submit a promptNoneYes: the prompt is erased; stdout on exit 0 is added as context
StopWhen the main agent finishesNoneYes: forces Claude to keep working
SubagentStopWhen a subagent finishesNoneYes: forces the subagent to continue
SessionStartOn startup, resume or clearSourceNo; stdout on exit 0 is added as context
PreCompactBefore compactionmanual / autoNo
NotificationWhen Claude Code sends a notificationNoneNo
Exit codes
Exit codeMeaning
0Success. JSON on stdout is parsed for decisions (for example permissionDecision)
2Blocking error. stderr goes to Claude; stdout is ignored
Anything elseNon-blocking error. stderr is shown to the user and execution continues

On the exam, watch for exit 1 offered as "block the call". Only exit 2 blocks.

Slash commands, built-in and custom

A custom command is a Markdown file in .claude/commands/ (project, shared) or ~/.claude/commands/ (personal). The filename is the command name and subfolders namespace it. $ARGUMENTS receives everything after the command, $1 and $2 pick positional arguments, and frontmatter sets description, allowed-tools, argument-hint and model.

CommandWhat it does
/initDraft a project CLAUDE.md from the codebase
/memoryOpen memory files in your editor
/compact [instructions]Summarize the conversation to free context
/clearStart a fresh context in the same session
/permissionsView and edit allow, ask and deny rules
/agentsCreate and manage subagents
/mcpManage MCP servers and authenticate
/hooksReview and edit hook configuration
.claude/commands/fix-issue.md
---
description: Fix a GitHub issue by number
allowed-tools: Bash(gh issue view:*), Edit, Read
argument-hint: <issue-number>
---
Read issue #$ARGUMENTS with gh, find the cause, fix it, and add a test.

Subagents

Subagents are Markdown files with YAML frontmatter in .claude/agents/ (project) or ~/.claude/agents/ (user). When names collide, the project file wins. Only name and description are required. Claude delegates automatically when a task matches the description, or you can ask for one by name.

  • Omit tools and the subagent inherits every tool from the main thread; list them to apply least privilege.
  • Each subagent has its own context window, so it returns a summary rather than its full transcript.
.claude/agents/code-reviewer.md
---
name: code-reviewer
description: Reviews diffs for bugs and security issues. Use after any code change.
tools: Read, Grep, Glob
model: sonnet
---
You are a senior reviewer. Report findings by severity with file and line.

MCP server scopes

ScopeStored inVisible toAdd with
Local (default)~/.claude.json, under this projectYou, in this projectclaude mcp add name ...
Project.mcp.json in the repoEveryone who clones it, after approvalclaude mcp add --scope project ...
User~/.claude.jsonYou, in every projectclaude mcp add --scope user ...
  • Precedence when names collide: local, then project, then user.
  • Project-scope servers ask each user for approval before first use; claude mcp reset-project-choices clears those answers.
  • Separate Claude Code flags from the server command with --: claude mcp add github -- npx -y @modelcontextprotocol/server-github.
  • .mcp.json supports environment variable expansion such as ${GITHUB_TOKEN} so secrets stay out of git.

Headless mode and CI

FlagPurpose
-p "prompt"Run once non-interactively and print the result
--output-format text|json|stream-jsonMachine-readable output for scripts
--allowedTools "Read,Edit,Bash(npm test)"Pre-approve tools, since nobody is there to click
--permission-mode planSet the mode for this run
--max-turns 5Cap agentic turns; the run ends with an error result at the cap
--resume <id> / --continueContinue a specific or the most recent session
.github/workflows/claude.yml
on:
  issue_comment:
    types: [created]
jobs:
  claude:
    runs-on: ubuntu-latest
    steps:
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          claude_args: "--max-turns 10 --allowedTools Read,Edit,Bash(npm test)"

Common exam traps

Exit 1 does not block

Wrong: Exit 1 from PreToolUse stops the tool

Right: Only exit 2 blocks; other non-zero codes are non-blocking errors

The exam loves offering exit 1 as the blocking answer.

Deny always wins

Wrong: A specific allow overrides a broad deny

Right: Deny beats allow at every scope

Specificity does not matter between allow and deny.

CLAUDE.local.md is personal

Wrong: Put team policy in CLAUDE.local.md

Right: Team guidance goes in the committed CLAUDE.md or settings.json

The local file is gitignored.

CLAUDE.md is not enforcement

Wrong: "Never edit migrations" in CLAUDE.md is enough

Right: Use a deny rule or a PreToolUse hook

Memory is guidance; settings and hooks are controls.

Local beats shared settings

Wrong: The committed settings.json always wins

Right: settings.local.json outranks settings.json; managed settings outrank both

Precedence runs managed, CLI, local, project, user.

PostToolUse cannot undo

Wrong: PostToolUse exit 2 reverts the edit

Right: The tool already ran; exit 2 only feeds stderr back to Claude

Use PreToolUse to prevent an action.

Default MCP scope is local

Wrong: claude mcp add writes .mcp.json

Right: It writes local scope; use --scope project to share

Sharing is opt-in.

Headless needs pre-approved tools

Wrong: CI will prompt for permissions

Right: Pass --allowedTools or a permission mode

There is no human to approve a prompt in CI.

Flashcards

15 cards from the tables above. Flip each one and mark the ones you know; your progress is saved in this browser.

0/15 known. Keep going with spaced repetition and hundreds more cards in Claude Prep.

Get Claude Prep

One-page cheat sheet

Get these as flashcards with spaced repetition in Claude Prep.

Get Claude Prep

Practice quiz: 12 Claude Code Configuration & Workflows questions

Original, exam-style questions, one per task statement. Pick an answer to see the explanation. Finish all 12 for your score and your weakest topics. No signup.

0/12 answeredScore: 0
  1. Q1CLAUDE.md vs settingsfoundation

    Which of the following belongs in a settings file rather than in CLAUDE.md?

  2. Q2/memory commandfoundation

    What does the /memory slash command do in an interactive Claude Code session?

  3. Q3CLAUDE.local.mdfoundation

    What is the intended purpose of a CLAUDE.local.md file at the root of a project?

  4. Q4Subagent frontmatterfoundation

    Which YAML frontmatter fields must be present in a Claude Code subagent definition file?

  5. Q5/init commandfoundation

    A developer joins a project that has no CLAUDE.md and runs the /init command in Claude Code. What does /init do?

  6. Q6Memory importsfoundation

    Which syntax does a CLAUDE.md file use to import the contents of another file into Claude Code's context at launch?

  7. Q7Tool permission promptsfoundation

    In Claude Code's default permission mode, which category of tool actions runs without ever triggering an approval prompt?

  8. Q8CLAUDE.md best practicesfoundation

    According to Anthropic's guidance, which situation is the strongest signal that an instruction should be added to a project's CLAUDE.md?

  9. Q9Hook exit codesintermediate

    What happens when a PostToolUse hook exits with code 2 after Claude runs a Bash command?

  10. Q10Permission rulesintermediate

    A CI configuration contains the permission rules allow: ["Bash(aws s3 ls *)"] and deny: ["Bash(aws *)"]. When Claude Code attempts to run aws s3 ls s3://build-artifacts, what happens?

  11. Q11MCP scopesintermediate

    An engineer runs claude mcp add --transport http linear https://mcp.linear.app/mcp inside a project without specifying a --scope flag. Where will this server be available?

  12. Q12Headless permissionsintermediate

    A nightly job runs claude -p "Run the test suite and fix any failures" on a build server, but the job errors out as soon as Claude attempts its first file edit. What is the cause and the recommended fix?

Answer all 12 to see your score

You will get a score and your weakest topics. No signup.

Official sources

Every table on this page was checked against these Anthropic pages in October 2026. When a number here and the docs disagree, trust the docs.

All exam domains

FAQ

Claude Code Configuration & Workflows: FAQ

How many questions are on Claude Code workflows?+
Claude Code Configuration & Workflows is 20% of the exam, about 12 of the 60 questions.
Is CCAR-F the same as CCDV-F?+
No. They are separate credentials with different blueprints. CCAR-F (formerly CCA-F) has five domains with Claude Code at 20%. CCDV-F has eight domains and weights Claude Code operation at about 3%. The rules on this page apply to both. Check Anthropic's current exam guide for your track.
Do I need hands-on Claude Code experience?+
Strongly recommended. Many questions describe a team's setup and ask which file or scope fixes it. Having edited settings.json and written a hook makes those quick.
What hook exit code blocks a tool call?+
Exit code 2 from a PreToolUse hook blocks the call and sends stderr back to Claude. Exit 0 is success, and any other code is a non-blocking error.
Where do project vs user settings live?+
Shared project settings are in .claude/settings.json, personal project settings in .claude/settings.local.json, and user settings in ~/.claude/settings.json. Managed settings set by an administrator outrank all of them.