CCA-F · Personalised Edition

Exam Cheatsheet.

A condensed, personalised reference I built during prep. Organised by exam domain, with decision tables, anti-patterns, and a glossary. Useful as a final-week review. ← Back to cert details

Exam overview

Domain weights · format · scoring

Domain weights

DomainWeightKey focus
1. Agent Architecture & Orchestration27%Agentic loop, hub-and-spoke, hooks, subagents, escalation, error propagation
2. Tool Design & MCP Integration18%Tool descriptions, isError, tool_choice, built-in tools, MCP scoping
3. Claude Code Config & Workflows20%CLAUDE.md hierarchy, .claude/rules/, skills frontmatter, CI/CD, plan mode
4. Prompt Engineering & Structured Output20%Few-shot vs explicit criteria, JSON schema, batch API, retry loops, self-critique
5. Context Management & Reliability15%Progressive summarization, lost-in-middle, provenance, confidence calibration

Golden rules — know these cold

  • stop_reason == 'end_turn' is the ONLY valid loop exit signal
  • Programmatic hooks = 100% deterministic enforcement
  • Tool description = primary selection mechanism
  • Subagents have ZERO automatic context from parent
  • context: fork isolates verbose skill / subagent output
  • Project scope beats user scope — same name → project wins
  • .claude/rules/ = path-triggered · Skills = task-triggered
  • Batch API = no multi-turn tool calling (async fire-and-forget)
  • Coordinator owns ALL inter-agent communication

Never do these

  • Parse text for 'Task completed' to end loop
  • Prompt for financial/compliance rules (~3% fail rate)
  • Escalate on sentiment alone (angry ≠ complex)
  • Self-rated confidence (1–10) for routing decisions
  • Same session to generate AND review code
  • Subagent calls another subagent directly
  • /compact for multi-phase tasks (lossy — use Explore subagent)
  • User-level ~/.claude/CLAUDE.md for team standards
  • Generic MCP error: "Operation failed" (no recovery info)

Common decision boundaries in production agent design

Situation Correct choice Tempting wrong choice Why wrong choice fails
Format/structure inconsistency across outputsFew-shot examplesExplicit criteriaExamples demonstrate exact format; criteria specify rules — wrong tool for format problem
Novel pattern generalisation neededExplicit criteriaFew-shot examplesExamples only cover shown cases; criteria extend to unseen patterns
Context window filling in multi-phase task (verbose Phase 1)Explore subagent/compact/compact is lossy — exact numbers/dates/IDs lost; Explore returns accurate summary
Tool being misused for wrong purpose (fetch_url for search)Replace with scoped versionRemove tool entirelyRemoving breaks legitimate use; scoped tool makes misuse architecturally impossible
Skill output pollutes main conversation contextcontext: fork in frontmatterSplit into smaller skillsSplitting still runs in main context; fork isolates execution to subagent
Keyword-triggered tool misrouting (descriptions already clear)System prompt keyword steeringFix tool descriptionsDescriptions are clear — root cause is prompt-level routing instructions
Path-based auto-convention (tests scattered everywhere).claude/rules/ glob patternsCLAUDE.md sectionsCLAUDE.md requires Claude to infer; glob rules fire deterministically on file path
Task-specific context (useful for one task type only)Skill (on-demand).claude/rules/ globPath rules fire for ALL work in that directory; skills fire only when invoked
Timeout ("no response") vs "0 results found"Distinguish semanticallyReport both as failuresEmpty result = valid informative finding; timeout = access failure needing retry
Consistent explanation quality with variable per-case gapsSelf-critique / evaluator-optimizerFew-shot examplesExamples can't cover unpredictable variable gaps; self-critique catches case-specific issues

Domain 1 · Agent Architecture & Orchestration

27% — largest domain

The agentic loop — know this cold

while True:
    response = call_claude(messages, tools)
    if response.stop_reason == 'end_turn':   # ← ONLY valid exit — return result
        return response.content
    if response.stop_reason == 'tool_use':   # ← keep looping
        results = execute_tools(response.content)
        messages.append(assistant_message(response))
        messages.append(tool_results_message(results))
    # max_tokens hit? → increase max_tokens or chunk input  |  stop_sequence → handle per app logic
stop_reasonMeaningAction
end_turnModel finished responseReturn result to user — ONLY valid exit
tool_useModel wants to call a toolExecute tool, append result, loop again
max_tokensToken limit hit, response truncatedIncrease max_tokens or chunk input
stop_sequenceStop sequence encounteredHandle per app logic

Hub-and-spoke multi-agent topology

Coordinator rules

  • Coordinator owns ALL inter-agent communication
  • Decompose → delegate → aggregate → error handle
  • Subagents get ONLY explicitly passed context
  • Parallel spawn: multiple Task calls in ONE response
  • allowedTools must include 'Task' on coordinator
  • Observability: coordinator sees everything
  • Coordinator decides retry/escalation — not subagents
  • Partition research space BEFORE delegating (distinct subtopics)

Subagent anti-patterns

  • Subagent calls another subagent directly
  • Subagents assume they can read coordinator history
  • Passing full conversation log between agents
  • Coordinator decomposes topic too narrowly (misses domains)
  • "Task: analyze doc" with no context or format spec
  • Subagent requesting coordinator to retry upstream
  • Subagent aborting on partial failure (loses completed work)

Hooks — deterministic vs probabilistic

MethodReliabilityUse whenExample
PreToolUse hook100% deterministicFinancial ops, compliance, safety — MUST be 100%Block refund > $500, redirect to escalation
PostToolUse hook100% deterministicData normalization, format unificationConvert Unix timestamps → ISO 8601; trim 40-field response to 5 needed fields
System prompt instruction~97% probabilisticGeneral preferences, formatting, style only'Try to resolve before escalating'

Escalation patterns

SituationActionAnti-pattern to avoid
Customer says 'get me a manager'Escalate IMMEDIATELY — no investigation firstAttempting to solve it first
Policy gap (policy silent on competitor price match)Escalate — do NOT invent policyApplying nearest-matching rule
Agent cannot make progress after attemptsEscalate after reasonable attemptsInfinite retry loop
Multiple customer matches foundAsk for additional identifier (email, phone, order#)Heuristically guess the right one
High negative sentiment onlyDo NOT escalate on sentiment aloneSentiment ≠ case complexity
Refund amount > $500 thresholdPreToolUse hook enforces blockingSystem prompt instruction only (~3% fail)

Error propagation — semantic distinctions matter

Error typeWho handlesWhat to return
Transient (timeout, 503)Subagent handles locally firstIf unresolvable: structured context (failure type, query, partial results, alternatives)
Access failure (connection timeout)Coordinator decides retryDISTINCT from "0 results" — must be labelled as access failure, isRetryable: true
Valid empty result ("0 results found")Accept as informative findingNOT a failure — coordinator should NOT retry
Unresolvable (corrupted file, permission denied)Propagate to coordinatorInclude what was attempted, partial results, errorCategory: "permission"
Conflicting sources (govt 40% vs industry 12%)Doc analysis completes its taskInclude BOTH with attribution, conflict_detected: true → defer reconciliation to coordinator

Task decomposition strategies

StrategyUse whenExample
Fixed pipeline (prompt chaining)Predictable steps, known structureReview each of 14 files, then integration pass
Multi-pass review10+ files, avoid attention dilutionPass 1: per-file local issues · Pass 2: cross-file dataflow
Explore subagentVerbose Phase 1 threatening context windowIsolates discovery output, returns accurate summary to main session
Dynamic decompositionOpen-ended, scope unknown upfrontDiscover codebase → find 3 untested modules → prioritize

Domain 2 · Tool Design & MCP Integration

18%

Tool description — primary selection mechanism

The model selects tools based on descriptions alone. Minimal descriptions = unreliable selection. Overlapping descriptions = misrouting. Fix tool confusion by expanding descriptions BEFORE adding routing layers or prompt instructions.
A good description includesExample — what to write
What it returns (exact fields)'Returns customer profile: name, email, order_history, account_status'
Input formats + examples'Accepts email (user@domain.com) OR numeric customer_id'
When to use THIS vs similar tools'Use BEFORE lookup_order to verify identity. lookup_order = after verification'
Edge cases and constraints'Returns multiple matches if name not unique — caller must disambiguate'

Tool distribution — scoping principles

PrincipleRuleExample
Least privilegeEach agent gets only tools it needs for its roleSynthesis agent: scoped verify_fact not full web_search
Constrained replacementMisused tool → replace with scoped version (not remove)fetch_url misused for search → load_document validates URL points to document format
4–5 tools per agentMore tools = more ambiguity = more misroutingSeparate agents for web search vs document analysis
Scoped cross-role toolsShared tools OK if scoped to specific operation typeSynthesis gets verify_fact; complex verifications route via coordinator

tool_choice options

ValueBehaviorUse when
"auto"Model decides: tool or textDefault for most use cases
"any"Model MUST call some toolNeed guaranteed structured output
{"type":"tool","name":"x"}Model MUST call this specific toolEnforce step ordering, forced first step

Structured MCP error response

Correct — structured context

  • isError: true
  • errorCategory: "transient" | "validation" | "business" | "permission"
  • isRetryable: true / false
  • message: "Orders API timeout"
  • attempted_query: "order_id=12345"
  • partial_results: null (or actual partial data)

Anti-pattern — generic error

  • { "isError": true, "content": "Operation failed" }
  • Coordinator cannot decide: retry? change query? escalate?
  • All recovery context lost — coordinator is blind
Error categoryRetryable?Agent action
transientYes — exponential backoffRetry (timeout, 503, network errors)
validationNo — fix inputModify request parameters and retry
businessNoExplain to user, propose alternative (policy violation)
permissionNoEscalate to human (access denied)

MCP server configuration

# .mcp.json — project scope (commit this, NOT the tokens)
{ "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"],
    "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" } } } }
# ${ENV_VAR} substitution = one version-controlled config + per-developer credentials via environment variables
ScopeLocationUse forVersion controlled?
Project.mcp.json at repo rootShared team tooling, standard integrationsYes — use ${TOKEN} for secrets
User~/.claude.jsonPersonal experiments, testing new serversNo — not shared via git

Built-in tool selection reference

TaskToolWhen
Find files by name/patternGlob**/*.test.tsx, src/components/**/*.ts
Search within file contentsGrepFunction name, import statement, error message
Read a complete fileReadLoad for analysis after Grep finds it
Create a new file from scratchWriteGenerating new test files
Edit specific snippet in a fileEditUnique text match required — fails if non-unique
Edit fails (non-unique match)Read + Write fallbackRead full file, modify in memory, write back

Domain 3 · Claude Code Config & Workflows

20%

CLAUDE.md hierarchy — 3 levels

LevelLocationScopeVersion controlled?Common mistake
User~/.claude/CLAUDE.mdOne developer onlyNoPutting team standards here — new members miss them
Project.claude/CLAUDE.md or root CLAUDE.mdAll contributorsYesForgetting to commit — standards exist locally only
DirectoryCLAUDE.md in subdirectoryFiles in that directory onlyYesDuplicating test rules across every directory

Three activation mechanisms — the key exam distinction

MechanismHow it firesBest forLocation
CLAUDE.mdAlways loaded for every conversationUniversal standards: coding conventions, testing requirements that always apply.claude/CLAUDE.md (project-scoped)
.claude/rules/ globAuto-loads when editing file matching glob patternPath-specific conventions: test files, API handlers, migration scripts — cross-cutting.claude/rules/testing.md with paths: ["**/*.test.tsx"]
Skills (slash commands)Manually invoked via /skill-nameTask-specific workflows: PR review, deployments, migrations, endpoint generation.claude/commands/ or .claude/skills/ (project); ~/.claude/ (personal)

Use .claude/rules/ when

  • Rules should apply to specific file types (glob paths)
  • Test conventions must apply across all test files regardless of directory
  • Cross-cutting patterns not tied to a single task
  • Context saving matters — irrelevant rules shouldn't load

Avoid

  • Directory CLAUDE.md in every subfolder (duplication)
  • Root CLAUDE.md with all rules always loaded (bloat)
  • README.md for instructions (documentation, not loaded)
  • Relying on Claude to infer which CLAUDE.md section applies

Skills — SKILL.md frontmatter parameters

ParameterEffectWhen to use
context: forkRuns skill in isolated subagent — verbose output stays out of main session; prevents context bleedAny skill with heavy output (analysis, codebase scanning, exploration); exploration skills that could bias subsequent implementation
allowed-toolsRestricts which tools the skill can callSecurity: prevent accidental Write/Delete in read-only skills; prevent destructive operations
argument-hintPrompts developer for a required argument at invocation timeWhen skill needs a path, module name, migration name, or other specific input ($ARGUMENTS)
Scope precedence: Project skills (.claude/skills/) win over personal skills (~/.claude/skills/) with the SAME name. To use a personal variant alongside the project version, use a DIFFERENT name (e.g., /my-commit vs /commit). Same name = project version silently overrides.

Planning mode vs direct execution

ModeUse whenWhat it does
Planning modeDozens of files; multiple valid architectural approaches; ambiguous requirements with divergent implications (Slack: webhooks vs bot tokens vs Slack App)Read/Grep/Glob only — investigates and proposes plan — NO changes until approved
Direct executionSingle file fix, clear stack trace, one validation check, unambiguous changeExecutes changes immediately
Explore subagentLong verbose investigation that would fill main context before Phase 1 completesIsolates discovery output, returns only accurate summary to main session

CI/CD integration patterns

CI patternHowWhy
Non-interactive mode-p / --print flagProcesses prompt, prints to stdout, exits — won't hang waiting for input
Structured findings for inline PR comments--output-format json + --json-schemaEnforces well-formed JSON; parse + post via GitHub API
Session isolation for reviewIndependent Claude instance (no generator context)Generator's reasoning context biases self-review — miss same mistakes
No duplicate comments on re-reviewInclude prior review results in contextInstruct: report only NEW or still-unresolved issues
Better test generation (no duplicates)Include existing test files in contextClaude avoids suggesting already-covered scenarios

Domain 4 · Prompt Engineering & Structured Output

20%

Few-shot vs explicit criteria — the key decision boundary

Use few-shot examples when

  • Format/structure inconsistency (show exact output shape)
  • Output varies across cases despite clear intent
  • Tool selection for ambiguous input (show: 'My order is broken' → call lookup_order, rationale: could mean damage)
  • Escalation calibration (show boundary cases explicitly)
  • Acceptable vs problematic code patterns
  • Multi-concern request decomposition (agent handles 1 concern at a time)
  • Exact output format: issue, location, severity, suggested fix

Use explicit criteria when

  • Novel pattern generalisation needed (rules extend to unseen cases)
  • Severity classification consistency (CRITICAL/HIGH/MEDIUM/LOW with concrete definitions)
  • Binary decisions with clear conditions (flag ONLY if confidence > 0.85)
  • Eliminating vague instructions ('be conservative' → 'flag only if confidence > 0.85')
  • Variable per-case gaps (→ pair with evaluator-optimizer self-critique)

Evaluator-optimizer / self-critique pattern

Use when: Output quality is inconsistently complete with variable, case-specific gaps — not a format problem. The agent evaluates its own draft against explicit completeness criteria (policy context included? timeline provided? next steps listed?) before presenting to the user. Catches gaps that few-shot examples cannot anticipate because gaps vary by case.

JSON schema — design rules

Schema ruleWhy it mattersAnti-pattern
required: only truly always-present fieldsRequired + absent data = model fabricates a value to satisfy constraintMarking optional fields required
"type": ["string", "null"] for optional fieldsModel returns null instead of hallucinating a value"type": "string" on optional field
enum + "other" + detail fieldCaptures unexpected values without losing themNo catch-all = novel values lost
enum + "unclear" optionHonest uncertainty beats wrong categorizationForcing model to pick wrong category
tool_choice: any for guaranteed outputWithout this, model may respond in plain text insteadtool_choice: "auto" when structure required
Critical distinction: tool_use eliminates SYNTAX errors (invalid JSON, missing braces, wrong types). It does NOT prevent SEMANTIC errors (wrong values, totals that don't add up, info in wrong field). Use Pydantic validation + retry-with-feedback loops for semantic correctness.

Message Batches API — decision matrix

WorkflowAPIReason
Pre-merge check (developer waiting)SynchronousCannot tolerate 24h delay = blocking workflow
Interactive code review sessionSynchronousImmediate feedback required
Overnight tech-debt reportBatch APINon-blocking, result needed by morning — 50% savings
Weekly security auditBatch APIScheduled, latency-tolerant — 50% savings
Nightly test generationBatch APIAlready async/polling — 50% savings
Processing 10,000 documentsBatch APIHigh volume, non-urgent — large absolute savings
Iterative review (model requests files mid-review)Synchronous onlyBatch does NOT support multi-turn tool calling — async fire-and-forget = no mid-execution intercept
Batch API key facts: 50% cost savings · Up to 24h processing (NO latency SLA) · Does NOT support multi-turn tool calling within one request · custom_id field = correlate request to response · On failure: re-submit only failed docs by custom_id

Explicit criteria vs vague instructions

Correct — explicit criteria with examples

  • Flag ONLY if comment CONTRADICTS actual code behavior
  • Flag if comment references non-existent function
  • CRITICAL: runtime failure for users (NullPointerException in payment)
  • HIGH: security vulnerability (SQL injection, XSS)
  • MEDIUM: logic bug without immediate user impact
  • LOW: code quality (duplication, suboptimal algorithm)

Vague — leads to inconsistency

  • Check code comments for accuracy
  • Be conservative about reporting issues
  • Be more precise in your findings
  • (No severity definitions = inconsistent ratings across PRs)

Domain 5 · Context Management & Reliability

15%

Progressive summarization risks

What gets lost when history compressesSafe? (survives /compact)Fix
Exact dollar amounts ($89.99)No → becomes 'some money'Extract to case facts block
Percentages (15% discount)No → becomes 'a discount'Extract to case facts block
Specific dates (2025-01-15)No → becomes 'recently'Extract to case facts block
Order IDs, customer IDsNo → often lost entirelyExtract to case facts block
Actions taken (list of tool calls)PartiallyKeep in structured handoff payload
General topic / issue typeYes — usually survivesSafe to leave in history

Case facts block pattern

# Include in EVERY prompt, OUTSIDE the summarized history — update whenever new fact appears
=== CASE FACTS ===
Customer ID: CUST-12345   |   Order ID: ORD-67890   |   Order Date: 2025-01-15
Order Amount: $89.99   |   Discount: 15% promo SAVE15
Issue: Damaged item on delivery   |   Customer Request: Full refund   |   Status: Pending approval
===

Lost-in-the-middle effect

Problem: Models reliably process start and end of long inputs — middle sections frequently missed. 75K token input: first 15K and last 10K reliable, middle 50K often ignored.
Fix: Key findings summary at TOP (primacy) → detailed data in middle with explicit section headers (navigation) → action items at BOTTOM (recency).

Context architecture — multi-agent

TechniqueHowBenefit
Coordinator as context orchestratorMaintains global state, allocates context budgets to subagentsPrevents one agent consuming others' context allocation
Constrained subagent contextPass only task-specific data + required prior resultsSubagents stay focused, fewer distractions from irrelevant context
Explore subagentDelegate verbose discovery to isolated subagent, get summary backVerbose Phase 1 output doesn't pollute main session; accurate (not lossy)
Scratchpad fileAgent writes key findings to investigation-scratchpad.mdSurvives /compact and session resumption — persists across context resets
Structured state persistenceagent-state/manifest.json: {web-search: completed, ...}Crash recovery without restarting from zero

Provenance & source tracking

# Correct — structured claim-to-source mapping (5 components)
{"claim": "AI music market $3.2B", "source_url": "https://example.com/report",
 "source_name": "Global AI Music Report 2024", "publication_date": "2024-06-15", "confidence": 0.9}
# Conflicting sources — preserve BOTH, annotate, never arbitrarily pick one
{"values": [{"value":"12%","source":"Spotify 2024-03"},{"value":"8%","source":"MIA Survey 2024-07"}],
 "conflict_detected": true, "explanation": "Different methodology and time period"}

Confidence calibration & reliability

ConceptWhat it meansAnti-pattern
Field-level confidence scoresScore each extracted field individually (not just the whole doc)Single doc-level confidence score only
Stratified random samplingAudit high-confidence extractions by document type AND field segmentOnly audit low-confidence extractions
Aggregate metrics mislead97% overall accuracy can hide 40% error rate on specific doc typesReporting only overall accuracy
Coverage annotationsMark synthesis sections as FULL / PARTIAL / NOT COVERED + reasonSilent omission of missing data sources

Session management

Command / conceptWhen to useRisk / note
--resume session-nameContinue long investigation across sessionsStale tool results if files changed since last session
fork_sessionCompare two approaches from same starting pointForks diverge independently after branch point
Start new sessionResults are stale, lots of time has passedProvide summary: 'Here's what we found so far: …'
/compactContext filling — LAST RESORT for single-phase tasks onlyNumeric values, dates, IDs can be lost in summary

Common anti-patterns in production agent systems

Engineering pitfalls worth recognising and avoiding

Anti-patternWhy it failsCorrect approach
Prompt for critical compliance ('NEVER do X without approval')~3% failure rate — model can be overridden by context. Financial/safety must be 100%PreToolUse hook that programmatically blocks or redirects
Parsing text to end agentic loop ('Task completed', 'anything else?')Model can produce these phrases mid-task. Text parsing is fragile and unreliablestop_reason == 'end_turn' is the ONLY valid signal
Sentiment analysis for escalation (escalate when customer is angry)Sentiment ≠ case complexity. Angry customer with simple return ≠ complex policy caseExplicit criteria: escalate on policy gap / explicit request / no progress
Self-rated confidence (1–10) for routing ('confidence: 8 → auto-process')Model can be confidently wrong. Calibration is poor without labeled validation dataCalibrate on labeled validation sets with stratified sampling
Generic MCP error response ('Operation failed')Coordinator cannot decide recovery: retry? escalate? continues?Structured: errorCategory, isRetryable, attempted_query, partial_results
Single-pass review of 10+ filesAttention dilution: shallow coverage, inconsistent depth, contradictory findings across filesPer-file pass (local issues) + integration pass (cross-file)
User-level ~/.claude/CLAUDE.md for team standardsNew team members never receive the instructions. Only exists for one developer's machine.claude/CLAUDE.md (project level, version controlled)
Required fields on optional information in JSON schemaIf info absent from source, model fabricates a value to satisfy the required constraint"type": ["string", "null"] + exclude from required array
Batch API for blocking workflows (pre-merge checks)Up to 24h with no latency SLA — developer blocked waiting to mergeSynchronous API for blocking; batch only for overnight/weekly scheduled tasks
Same session to generate AND review codeModel retains its reasoning context and is less likely to challenge its own decisionsIndependent Claude instance for review without generator context
Subagent calls another subagent directly (bypassing coordinator)No central observability, no uniform error handling, no control over what coordinator receivesAll communication flows through coordinator only
Overly narrow task decomposition (creative industries → only visual art)Subagents execute correctly within wrong scope. Bug is in coordinator's decomposition logicCoordinator must cover full topic scope before delegating distinct subtopics
Silent error suppression (return empty results = success)Coordinator thinks no matches found when search actually failedDistinguish access failures from valid empty results explicitly with error semantics
Abort entire workflow on one subagent failureLoses all partial results from successful subagents that ran before the failureContinue with partial results, annotate coverage gaps in synthesis output
/compact for multi-phase tasks (context window filling)Lossy — exact numbers, dates, IDs lost in summary; subsequent phases have degraded contextExplore subagent for verbose Phase 1 — returns accurate summary to main session
Instructions in README.md or directory CLAUDE.md for path-specific rulesREADME.md is documentation — not loaded as instructions. Directory CLAUDE.md requires duplication.claude/rules/ with glob frontmatter — auto-loads for matching file paths

Quick reference glossary

Terms, formats, and key definitions

Term / keywordDefinition / when used
stop_reasonAPI response field. end_turn = done (ONLY valid exit). tool_use = execute tool and loop. max_tokens = response truncated
tool_choice: autoModel decides whether to call a tool or respond in text. Default for most use cases
tool_choice: anyModel MUST call some tool. Use when guaranteed structured output is required
tool_choice: {tool}Model MUST call this specific tool. Use to enforce step ordering or first-step guarantees
isError: trueMCP error response flag. Always pair with structured context (errorCategory, isRetryable, message, attempted_query)
Task toolHow coordinator spawns subagents. Must be in coordinator's allowedTools list for parallel spawning
allowedToolsAgentDefinition parameter listing permitted tools. Principle of least privilege — fewer = more reliable, less misuse
context: forkSKILL.md frontmatter. Runs skill in isolated subagent. Verbose output doesn't pollute main session. Prevents context bleed
allowed-toolsSKILL.md frontmatter. Restricts which tools the skill can invoke. Use for security and least-privilege enforcement
argument-hintSKILL.md frontmatter. Prompts user to provide an argument when skill invoked without one. Uses $ARGUMENTS
.claude/rules/Directory for topic-scoped rule files. YAML frontmatter with paths: glob patterns for conditional (path-triggered) loading
paths: globYAML frontmatter in .claude/rules/ files. Rule loads ONLY when editing a file matching the pattern
@import syntaxCLAUDE.md can reference external files: @./standards/testing.md. Relative to file location. Max nesting depth: 5
-p / --printClaude Code CLI flag for non-interactive mode. Processes prompt, prints to stdout, exits. Required for CI/CD
--output-format jsonClaude Code CLI flag. Returns structured JSON. Pair with --json-schema for validated, schema-enforced output
fork_sessionCreates independent investigation branch from shared context. Forks diverge independently afterward
--resume nameContinues a named session. Risk: tool results may be stale if files changed since last session
/compactBuilt-in command to summarize conversation history. Warning: exact numbers and dates may be lost. Last resort only
custom_idBatch API field to correlate request to response. Use to re-submit only failed docs on failure
hub-and-spokeMulti-agent topology. Coordinator at center, subagents at spokes. All communication via coordinator only
lost-in-the-middleModel attention effect. Start and end of long inputs processed reliably, middle sections frequently missed
case facts blockStructured persistent facts block included in every prompt OUTSIDE the summarized history. Update as new facts appear
scratchpad fileinvestigation-scratchpad.md: agent writes key findings, reads when context degrades or session resumes
stratified samplingAudit high-confidence extractions by document type AND field segment — not just overall accuracy
coverage annotationsIn synthesis output: mark sections as FULL COVERAGE / PARTIAL COVERAGE / NOT COVERED with reason
provenanceClaim-to-source mapping: claim, source_url, source_name, publication_date, confidence per claim
planning modeClaude Code mode: Read/Grep/Glob only — investigates and proposes plan — no changes until approved
evaluator-optimizerPattern: agent critiques its own draft against explicit criteria before presenting. Catches variable per-case gaps
PreToolUse hookIntercepts BEFORE tool call. 100% deterministic. Required for financial thresholds, compliance, safety rules
PostToolUse hookIntercepts AFTER tool result. 100% deterministic. Use for data normalization, format unification, field trimming
constrained replacementWhen a tool is misused, replace with a scoped version (not remove). Makes misuse architecturally impossible