Claude Academy
Sign in

CCA-F Certification Prep · lesson 5 of 10

Domain 3 — Claude Code Configuration & Workflows (20%)

How to set up Claude Code for teams, CI, and complex workflows.

Topics

3.1 CLAUDE.md hierarchy

  • ~/.claude/CLAUDE.md — personal global.
  • <repo>/CLAUDE.md or <repo>/.claude/CLAUDE.md — project-shared (committed).
  • <repo>/.claude/CLAUDE.local.md — project-local, gitignored.
  • Subdir CLAUDE.md — scoped to that subtree.

Memorize precedence and what belongs where.

3.2 Settings / permissions

  • Files: .claude/settings.json (shared), .claude/settings.local.json (local), ~/.claude/settings.json (user).
  • Precedence: CLI flags > local > shared > user > enterprise.
  • deny evaluated first, always wins.
  • allow skips the confirmation prompt.
  • Patterns are Tool(arg-glob) style: Bash(npm test:*), Read(./**).

3.3 Slash commands

  • Live in .claude/commands/<name>.md (shared) or ~/.claude/commands/<name>.md (user).
  • Body is the prompt. $ARGUMENTS interpolates user input. Backticks run shell.
  • Frontmatter: description, allowed-tools, argument-hint.
  • Cheap, parameterized, no context overhead.

3.4 Skills

  • .claude/skills/<name>/SKILL.md — required.
  • Frontmatter description triggers selection; the body is loaded on invocation.
  • May include scripts/resources alongside SKILL.md.
  • Lazy-loaded — many skills are fine.

3.5 Subagents

  • .claude/agents/<name>.md — frontmatter description, tools, model, isolation.
  • Run in isolated context. Receive only the parent's prompt; return only a final summary.
  • Use for: bounded research, parallel exploration, isolated risky writes.

3.6 Hooks

  • Events: PreToolUse, PostToolUse, UserPromptSubmit, Stop, SubagentStop, Notification, SessionStart.
  • Hook = shell command, runs synchronously, gets event JSON on stdin.
  • Exit code 2 blocks the action; stdout becomes the reason for the model.
  • Use for: lint/format on edit, test on stop, audit, secret scanning.

3.7 Plan mode

  • --permission-mode plan or Shift+Tab cycle.
  • Read-only; agent proposes plan, user approves, agent executes.
  • Best for multi-file changes, refactors, ambiguous tasks.

3.8 Non-interactive / CI use

  • claude --print "task" for one-shot.
  • --output-format json for parseable output.
  • --output-format stream-json for streaming events.
  • Combine with narrow allow list + hooks for safety.

3.9 Sessions

  • /clear to reset; /resume to continue.
  • Sessions persist working directory and history.
  • Worktree isolation (subagent isolation: worktree) keeps filesystem changes scoped.

Common question shapes

  • "Where should a team-wide convention live?" → <repo>/.claude/CLAUDE.md, committed.
  • "Where should personal style preferences live?" → ~/.claude/CLAUDE.md.
  • "How to enforce that pre-commit lint always runs?" → PostToolUse hook on Edit|Write, or Stop hook.
  • "Run Claude in CI without blocking on confirmations?" → --print + permissive allow for read-only tools + denies for destructive.
  • "Refactor across 12 files safely?" → Plan mode → user approval → execute.

Cheatsheet

  • Shared > Local > Personal for team consistency.
  • Deny always wins.
  • Hooks > prompt rules for non-negotiable behavior.
  • Plan mode for ambiguity.
  • CI uses --print + narrow allow + hooks.

See also