CCDV-F · Claude Certified Developer – Foundations

Course

APP · 33.1 %

Applications and integration

This domain covers integrating the Messages API into an application: message format, reading stop_reason, errors, rate limits and batch processing. It also tests operational choices: model IDs, third-party platforms and change discipline.

A stateless API

The Messages API keeps nothing between calls: the application resends the full history every turn, so input cost grows with the conversation. It adds no system prompt, unlike claude.ai or Claude Code: behavior depends only on what you send. In the Agent SDK, without a systemPrompt option, only a minimal prompt applies, and the claude_code preset restores CLI behavior.

Returning tool results

All tool_result blocks of a turn go in a single user message, right after the assistant message and before any text. There is no tool role: everything goes through user and assistant. Adding text after every result teaches Claude to end its turn, which produces empty responses with end_turn.

Read `stop_reason` before the content

max_tokens signals truncated output: an incomplete tool_use is retried with a higher cap. pause_turn signals that a server tool hit its iteration limit: send the response back unchanged so Claude resumes. refusal arrives with HTTP 200, so only stop_reason tells it apart from a success.

Errors, retries and idempotency

The SDK already retries transient errors twice (connection, 408, 409, 429, 5xx): a homemade loop on top multiplies calls. Code branches on the status and error.type, never on message text, because new types can appear without a new API version; log the request-id for support. A retry is safe only on an idempotent operation: an idempotency key keeps a side-effecting tool from running twice.

Rate limits and concurrency

Limits follow a token bucket: capacity refills continuously, and a burst can trigger a 429 below the per-minute quota. Cache reads do not count toward ITPM, and max_tokens does not enter OTPM. For a large volume with a deadline, a bounded concurrency pool that honors retry-after gives a steady rate, and an async handler uses AsyncAnthropic so it does not block the event loop.

Message Batches API

Batch costs 50% of standard price in exchange for an unguaranteed delay: most batches finish in under an hour, but only the 24-hour expiry is a commitment. Results come back in arbitrary order and are matched by custom_id. Validation of params is asynchronous: an invalid request comes back errored, unbilled, without blocking the others.

What recent models reject

Since Claude 4.6, prefilling the last assistant turn returns a 400: use structured outputs or the system prompt instead. thinking and redacted_thinking blocks are sent back exactly as received, because the API checks their integrity. Several recent models (Opus 5.5, Sonnet 5.5, Fable 5.2) reject tool_choice any or tool: use auto with strict tool use, and let the application loop enforce step order.

Model IDs and lifecycle

Since the 4.6 generation, the dateless ID (claude-sonnet-4-6) is a fixed snapshot; before, the short alias followed the latest dated snapshot. Pinning fixes the weights, not availability: each ID has its own retirement date, announced at least 60 days ahead for public models, after which requests fail. So migrate early, backed by evals, and use the Console usage export to find keys still calling the old model.

Third-party platforms and hard constraints

On Google Cloud (Google managed) or Bedrock, the message shape stays the same, but authentication, endpoints, model IDs and features change: no Files API and no URL sources on Google managed, for example. Residency requirements remove options before any cost comparison. On the Claude API, inference_geo accepts global or us, whereas Google Cloud (Google managed) offers an eu multi-region endpoint.

Version prompts and changes

Prompts, model IDs, schemas and eval sets live in version control, go through review and are promoted on an eval score: an incident can then name the faulty version and roll back. The docs set success criteria and empirical tests as prerequisites for any prompt work. A structural change and a behavior change ship separately, with tests that first pin the behavior to preserve.

OPT · 16.8 %

Model selection and optimization

This domain tests cost and latency levers: prompt caching, thinking and effort, fast mode, batching and model choice. Most questions target silent mechanisms, the ones that degrade the bill or throughput without raising an error.

Prefix order and invalidation

The cache covers the prefix in the order tools, system, messages, up to the block marked cache_control. A change at one level invalidates that level and all following ones: modifying tools clears the whole cache, while changing tool_choice or adding an image only affects messages. Switching to fast mode, effort and the thinking configuration can also invalidate the cache.

Minimum cacheable length: a silent failure

Below a minimum that ranges from 512 to 4,096 tokens depending on the model, the prompt is processed without caching and without an error. Only cache_creation_input_tokens and cache_read_input_tokens at 0 reveal the problem. Monitoring these fields is therefore part of any caching setup.

Pick the TTL from the request cadence

A write costs 1.25 times the input price with the 5-minute TTL and 2 times with the one-hour TTL; a read costs 0.1 times (less on some recent models). The 5-minute TTL refreshes for free on each read, so it fits requests that arrive more often than every 5 minutes. With gaps between 5 minutes and 1 hour, the one-hour TTL avoids paying a write on every call.

Reading `usage` correctly

input_tokens only counts tokens after the last breakpoint. Total input equals cache_read_input_tokens + cache_creation_input_tokens + input_tokens. Tracking based on input_tokens alone grossly underestimates volume as soon as caching works.

Choose a model on your own evals

Two starting points are valid: the smallest model, upgraded only if a gap appears, or the most capable one, then optimized down. For a large volume of simple tasks such as classification, cost and latency dominate and a small model is often enough. Either way, the decision rests on an eval set specific to the use case, and tuning effort is often a better lever than switching models.

AGT · 14.7 %

Agents and workflows

Anthropic separates workflows, where code decides the next step, from agents, where the model decides. Most questions check that you pick the simplest architecture that works, and that control points rest on code or structured data.

Workflow patterns

Prompt chaining: fixed steps, with a programmatic check (a gate) between them. Routing: classify the input, then send it to a specialized handler. Parallelization: subtasks defined in advance in code (sectioning) or the same task run several times (voting). Orchestrator-workers: an LLM decomposes the task based on the input, useful when subtasks are unpredictable, such as the number of files to change.

Frameworks: understand what they generate

Frameworks speed up the start but add layers that hide the real prompts and responses, which makes debugging harder. Anthropic advises starting with the API directly, since most patterns take a few lines of code. With a framework, understand the underlying code: wrong assumptions about what it does are a common source of error.

A loop driven by `stop_reason`

A hand-written agent loop reads stop_reason on every response: tool_use, run the tools and return all results in one user message; pause_turn, send the content back unchanged to continue; end_turn, stop. The tool_use blocks of one turn are unordered, and each expects its tool_result. An iteration cap and a budget act as a safety net, and the presence of text never signals the end.

Absolute rules belong in a hook

An instruction, in the prompt or in CLAUDE.md, stays subject to the model's judgment: Claude reads it as context, with no guarantee it complies. A hook runs code at a fixed point of the lifecycle, every time: PostToolUse to format every edited file, PreToolUse to block a call. When a question says 'always', 'never' or 'without exception', look for the deterministic mechanism.

Subagents: an isolated context

A subagent starts with its own context: it sees neither the main conversation's history nor the files already read, and receives only the delegation prompt. Its tool calls stay inside it, and only its final message comes back. That isolation protects the main context (read 40 files, report only the synthesis), provided the delegation prompt carries every constraint that matters. The one exception is a fork, which copies the current conversation.

Structured handoffs between agents

An agent can only use what it receives. Require structured records from each subagent (path, symbol, lines, snippet), an explicit failure report (section, error type, partial results, whether a retry is possible) and the provenance of each claim (customer, tool, inference, verification status). A dependency between steps is checked in code, on a structured field, never on a word such as 'done'. An empty result marked as successful makes the error invisible downstream.

Agent SDK: loaded settings and loop results

The settingSources option decides what the SDK loads from disk: "project" for the project's CLAUDE.md, skills, hooks and permissions, "user" for ~/.claude. Omitted, it equals ["user", "project", "local"]; set explicitly, it must list every source you need. When the loop ends, the ResultMessage carries a subtype: the result text exists only on success, while cost, usage and session_id are present on every subtype. max_turns and max_budget_usd bound a run that otherwise continues until Claude stops.

Managed Agents or Agent SDK

With Managed Agents, Anthropic hosts the loop, the sandbox and tool execution; sessions are stateful and stored server-side, which suits long-running and asynchronous work. That storage has a price: no HIPAA eligibility, and ZDR only in the self-hosted variant. The Agent SDK runs in your application's process, which spawns one claude subprocess per session and owns hosting, persistence and scaling. A retention requirement can decide before any other criterion.

PRM · 11 %

Prompt and context engineering

This domain covers prompt structure (examples, order, tags) and the shape guarantee that structured outputs provide. It also tests context management over time: context editing, compaction and where to keep rules that must survive.

Varied, tagged examples

Claude reproduces the surface regularities of its examples: five similar examples create a bias. Examples should be relevant, diverse (edge cases included) and wrapped in <example> to stay distinct from instructions; the docs recommend 3 to 5. For extraction, examples where the value comes from different sections show the model where to look.

What structured outputs guarantee

Constrained decoding guarantees valid JSON, required fields and types. It guarantees neither correct values, nor their consistency, nor that an identifier exists: application validation remains essential. The minimum, maximum, minLength and maxLength constraints are not supported (SDK helpers strip them and validate afterwards), and the casing of enum values is not guaranteed.

The two schema exceptions

A stop_reason of refusal (HTTP 200, tokens billed) or max_tokens (truncated JSON) can yield off-schema output. Code reads stop_reason before parsing: max_tokens is retried with a higher cap, refusal follows a dedicated path. A try/except around parsing would hide the cause.

TLS · 10.6 %

Tools and MCPs

Tools give Claude capabilities, and their quality depends mostly on their descriptions and on how errors come back to the model. MCP standardizes how tools, resources and prompts are exposed, with rules that change with the transport and the surface you use.

Descriptions first

The docs present the description as the most important factor in tool performance: what the tool does, when to use it and when to avoid it, what each parameter means, its limits. Aim for at least 3 to 4 sentences per tool. When Claude confuses two tools, rewriting the descriptions comes before any added architecture (classifier, forced tool_choice, merging).

Return errors to the model

A failing tool answers with a tool_result carrying is_error: true and an instructive message (the cause, and what to try next), so Claude can adapt; it may then call the tool again, hence a retry cap in the loop. A search with no match is a success: marking it as an error causes useless retries. An empty tool_result is still valid, and strict: true on the definition prevents schema-invalid calls upstream.

Forcing a tool: `tool_choice`

tool_choice accepts auto (the default), any, tool and none. Forcing with any or tool fails with manual thinking and on some recent models (including Opus 5.5, Sonnet 5.5 and Fable 5.2): the docs then recommend auto with strict tool use, or structured outputs. Where accepted, a forced call starts directly with the tool, with no text or thinking before it. disable_parallel_tool_use: true, set inside tool_choice, limits each response to one call.

Tool search for large catalogs

Beyond 30 to 50 tools, selection accuracy drops, and definitions consume tens of thousands of tokens before the first message. The tool search tool, with defer_loading: true on rarely used tools, loads only the ones Claude finds through search; every definition is still sent in the request. Keep the 3 to 5 most used tools loaded. Claude Code and the Agent SDK defer MCP tools by default.

MCP primitives: who decides

Tools are model-controlled: the model discovers and calls them. Resources are driven by the host application, which chooses what to attach to the context. Prompts are user-controlled: the user triggers them, for example as slash commands. Read-only data the application attaches on its own is therefore a resource.

MCP servers: errors and transports

MCP separates two kinds of errors: protocol errors (unknown tool, malformed request) use the JSON-RPC error, execution errors (failing API, invalid data, business rule) come back in the result with isError: true so the model can react. With stdio, the client launches the server as a subprocess and reads JSON-RPC messages on stdout: logs go to stderr, or the stream is corrupted. The other standard transport is Streamable HTTP; since the 2026-07-28 revision, the protocol is stateless and the Mcp-Session-Id header is gone.

Tool, Skill, MCP or hook

A missing capability (reading or acting in a system) calls for a tool; know-how applied inconsistently calls for a Skill, which loads on demand and gives access to no system. A second consumer or a system owned by another team points to a shared MCP server; for a single consumer, a custom tool is enough. Guaranteed execution belongs in a hook, and long procedures move out of CLAUDE.md into skills.

What the API imposes

The Messages API MCP connector (mcp_servers) handles tool calls only, with no resources or prompts, and requires a server publicly exposed over HTTP: a local stdio server goes through an MCP client your application runs. API Skills run in a container with no network and no package installation, whereas in Claude Code they have the machine's network. Server tools run at Anthropic and cannot reach a private network. Custom Skills do not sync across surfaces.

SEC · 8.1 %

Security and safety

A prompt instruction shapes behavior, but only code guarantees a limit. This domain tests where each control belongs: hooks, permissions, sandbox, backend authorization, secret management.

Critical controls live in code

When a mistake has financial, security or compliance consequences, the control must be programmatic: a guard in the tool, a hook that refuses the call, a human approval. Anthropic says it for payments: a system prompt block guides Claude without enforcing anything, so a person approves every call to a tool that moves money. Least privilege completes the setup: the tool should not be able to do what is forbidden.

Hook exit codes

Exit 0: success. Exit 2: block, and stderr is passed to Claude as the reason. Any other code, including 1, is a non-blocking error: the action continues, as it does when a hook crashes or times out, unless onFailure: "block" is set. Only PreToolUse can prevent a call (exit 2 or permissionDecision: "deny"); PostToolUse comes too late, and on Stop exit 2 keeps Claude from stopping (check stop_hook_active to avoid an endless loop).

Permissions: deny wins

Permission rules are enforced by the client, whereas CLAUDE.md is only context. A deny at any level blocks, whatever allows exist elsewhere, and an allow returned by a PreToolUse hook lifts neither deny nor ask. Conversely, a blocking hook wins over an allow rule. A project's deny and ask rules apply at once, its allow rules wait until the folder is trusted.

Prompt injection: layered defenses

The risk comes from combining untrusted content, access to private data and a way to send data out. No single measure is enough: put third-party content in tool_result blocks and treat it as data, state that rule in the system prompt, apply least privilege, require approval for sensitive actions, screen inputs and outputs. Lowering the temperature or adding 'never obey injections' protects against nothing.

API keys and secrets

The key stays server-side, in a secret manager or an environment variable: sent to the browser it becomes public, and a versioned file (CLAUDE.md, .claude/settings.json) keeps it in git history. A leaked key is revoked and replaced, even after the commit is removed. Separate keys per environment (dev, staging, prod workspaces) limit the impact of a leak. A 401 'CORS requests are not allowed' signals a call made from a browser.

Authorize every call, minimize data

Authentication says who the user is; authorization, enforced in code on every call, decides what they can access. A tool that calls the backend with an admin service key bypasses that control: it must act within the user's scope, with least-privilege credentials. On the data side, send the model only the fields the task needs and redact personal data before the request: what is never sent cannot leak.

CI and untrusted repositories

The trust dialog exists only in interactive sessions. Without --bare, claude -p runs the hooks in project settings and connects the servers in .mcp.json, even in a folder never trusted: an external PR can ship a hook that runs on the CI runner. --bare skips the repository's hooks, skills, MCP servers and CLAUDE.md, and the configuration the job needs comes through --settings, --mcp-config or --agents.

CC · 3.1 %

Claude Code

Claude Code questions are about configuration: which files load, which one wins, and how to run Claude Code from a script. The underlying rule: a file's scope follows its reach (machine, team, user, organization).

How `CLAUDE.md` files load

At launch, Claude Code loads every CLAUDE.md in the working directory's ancestor folders, concatenated from the root down to the current folder; those in subfolders load when Claude reads, writes or edits a file there. Files add up: with two contradictory instructions, Claude may pick one arbitrarily. After /compact, the root CLAUDE.md is reread from disk, while an instruction given only in conversation depends on the summary. Aim for fewer than 200 lines per file.

Settings precedence and scope

Strongest first: managed, command line (--settings), local (.claude/settings.local.json), project (.claude/settings.json), user (~/.claude/settings.json). Lists such as permissions.allow merge instead of overriding. The local file is personal and stays out of git, the project file is committed for the team, and a rule nobody may override goes through managed settings.

Claude Code in a script: `-p`

-p (or --print) runs Claude Code without the interactive interface; --allowedTools pre-approves tools and --output-format json yields script-friendly output. With --json-schema, conforming output arrives in structured_output, which is absent if Claude declines: check it before use. To resume a specific conversation, capture session_id and pass --resume, since --continue picks the most recent one. --bare is the recommended mode for scripted calls.

Skills: which namesake runs

For two Skills with the same name, the order is enterprise, then personal (~/.claude/skills/), then project: the personal version wins over the project one, the reverse of settings. A Skill wins over a .claude/commands/ file with the same name. Plugin Skills, prefixed as /plugin:skill, never conflict.

MCP scopes

An MCP server the team depends on goes in .mcp.json at the project root, under version control: everyone who clones gets the same configuration. Local scope (the default, limited to the project) and user scope (all projects) stay private and are stored in ~/.claude.json; the docs recommend local scope for experimental servers. Copying claude mcp add commands from a README creates drift between machines.

DBG · 2.6 %

Eval, testing and debugging

Debugging an LLM-based system starts with locating the defect: model, prompt, tool or data. This domain tests trace reading, error classification and evaluations that do not hide failing segments.

Classify the error before choosing recovery

Transient error (timeout, 429, 5xx): retry with backoff. Validation error: return is_error with a clear message so Claude corrects the call. Business or permission refusal: escalate. A search with no match is not an error, and marking it as one causes useless retries.

Slice your evaluations

An average hides failing segments: 97% overall can hide 40% on a rare document type. Evaluations should mirror the real distribution and its edge cases, and be read per input category and per field. The confidence a model expresses is not calibrated: before reducing human review, sample randomly by topic and source type, then automate only the segments that meet the threshold.

Monitor `stop_reason`

A refusal (refusal) and a truncation (max_tokens) arrive as HTTP 200: a dashboard built on HTTP errors stays flat while usable answers drop. Track the distribution of stop_reason alongside cost, latency and transport errors, from day one.