Vault / wiki/301/practice/domain-3-claude-code.md
updated 2026-05-28Practice — Domain 3: Claude Code Configuration & Workflows (20%)
18 scenario-based MCQs. Answer key + explanations at the bottom.
Q1
Your team agreed every engineer should use pnpm rather than npm. Where should this convention live so every teammate picks it up automatically?
A. ~/.claude/CLAUDE.md
B. <repo>/.claude/CLAUDE.md (committed to repo)
C. <repo>/.claude/CLAUDE.local.md (gitignored)
D. Inline in each prompt
Q2
You have a personal preference of "always explain Go code in terms of TypeScript analogues." Where should this live?
A. ~/.claude/CLAUDE.md
B. <repo>/.claude/CLAUDE.md
C. <repo>/.claude/settings.json
D. A slash command
Q3
A project lead wants to make sure git push --force can never run in any team member's Claude Code session, even by mistake. Best placement?
A. CLI flag at session start
B. <repo>/.claude/settings.json with "deny": ["Bash(git push --force:*)"]
C. ~/.claude/settings.json
D. A hook on PostToolUse
Q4
The same permission appears in ~/.claude/settings.json (allowed) and <repo>/.claude/settings.json (denied). What happens?
A. Allow wins; the call proceeds without confirmation B. The user is prompted C. Deny wins; the call is blocked D. The shared file is ignored
Q5
You want every Edit and Write to be followed by pnpm lint --fix so formatting stays consistent. Which mechanism?
A. A skill named "lint-after-edit"
B. A PostToolUse hook with matcher Edit|Write running pnpm lint --fix
C. A slash command /lint
D. CLAUDE.md instruction to "always run lint after editing"
Q6
A PreToolUse hook exits with code 2 and stdout "Don't push to main on Fridays". What happens?
A. The tool runs anyway; the message is logged B. The tool call is blocked and the stdout is surfaced to Claude as the reason C. The session crashes D. Claude is rate-limited
Q7
You're running Claude Code in CI to review PRs. Which invocation pattern fits best?
A. Interactive claude in a CI runner
B. claude --print "review the diff" --output-format json with a narrow allowed-tools set and a deny for destructive bash
C. claude --plan-mode and wait for human approval
D. A subagent without permissions
Q8
A team member wants a quick /review command that runs the current diff through a code review prompt. Where should it live (shared with the team)?
A. <repo>/.claude/commands/review.md
B. <repo>/.claude/skills/review/SKILL.md
C. <repo>/.claude/agents/review.md
D. ~/.claude/commands/review.md
Q9
The team frequently makes PowerPoint summaries from internal documents. A reusable capability with bundled scripts and templates fits best as:
A. A skill (.claude/skills/pptx/SKILL.md + scripts/)
B. A slash command
C. A subagent
D. A hook
Q10
Plan mode is most appropriate for:
A. A typo fix in one file B. A refactor that may touch 12 files; user wants to approve the plan first C. Bulk classification of 10K rows D. A CI run that should be unattended
Q11
You want a read-only Claude Code review session — no edits, no writes, no shell. Which settings shape achieves this?
A. "allow": ["*"]
B. "allow": ["Read(./**)", "Grep(*)", "Glob(*)"], "deny": ["Edit(*)", "Write(*)", "Bash(*)"]
C. Plan mode only
D. Remove all tools from CLAUDE.md
Q12
A subagent defined in .claude/agents/explore.md returns a long trace of its work. The parent agent sees:
A. The full subagent transcript B. Only the final summary string the subagent returns C. Nothing — subagents are silent D. Errors only
Q13
Which Claude Code primitive is automatically loaded at the start of every session in the project root?
A. Skills (full content) B. CLAUDE.md (project + parent + user hierarchy) C. All slash commands' bodies D. All subagents' full system prompts
Q14
Your team wants Claude Code to run a long-running task (overnight repo audit) on Anthropic-managed infrastructure even when laptops are closed. Which feature?
A. /loop (CLI session polling)
B. Desktop scheduled tasks
C. Routines (Anthropic-managed cron)
D. GitHub Actions only
Q15
A skill's description frontmatter field is most analogous to:
A. A tool's description — it's how Claude decides to invoke the skill
B. A file name
C. A README
D. A commit message
Q16
Claude Code's --output-format json is most useful for:
A. UI streaming B. Piping Claude's output into another script or CI step that needs to parse it C. Reducing token cost D. Disabling caching
Q17
What does a Stop hook fire on?
A. Every tool call
B. When the user types /stop
C. When the main agent finishes a turn (so you can run tests, post results, audit, etc.)
D. When the API rate-limits
Q18
A subagent declared with isolation: worktree runs in:
A. The same working directory as the parent B. A separate git worktree so writes don't conflict with the parent C. A Docker container D. A read-only copy of the repo
Answers
Q1: B. Team-shared conventions go in the repo's CLAUDE.md so every clone picks them up. (A) is per-user; (C) is local-only; (D) is fragile.
Q2: A. Personal preferences live in ~/.claude/CLAUDE.md. Putting them in shared config (B) imposes them on teammates.
Q3: B. Settings precedence: deny in shared settings is committed and applies to everyone. deny always wins over allow. A CLI flag (A) only protects one session; user settings (C) only protect one user; a PostToolUse hook (D) fires after the action already happened.
Q4: C. Deny always wins regardless of where it's set. Permission resolution evaluates denies first.
Q5: B. PostToolUse hook matching Edit|Write is the deterministic mechanism. A CLAUDE.md instruction (D) is read by the LLM and can be ignored under dilution; hooks are enforced by the harness.
Q6: B. Exit code 2 on PreToolUse blocks; stdout is surfaced to Claude as the reason — Claude reads it and adapts.
Q7: B. Non-interactive (--print) + parseable output (--output-format json) + narrow allowed-tools + explicit denies. (A) hangs on confirmations; (C) requires a human; (D) doesn't fit.
Q8: A. Slash commands live in .claude/commands/<name>.md. Project-shared if committed. The body is a templated prompt; not appropriate for skills, which are for richer capabilities with files.
Q9: A. A skill bundles a description (selection), instructions (SKILL.md), and helper scripts/templates. Slash commands are prompts only; subagents are isolated agents; hooks are reactive.
Q10: B. Plan mode is for ambiguous, multi-file work where the user benefits from seeing and editing the plan before execution. Trivial fixes (A) don't need it; bulk batch jobs (C) don't either; unattended CI (D) needs --print not interactive plan mode.
Q11: B. Explicit allow for read tools + explicit deny for write/shell tools. Plan mode (C) is similar but is a different mechanism (and an interactive cycle, not a settings-based lockdown).
Q12: B. Subagents return only their final summary string to the parent. Context isolation is the whole point.
Q13: B. CLAUDE.md hierarchy (project + parents + ~/.claude) is automatically loaded each session. Skills load lazily (only description in context until invoked); slash commands only execute when the user types them; subagents only execute when delegated.
Q14: C. Routines run on Anthropic-managed infrastructure even when your machine is off. (B) Desktop scheduled tasks run on your machine. (A) is a CLI-session polling primitive.
Q15: A. A skill's description, like a tool's description, is what Claude reads to decide whether to invoke. Quality of description drives selection accuracy.
Q16: B. --output-format json produces a parseable envelope ideal for chaining into other CI steps or scripts.
Q17: C. Stop fires when the main agent finishes a turn — useful for running tests, posting results, audit logging.
Q18: B. isolation: worktree creates a separate git worktree so the subagent's edits don't collide with the parent's working directory.