Study guides / CCDV-F

Quick reference

One condensed cheat-sheet per domain - the tables and rules worth re-reading right before the exam.

CLAUDE.md Scope Hierarchy

ScopeFile LocationShared With Team?Use For
Enterprise managed policyDeployed by org IT/security, outside any repoN/A - organization-wide, always winsNon-overridable org policy
Project-levelCLAUDE.md at repo rootYes - checked into version controlBuild/test commands, architectural conventions, style rules
User-level~/.claude/CLAUDE.mdNo - individual onlyPersonal preferences, individual tooling shortcuts

@path/to/file imports let a root CLAUDE.md pull in more detailed docs (e.g. a testing guide) without bloating the file loaded every session.

Key exam rule: match guidance scope to file scope - team-wide conventions go in the committed project file; personal preferences go in the user-level file only. Mixing the two bloats the shared file with noise no teammate needs.

Permission System: allow / ask / deny

Configured in settings.json (not CLAUDE.md prose). Rules are Tool(pattern) strings, e.g. Bash(git commit:*), Bash(rm:*), Edit.

ListBehavior
allowRuns without prompting
askPrompts the user before running
denyBlocked outright, no prompt
Settings FileScope
.claude/settings.jsonProject - checked in, shared with team
.claude/settings.local.jsonIndividual - gitignored personal overrides
~/.claude/settings.jsonUser - across all of that person's projects
Enterprise-managed fileOrganization - always wins

Precedence rule (exam-critical): within permission evaluation, a matching deny always beats a matching allow, regardless of which file each rule came from. You cannot allow-list your way past a deny.

Hooks, Slash Commands & Session Reset

Hook EventFires WhenCan Block?
PreToolUseBefore a tool runsYes - exit code 2 blocks it
PostToolUseAfter a tool runsNo - reacts to the result
UserPromptSubmitUser submits a promptNo
StopClaude finishes respondingNo

Hook scripts receive event JSON on stdin. Exit 0 = continue normally. Exit 2 = block the action; stderr is fed back to Claude as the reason so it can adjust and retry.

CommandEffectWhen to Use
/clearWipes context, starts freshSwitching to an unrelated task
/compactSummarizes and shrinks the conversationSame task, conversation approaching the context window
/permissions, /mcpInspect current permission / MCP configDebugging a missing tool or unexpected block
Custom /nameRuns a Markdown template from .claude/commands/Packaging a repeated prompt; $ARGUMENTS substitutes trailing text

Headless Mode Output Formats

claude -p "<prompt>" (or --print) runs to completion with no REPL and no human - the CI shape. Returns a non-zero exit code on failure so a pipeline step can branch on it.

--output-formatReturnsUse When
text (default)Plain text final responseHuman reading a log - fragile for scripts
jsonOne JSON object: result, session ID, usage/costCI script needs to parse pass/fail - the reliable choice
stream-jsonNewline-delimited JSON events as the run progressesLong CI step; want progress streamed into the log

Scoping an Unattended Run

FlagControls
--allowedToolsExplicit tool allowlist for this invocation
--disallowedToolsExplicit tool denylist for this invocation
--permission-mode planProduces a plan, executes nothing
--permission-mode acceptEditsAuto-approves file edits, still gates other risky actions
--permission-mode bypassPermissionsSkips permission checks entirely
--max-turns NCaps agentic turns - bounds time and cost

bypassPermissions / --dangerously-skip-permissions removes the only safety net in an unattended run. Use it only inside an ephemeral, sandboxed CI container with no access to real credentials or production systems - never on a shared runner or dev machine.

CI Auth & Session Hygiene

DistractorCorrect Practice
Parse free-text output with regexRequest --output-format json
Reuse one long-lived session across CI runsFresh session per run - avoid --resume/--continue
Use bypassPermissions as a general CI convenienceRestrict it to ephemeral, sandboxed, credential-free containers
Rely on claude login in CIUse ANTHROPIC_API_KEY from the secret store