Ussama Assad Start a project

Domain 3 of 5 · 20% of the exam

Claude Code Configuration & Workflows

What it covers

CLAUDE.md levels, skills and slash commands, path-scoped rules, plan mode or direct execution, iterative refinement, CI/CD. About 20% of scored items, by the official exam guide.

Know cold

One idea per card. Open the ones you aren't sure of.

CLAUDE.md levels

Project CLAUDE.md is committed and shared with the team. ~/.claude/CLAUDE.md is yours alone. The docs suggest keeping each file under about 200 lines.

@path imports organise, they don't save context

An imported file loads together with the CLAUDE.md that imports it.

Path-scoped rules

A file in .claude/rules/ with paths: frontmatter loads when Claude reads, writes or edits a matching file. A rule without paths: loads every session. One glob such as **/*.test.tsx beats a CLAUDE.md in every folder.

Skills

.claude/skills/<name>/SKILL.md is the project skill your team gets on clone. ~/.claude/skills/<name>/SKILL.md is personal. context: fork runs the skill as a subagent that doesn't see your conversation; only its result comes back. It has nothing to do with git.

Checking what loaded

The exam guide names /memory for checking which memory files are loaded. Current docs describe /memory as listing and opening your memory files, and /context as showing which ones loaded at launch. Know both. Asking Claude to repeat its rules back tests generation, not what loaded.

Hooks

PreToolUse can deny a call before it runs: use it for "must never happen". PostToolUse runs after the tool already ran: use it for formatting, logging or feedback. It can't undo a push.

Plan mode or direct

Plan mode researches and proposes without editing until you approve. Use it when there are several valid approaches or a wide blast radius. A small, clear fix goes direct.

Iterating

When prose instructions keep missing, give concrete input and output examples, write tests, and feed the failures back. Use the interview pattern when the requirements themselves are unclear.

CI

claude -p runs without the interactive interface. --output-format json for scripts, --json-schema for a validated shape, --append-system-prompt to add instructions.

Traps

  • context: fork is not a git fork. It runs the skill as a subagent without your conversation. Nothing happens to the repository.
  • Expecting an import to save context. @path tidies CLAUDE.md, but the imported file still loads with it. For conventions that apply only to some files, use a path-scoped rule.
  • PostToolUse as a blocker. It runs after the tool already ran. For "must never happen", use PreToolUse.
  • A flag you have never seen. If an option or environment variable isn't in the CLI reference, it is usually invented.
  • Asking Claude to repeat its rules. That tests generation, not what loaded. Check with /memory or /context.

Practice: 4 questions

Q9 · Domain 3 · Claude Code Configuration & Workflows

SQL migration conventions should apply to db/migrations/**/*.sql and services/*/migrations/*.sql and nowhere else. The root CLAUDE.md is already long. What keeps these conventions out of unrelated sessions?

  1. A. Move the conventions into migrations.md and pull it into CLAUDE.md with an @migrations.md import.
  2. B. Create .claude/rules/migrations.md with a paths: list in its frontmatter holding both globs.
  3. C. Put a copy of the conventions in a CLAUDE.md file inside every migrations folder in the repo.
  4. D. Move the conventions out of the project and into your personal ~/.claude/CLAUDE.md file.
Answer and explanation

Answer: B. A rule with paths: frontmatter loads when Claude reads, writes or edits a matching file. Imported files load together with the CLAUDE.md that imports them, so an import tidies the file but saves no context. Per-folder copies duplicate the rule and drift. The personal file loads in every project and isn't shared with the team.

  • A. An imported file loads together with the CLAUDE.md that imports it. The file gets tidier but no context is saved.
  • B. Right. A rule with paths: frontmatter loads when Claude reads, writes or edits a matching file, and both globs fit in one list.
  • C. Per-folder copies duplicate the rule, and copies drift apart.
  • D. The personal file loads in every project and isn't shared with the team.

Q10 · Domain 3 · Claude Code Configuration & Workflows

Claude Code must never run git push --force against main in your repository. Which mechanism guarantees that?

  1. A. A line in the project CLAUDE.md stating that force pushes to main are forbidden.
  2. B. A PostToolUse hook on Bash that detects a force push and then reverts it.
  3. C. A PreToolUse hook on Bash that denies any command matching a force push to main.
  4. D. An instruction asking Claude to check with you before it runs any git command.
Answer and explanation

Answer: C. A PreToolUse hook runs before the tool call and can deny it. PostToolUse runs after the command has already happened, and a force-pushed history can't be reliably taken back. The CLAUDE.md line and the check-with-me instruction both depend on the model remembering.

  • A. A CLAUDE.md line depends on the model remembering it, so it can't guarantee anything.
  • B. PostToolUse runs after the command has already happened, and a force-pushed history can't be reliably taken back.
  • C. Right. A PreToolUse hook runs before the tool call and can deny it, so the push never runs.
  • D. An instruction to check with you still depends on the model remembering it.

Q11 · Domain 3 · Claude Code Configuration & Workflows

Your team's /release-notes skill has context: fork in its frontmatter. A developer complains that it ignores decisions they made earlier in the same conversation. Why?

  1. A. The forked skill runs as a subagent without your conversation history, so its prompt must stand alone.
  2. B. context: fork makes a git fork of the repository, so the skill is working from an older copy of the code.
  3. C. Skills can never read the conversation, whether they are forked or not, so this is expected behaviour.
  4. D. The skill has to live in ~/.claude/skills/ rather than .claude/skills/ before it can read the conversation.
Answer and explanation

Answer: A. context: fork starts a subagent and gives it the skill's content as its prompt. It doesn't get your conversation history; only its result comes back. Claude Code's docs say to fork the conversation instead when the task depends on that history. The git reading is the familiar-word trap. Skills without fork run inline, and the folder a skill lives in has nothing to do with it.

  • A. Right. context: fork starts a subagent and gives it the skill's content as its prompt. It doesn't get your conversation history; only its result comes back.
  • B. This is the familiar-word trap. context: fork has nothing to do with git.
  • C. Skills without fork run inline in your conversation. Only the forked one runs without it.
  • D. The folder a skill lives in has nothing to do with whether it sees the conversation.

Q12 · Domain 3 · Claude Code Configuration & Workflows

You want Claude Code to review each pull request in CI and emit findings that a script then parses. Nobody is at a keyboard. Which invocation fits?

  1. A. Start claude in a detached terminal session and have the CI job send it keystrokes.
  2. B. Run claude --ci --review-only so it skips prompts and prints only review findings.
  3. C. Set the CLAUDE_HEADLESS=true environment variable, then run claude as you normally would.
  4. D. Run claude -p "<review prompt>" --output-format json, plus --json-schema for a fixed shape.
Answer and explanation

Answer: D. -p (--print) runs without the interactive interface, --output-format json gives output a script can parse, and --json-schema validates the result against your schema. The flags in B and the variable in C don't appear in the Claude Code CLI reference. On this exam, a flag you have never seen in the docs is usually invented.

  • A. -p already runs Claude Code without the interactive interface, so there is no need to drive a terminal with keystrokes.
  • B. --ci and --review-only don't appear in the Claude Code CLI reference. A flag you have never seen in the docs is usually invented.
  • C. That variable doesn't appear in the Claude Code CLI reference, and running claude as normal opens the interactive interface.
  • D. Right. -p (--print) runs without the interactive interface, --output-format json gives output a script can parse, and --json-schema validates the result against your schema.