The exercises below assume you know what a session, a glob, frontmatter and a
skill are, and that you know where to type /memory. If any of that is fuzzy,
Start Here covers the mental model, the
vocabulary and your first five minutes — about ten minutes of reading.
Domain 3 is the one exam domain you can settle by doing rather than revising. Every mechanism it tests — the memory hierarchy, path-scoped rules, commands, skills, plan mode, permissions, headless mode — is a file you create or a command you type, and each takes about five minutes to see working.
The lab runs in a throwaway repository at ~/cca-f-lab. Nothing touches your real projects.
When you are finished: rm -rf ~/cca-f-lab.
Work in order. Later exercises depend on files earlier ones create, and several of them are built to contradict each other on purpose — that is how you see precedence.
bash ~/ClaudeCertifiedArchitect/CCA-F/D3-Hands-On-Lab/setup.sh
This builds a small monorepo with the one property that matters for Domain 3: test files sit beside their
sources in both trees — order_test.go next to order.go,
Button.test.tsx next to Button.tsx. Several exam items turn on exactly that detail,
because it is what makes a directory-scoped rule insufficient.
Then open ~/cca-f-lab as your working folder in the editor and start a Claude Code session
there.
claude CLI on your PATH —
you have been using the VS Code extension only. Exercises 1–6 work entirely in the extension. Exercise 7 needs
the CLI; install it when you get there, or run it through npx. Exercise 8 is reading, not typing.You are going to create three conflicting instructions at three levels, then find out which one wins — by asking rather than guessing.
~/cca-f-lab/CLAUDE.md:
# Lab conventions
- Name Go test helpers with a `mk` prefix, e.g. `mkOrder`.
- Every exported Go function needs a doc comment.~/cca-f-lab/web/CLAUDE.md:
# Web conventions
- Name React test helpers with a `build` prefix, e.g. `buildButtonProps`.mkdir -p ~/.claude
cat >> ~/.claude/CLAUDE.md <<'EOF'
<!-- CCA-F LAB — delete this block when the lab is done -->
- Personal preference: prefer table-driven tests everywhere.
EOF/memory.git status — the project and directory CLAUDE.md files show as untracked (they would be
committed and shared); the user-level file does not appear at all, because it lives outside the repo. That
difference is the answer to every "who gets this on clone?" question./memory tells you what is
actually loaded rather than what you assume is.Your lab has test files in services/orders/ and in web/src/components/. A convention
that applies to all tests regardless of location has no single directory to live in. That is the
problem path globs solve.
~/cca-f-lab/.claude/rules/tests.md:
---
paths:
- "**/*_test.go"
- "**/*.test.tsx"
---
# Test conventions (all trees)
- One assertion per test case.
- Test names read as sentences: `TestOrder_IsSettled_ReturnsTrueWhenSettled`.
- Never assert on unexported state.services/orders/order_test.go. Note whether the naming
convention is applied.services/billing/invoice.go — a file the glob does
not match. Note whether the test convention shows up in its reasoning.CLAUDE.md in
services/ have achieved this? No — Button.test.tsx is in a different tree entirely.
Could one in the root? Only by loading it for every file, everywhere.paths: frontmatter, do not conclude the exam answer is different — the exam tests the
documented behaviour in the exam guide. Note the discrepancy and move on; the reasoning is what is being
assessed.CLAUDE.md scopes by subtree. When a convention crosses trees, only
the first can express it.This exercise exists to kill one specific distractor that catches people: @import looks like
the answer to "my CLAUDE.md is too big", and it is not.
~/cca-f-lab/.claude/go-conventions.md with a few Go rules in it.~/cca-f-lab/CLAUDE.md with an import of that file./memory again, and open a file in web/.@import
improves how humans maintain the file. It does nothing for context economy or relevance. When a question
complains about both size and irrelevant conventions being applied, the answer is path-scoped rules.~/cca-f-lab/.claude/commands/rfc.md:
---
argument-hint: [decision title]
---
Draft an architecture decision record for: $ARGUMENTS
Use these headings: Context, Decision, Consequences, Alternatives considered.
Keep it under one page.~/.claude/commands/rfc-mine.md with an extra heading./ and look at the list. Run /rfc caching layer.git status in the lab repo..claude/commands/rfc.md appears in git status. That is the entire distinction the exam
draws: a teammate cloning this repo gets /rfc and does not get /rfc-mine.A command is a prompt template. A skill can restrict its own tools and run in an isolated context. Those two frontmatter fields are what most exam items about skills actually turn on.
~/cca-f-lab/.claude/skills/audit-tests/SKILL.md:
---
name: audit-tests
description: Scan every test file in the repo and report coverage gaps and naming violations.
argument-hint: [optional path to narrow the scan]
allowed-tools: Read, Grep, Glob
context: fork
---
Find every test file in the repository. For each one, report:
1. Test functions whose names do not read as sentences.
2. Test functions containing more than one assertion.
3. Source files with no corresponding test file.
Return a compact table. Do not modify any file.allowed-tools excludes
Write and Edit, so the skill cannot modify a file even if you ask it to —
that is an enforced boundary, not an instruction. Second, with context: fork the scan happens in an
isolated sub-context and only the summary comes back, so the main conversation never carries the raw output.Run the same request twice so the difference is the mode and nothing else.
git checkout . && git clean -fd.This is the one exercise that needs the CLI. Two exam facts become obvious the moment you run it.
npx for a one-off.cd ~/cca-f-lab
echo "" | npx @anthropic-ai/claude-code "List the Go files in this repo"
Observe the behaviour. Then interrupt it.npx @anthropic-ai/claude-code -p "List the Go files in this repo, one per line"npx @anthropic-ai/claude-code -p "List every Go file with its line count" \
--output-format json | jq .-p / --print is what makes the run
non-interactive, and that closing stdin is not a substitute — it ends the session rather than running it
headlessly. Then look at the JSON shape and ask yourself how a workflow would turn it into an inline PR comment
anchored to a file and line. That question is what --json-schema exists to answer.Your lab repo has an infra/ directory. Treat it as production Terraform.
~/cca-f-lab/.claude/settings.json denying writes under infra/
and denying Terraform commands through Bash. Use /config or the settings schema at
~/.vscode/extensions/anthropic.claude-code-*/claude-code-settings.schema.json as your
reference for the exact shape.infra/main.tf.CLAUDE.md. Ask again, a few times, with
slightly different phrasings.Delete the lab repo, and remove the block you appended to your real user-level memory:
rm -rf ~/cca-f-lab
# then edit ~/.claude/CLAUDE.md and delete the "CCA-F LAB" block
# and remove the personal command you created:
rm -f ~/.claude/commands/rfc-mine.md
| Exercise | Objective | The question shape it answers |
|---|---|---|
| 1 | 3.1 Hierarchy & scoping | "Every developer must have X on clone" / "which memory file wins?" |
| 2 | 3.3 Path-specific rules | "Conventions apply to files scattered across directories" |
| 3 | 3.1 Modular organisation | "CLAUDE.md is too big and applies irrelevant rules" |
| 4 | 3.2 Slash commands | "Shared with the team vs personal to one developer" |
| 5 | 3.2 Skills | "Needs tool restriction and/or context isolation" |
| 6 | 3.4 Plan mode | "Multiple valid approaches, architectural consequences" |
| 7 | 3.6 CI/CD | "The job hangs" / "findings must post as inline comments" |
| 8 | 3.x Permissions | "This must never happen" — enforced vs instructed |
When you finish, re-sit the Domain 3 items in Mock Exam #4 (Q11–Q16, Q38–Q39, Q41–Q44) and check whether you can now say why each distractor fails, not just which option is right. That is the difference between 11/12 by recognition and 11/12 by understanding.