CCA-F › Domain 3 Hands-On Lab

Domain 3 — Hands-On Lab

Claude Code Configuration & Workflows · 20% of the exam · ~60–90 minutes · do it, don't read it

New to this? Read the explainer first

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.

Open Start Here →

Why this lab exists

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.

8 exercises Throwaway repo Objectives 3.1 – 3.6

Setup

Before you start

Create the lab repository

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.

One thing to check first. You have no standalone 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.

Part A — Memory: what loads, where, and when

Exercise 1

The three-level memory hierarchy, and how to observe it

3.1 CLAUDE.md hierarchy & scoping

You are going to create three conflicting instructions at three levels, then find out which one wins — by asking rather than guessing.

  1. Create a project-level file at ~/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.
  2. Create a directory-level file at ~/cca-f-lab/web/CLAUDE.md:
    # Web conventions
    
    - Name React test helpers with a `build` prefix, e.g. `buildButtonProps`.
  3. Create a user-level file. This one is yours, not the project's — and note that version control will never distribute it, which is the point being tested:
    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
  4. In your Claude Code session, run /memory.
What to look for: which files are listed as loaded, and at which level. Then run 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.
Kills the trap: Wrong scope or wrong home. Shared and required → project. Personal or experimental → user level. If you can't remember which, /memory tells you what is actually loaded rather than what you assume is.
Exercise 2

Path-scoped rules — the mechanism directory files cannot replace

3.3 Path-specific rules

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.

  1. Create ~/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.
  2. Ask Claude to add a test case to services/orders/order_test.go. Note whether the naming convention is applied.
  3. Now ask it to add a function to services/billing/invoice.go — a file the glob does not match. Note whether the test convention shows up in its reasoning.
What to look for: the rule influencing work on matching files and being absent for non-matching ones. Then ask yourself the exam question directly: could a 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.
Be honest about what you observe. If your build of Claude Code does not appear to honour 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.
Kills the trap: Wrong scope or wrong home. Glob rules scope by file pattern; directory CLAUDE.md scopes by subtree. When a convention crosses trees, only the first can express it.
Exercise 3

@import — modular, but still always loaded

3.1 Modular organisation

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.

  1. Create ~/cca-f-lab/.claude/go-conventions.md with a few Go rules in it.
  2. Replace the Go section of ~/cca-f-lab/CLAUDE.md with an import of that file.
  3. Run /memory again, and open a file in web/.
What to look for: the imported content is loaded regardless of what you are editing. The file on disk got shorter; the context did not. Compare that directly with what Exercise 2 did.
Kills the trap: Modular-looking but still always loaded. @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.

Part B — Invocable things: commands vs skills

Exercise 4

Project command vs personal command

3.2 Custom slash commands
  1. Create ~/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.
  2. Create a personal variant at ~/.claude/commands/rfc-mine.md with an extra heading.
  3. In the session, type / and look at the list. Run /rfc caching layer.
  4. Run git status in the lab repo.
What to look for: both commands are available to you, but only .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.
Kills the trap: Personal scope for shared assets. "Everyone must have it on clone" has exactly one answer, and it is the committed project directory.
Exercise 5

A skill with real frontmatter — the part that separates it from a command

3.2 Agent Skills

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.

  1. Create ~/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.
  2. Invoke it. Watch the main conversation while it runs.
  3. Afterwards, ask Claude something that would require the raw scan output — for example, "what was in the third file you read?"
What to look for: two things. First, 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.
Kills the trap: Always-loaded home for on-demand work. When a question specifies tool restriction or keeping verbose output out of the conversation, a slash command cannot satisfy it and CLAUDE.md certainly cannot. Only a skill has those fields.

Part C — How work proceeds

Exercise 6

Plan mode versus direct execution, on the same task

3.4 Plan mode

Run the same request twice so the difference is the mode and nothing else.

  1. Direct: ask Claude to "add soft-delete to the Order type and filter it out everywhere orders are read." Let it start. Watch what it assumes.
  2. Discard the changes: git checkout . && git clean -fd.
  3. Plan mode: enter plan mode, make the identical request, and read the plan it produces before approving anything.
What to look for: in direct mode it picks an approach silently and starts typing. In plan mode it surfaces that there is a choice — filter in the accessor, filter at each call site, or expose a filtered view — and that they differ for any caller that legitimately wants deleted rows. The exam's plan-mode items are all built on that distinction: the tell is several valid approaches, not merely "this is a big change".
Kills the trap: Assuming the decision away. A distractor that says "pick approach X and proceed" is not answering the question — it is deciding, by assertion, the very thing the question is about.
Exercise 7

Headless mode and structured output — the CI shape

3.6 Claude Code in CI/CD

This is the one exercise that needs the CLI. Two exam facts become obvious the moment you run it.

  1. Get the CLI available — either install it, or use npx for a one-off.
  2. Run it without the print flag first, from a non-interactive context:
    cd ~/cca-f-lab
    echo "" | npx @anthropic-ai/claude-code "List the Go files in this repo"
    Observe the behaviour. Then interrupt it.
  3. Now run it properly:
    npx @anthropic-ai/claude-code -p "List the Go files in this repo, one per line"
  4. Then ask for machine-readable output and pipe it:
    npx @anthropic-ai/claude-code -p "List every Go file with its line count" \
      --output-format json | jq .
What to look for: that -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.
Kills the trap: Silencing a prompt instead of not prompting, and better parsing of unstructured prose. When output is consumed by a program, declare its schema — never regex the prose.
Exercise 8

Permissions are a control; plan mode and CLAUDE.md are not

3.x Tool permissions

Your lab repo has an infra/ directory. Treat it as production Terraform.

  1. Add a rule to ~/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.
  2. Ask Claude to add a tag to the S3 bucket in infra/main.tf.
  3. Now try the opposite experiment: remove the permission rule, and instead put "never modify anything under infra/" in CLAUDE.md. Ask again, a few times, with slightly different phrasings.
What to look for: the permission rule stops the write every time, visibly, at the tool layer. The CLAUDE.md rule is followed — usually. "Usually" is precisely the gap the exam is testing when it says a requirement must hold every time.
Kills the trap: Prompt where enforcement was required, and a working mode used as a security control. Permissions allow and deny; CLAUDE.md supplies context; plan mode governs how work proceeds. Only the first is a control.

Cleaning up

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

What this maps to on the exam

ExerciseObjectiveThe question shape it answers
13.1 Hierarchy & scoping"Every developer must have X on clone" / "which memory file wins?"
23.3 Path-specific rules"Conventions apply to files scattered across directories"
33.1 Modular organisation"CLAUDE.md is too big and applies irrelevant rules"
43.2 Slash commands"Shared with the team vs personal to one developer"
53.2 Skills"Needs tool restriction and/or context isolation"
63.4 Plan mode"Multiple valid approaches, architectural consequences"
73.6 CI/CD"The job hangs" / "findings must post as inline comments"
83.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.