Study Guide1,146 words

Agents and Workflows — study note

Agents and Workflows — study note

This is Domain 1 of the Claude Certified Developer – Foundations exam: approximately 14.7% of scored items, according to the guide. The domain has three skills: agent architecture, agent construction with Claude, and agent patterns and frameworks. This note summarizes what each topic teaches and the Anthropic pages behind it.

Architecture: who decides the next step

Anthropic calls both kinds of system “agentic”, and separates them by who holds control.

DesignWho decides the next stepFits
WorkflowYour code, along predefined pathsWell-defined tasks where predictability matters
Orchestrator-workersA central model, per inputTasks whose subtasks cannot be predicted
AgentThe model, from what it observesOpen-ended problems with no fixed path
  • Start simple. Find the simplest solution, and add complexity only when it demonstrably improves outcomes. Often, a single model call with retrieval and in-context examples is enough.
  • Autonomy has a cost. Agents mean higher costs and the potential for compounding errors. Add stopping conditions, such as a maximum number of iterations, and test extensively in sandboxed environments.
  • Keep the agent grounded. It should judge progress from ground truth in the environment at each step, such as tool results or code execution. It can pause for human feedback at checkpoints or when it hits a blocker.
  • Subagents keep context clean. A subagent does a side task in its own context window, with its own tools and permissions, and returns only a summary.
    • Claude delegates from the subagent’s description, so write a clear one. A phrase such as “use proactively” encourages delegation.
    • If the tools field is omitted, a subagent inherits every available tool.
    • An optional memory field gives a subagent a persistent directory that survives across conversations.
    • Subagents work within a single session. For many independent parallel sessions, the subagents page points to background agents.

Construction: surfaces, the loop, hosting, hooks

SurfaceWho runs the agent loop
Agent SDKYour process, with Claude Code’s tools, permissions and sessions
Client SDKYour code; you write the loop, or use the beta tool runner
Managed Agents (beta)Anthropic’s hosted harness, in a managed or self-hosted sandbox

The Agent SDK in practice.

  • It loads skills, commands and memory from .claude/, the same as Claude Code.
  • It authenticates with API keys. Third parties may not offer claude.ai login without Anthropic’s approval.
  • From another language, run the CLI as a subprocess with -p and JSON output.

The loop. Call the API. While stop_reason is "tool_use", run every requested tool and send all the results back in one user message, each tool_result carrying the matching tool_use_id. Return a failing tool’s error with is_error: true instead of crashing. Claude can then retry with corrected input, ask for clarification, or explain the limitation.

Limits.

  • In the Agent SDK, each full cycle is one turn.
  • Cap turns, and set a budget: the agent-loop page calls a budget a good default for production agents. A capped run ends with an error_max_turns or error_max_budget_usd result subtype.
  • Read-only tools can run concurrently. Custom tools default to sequential until you set readOnlyHint.

Hosting an SDK agent. It is a long-lived process tied to local state, and one session maps to one subprocess. On-disk state does not survive a restart, scale-down or move to another node. Persist transcripts with a SessionStore adapter; give memory files and working-directory artifacts their own storage.

Session patternBest for
EphemeralOne-off tasks: a container per task, destroyed when it completes
HybridMany interactions with idle time between them
Long-runningAutonomous action, serving content, high-volume streams
Multi-agent containerAgents that must collaborate closely in a shared environment

Managed Agents (beta) is stateful by design: history, sandbox state and outputs are kept server-side. You keep control of that data: you can delete sessions, and separately delete any files you uploaded, at any time through the API. Because it is stateful, the overview currently notes it is not eligible for Zero Data Retention or HIPAA BAA coverage; check current eligibility before using it for regulated data.

Hooks.

  • Hooks are callbacks that run your code on agent events.
  • A matcher limits which tools a hook runs for. A hook without a matcher runs for every event of its type.
  • A PreToolUse callback can return allow, deny, ask or defer; ask shows the call to the user for approval. It can also modify the input or add context.
  • Async hook outputs let the agent continue without waiting, but they can’t block, modify or inject context, so use them only for side effects such as logging.
  • When hooks disagree, the most restrictive result applies, so a single deny blocks the call.

Patterns and frameworks

  • The tool-use contract. Claude emits a structured request. Your code, or Anthropic’s servers for server tools, runs it, and the result flows back. Claude sees only the schema and the result. If you are parsing a decision out of prose with a regex, make it a tool call.
  • Memory. The memory tool is client-side. Claude reads and writes files under /memories, and your application maps that prefix onto storage it controls. Restrict every operation to /memories.
PatternUse when
Prompt chainingThe task splits into fixed steps; add gates between them
RoutingCategories are distinct and classification is accurate
ParallelizationIndependent sections, or several attempts voting for confidence
Evaluator-optimizerClear criteria, and refinement adds measurable value

Routing can also cut cost, by sending easy questions to smaller models. Parallel sectioning suits guardrails: one call screens a query while another answers it.

Frameworks. Anthropic’s article notes that much of the tooling landscape described in the post has changed since December 2024; its advice is about how to work, not which tool to pick.

  • Frameworks make it easy to start by simplifying model calls, tool parsing and chaining.
  • They can also hide the underlying prompts and responses, and make it tempting to add complexity.
  • Start with the API directly, and if you adopt a framework, understand the code underneath.

Sources

Ready to study Claude Certified Developer - Foundations (CCDV-F)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free