A sound Claude application architecture gives each layer one explicit responsibility. The application owns business rules, trusted and untrusted input separation, conversation state, schemas, validation, authorization, and side effects. The Claude API is the model-service boundary, Claude SDKs provide language-specific access to that API, Claude Code supports repository-oriented development work, and plugins package reviewed Claude Code extensions. None of these surfaces removes the application's duty to control data and execution.
The practical design method is therefore to begin with content and responsibility contracts, then select an interface. Define what may enter a model request, what response shape the application expects, what state persists outside the request, which configuration is versioned, and which actions require application enforcement. Only after those decisions should the team choose direct HTTP, an SDK, Claude Code, or a plugin-based extension.
Architecture Overview: Separate Product Surfaces from Application Responsibilities
The documented developer surfaces solve different problems. The Claude API overview defines the service boundary for programmatic use, while the client SDK documentation describes supported libraries that wrap that API. Claude Code is a coding product with its own documented operation and configuration surfaces, and plugins are a distribution mechanism for Claude Code extensions.
An architecture should not treat those surfaces as interchangeable just because each can involve Claude. A useful ownership model is:
| Layer | Primary responsibility | Must not be assumed to own |
|---|---|---|
| Application | Business rules, input classification, state, schemas, validation, authorization, side effects, and observability | Model-service behavior or IDE workflow configuration |
| Claude API | Programmatic request and response boundary for model interaction | Application persistence, business authorization, or downstream execution |
| Claude SDK | Language-specific API access and serialization conveniences | A different security or semantic contract from the underlying API |
| Claude Code | Repository-oriented development and coding workflow | Production application state or API integration architecture |
| Plugin | Reviewed packaging of Claude Code extensions and configuration | Automatic trust, compatibility, or authorization merely because it is packaged |
This table is an architectural recommendation derived from the documented surfaces. It is not a claim that Anthropic operates the application's data model or policy layer.
Core Content and Responsibility Boundaries
Make the application the policy owner
The application should decide what data is allowed into a request and what may happen after a response. Classify inputs by source and trust level, remove data the model does not need, and preserve authorization checks outside the model. If a response can lead to a database update, message, purchase, deployment, or other consequential action, application code must validate and authorize that action before execution.
This separation makes failures easier to localize. A malformed application payload is an integration defect. An acceptable payload followed by an unsuitable model response is a response-quality problem. A valid response followed by an unauthorized side effect is an application-control failure. Blurring these layers makes all three look like “Claude failed,” which prevents useful diagnosis.
Treat the Messages API as a typed service boundary
The Messages API reference defines a request-response contract with messages and structured content. Architecture work should translate that external contract into an internal adapter rather than expose vendor-specific payloads throughout the codebase.
A focused adapter can own:
- conversion from application input objects to the approved request shape;
- selection of model-facing instructions and content;
- normalization of returned content blocks into application-owned result types;
- propagation of request identifiers, usage data, and errors needed for operations; and
- enforcement of timeouts, retry policy, and observability at the integration boundary.
The adapter should not decide business eligibility or silently execute actions. It should make the service interaction explicit and return enough information for the application layer to make those decisions.
Use an SDK as an adapter, not as a second architecture
A supported Claude SDK can reduce transport and serialization work, but it still represents access to the Claude API. Keep the same application-owned request, result, and error contracts whether the implementation uses direct HTTP or an SDK. This prevents language-library types from becoming the business model and reduces the impact of future SDK surface changes.
For example, a domain service might accept an application-owned DraftRequest and return a DraftResult. The integration adapter can translate those objects to and from SDK types. Tests for business rules then remain independent from a particular client-library method name, while integration tests verify the current SDK-to-API mapping.
Keep Claude Code configuration in the development boundary
Claude Code belongs in the engineering workflow boundary. Its features documentation describes the product surface, while the documentation for CLAUDE.md and settings establishes current configuration mechanisms and scopes.
Teams should distinguish at least three forms of instruction:
- production instructions that the application deliberately sends through the Claude API;
- repository guidance used by Claude Code during development; and
- human process documentation used for review, release, and operations.
They may express related policies, but they are not automatically synchronized. A rule in CLAUDE.md does not become a production API control, and an application system prompt does not configure Claude Code. Store each rule at the boundary where it is actually enforced, assign an owner, and test it there.
Treat plugins as governed extension packages
The Claude Code plugin documentation describes plugins as packages that can distribute extension components and related configuration. From an architecture perspective, a plugin is a deployment and reuse boundary for Claude Code capabilities, not a universal application module.
Before adopting or publishing a plugin, document:
- the components and configuration it introduces;
- the repository or user scopes in which it is intended to operate;
- the tools, hooks, or external services it can reach;
- its update and compatibility policy; and
- the review and rollback process for a new version.
These are recommended governance controls. Packaging makes an extension portable; it does not make the extension trusted or suitable for every project.
How the Boundaries Work Together
Consider an internal service that summarizes support cases and proposes follow-up actions. A clean architecture can use the following flow:
- The application authenticates the caller and loads only the case data that caller may access.
- An application-owned input contract separates trusted instructions from customer-supplied text and records the data classification.
- A Claude integration adapter maps the approved content into a Messages API request through either direct HTTP or a supported SDK.
- The adapter normalizes the response into an application-owned result object rather than passing raw response structures across the system.
- Application validation checks required fields and policy constraints. A proposed follow-up remains a proposal until separate authorization permits an external action.
- Conversation or workflow state is persisted by the application according to its own retention and access rules; it is not inferred from a client object remaining in memory.
- Claude Code may help developers implement and test the repository. Its project guidance, settings, and any plugins remain governed development assets, separate from production request data and runtime state.
This flow keeps the model call replaceable and observable. It also gives reviewers a concrete place to inspect every trust transition: user to application, application to API, response to validator, and approved result to side effect.
Design Content and Session Contracts Explicitly
Define input contracts by trust and purpose
An input contract should identify the content's origin, purpose, sensitivity, and permitted destination. Avoid building one unstructured prompt string from policy, user text, retrieved content, and operational metadata. Preserve those distinctions in application objects even when the final request must serialize them into an API-supported form.
A useful design review asks:
- Which content is trusted application policy, and who can change it?
- Which content came from a user or external system?
- Which fields are necessary for the model task?
- Which data must be redacted, summarized, or excluded?
- Which values affect authorization but must never be delegated to model judgment?
Define output contracts independently from fluent prose
The application should specify the result it needs: for example, a summary, a classification with evidence, or a proposed action. It should also define how missing, ambiguous, refused, or invalid output is represented. A successful HTTP response is not the same as a business-valid result.
Detailed schema-constrained generation and defensive parsing are separate implementation concerns. At the architecture level, the important decision is ownership: the application defines and validates the output contract, while the model supplies content within the requested interaction.
Make session hygiene application-owned
Session hygiene means controlling what context is carried forward and why. For an API integration, the application owns the message history or other state it supplies in later requests. Use explicit identifiers, retention rules, access checks, and reset conditions. Do not rely on an SDK instance, a local variable, or an implicit “session” idea as the durable source of truth.
Separate durable business records from transient model context. Store only what the application needs, and reconstruct each request from authorized state. This reduces accidental context leakage between users, tenants, tasks, or environments and makes retention behavior auditable.
Design Considerations
Prefer narrow adapters and explicit contracts
A narrow integration adapter limits the number of modules that understand Claude API or SDK types. Explicit application contracts make version changes, testing, and migration more manageable. Record the documentation verification date because the Claude Platform, SDKs, Claude Code, and plugin surfaces are living products.
Keep configuration near its enforcement point
Version production prompts and integration settings with the application components that consume them. Govern Claude Code memory, settings, and plugins as development-environment configuration. Avoid a single “Claude config” file that combines unrelated runtime credentials, model instructions, editor behavior, plugin dependencies, and release policy.
Review every boundary as a trust boundary
For each interface, identify who can provide data, who can change configuration, which component validates the result, and which component can cause a side effect. This is especially important when a plugin or development tool can invoke commands or connect to external systems. Detailed permission and guardrail design belongs in the security portion of the series, but the responsibility boundary must be visible here.
Common Mistakes
- Letting SDK types become domain types. This couples business code to a client library and makes version changes harder to isolate.
- Treating a model response as already validated. Transport success does not establish schema validity, factual correctness, authorization, or fitness for a side effect.
- Assuming configuration crosses surfaces automatically. Claude Code project guidance does not automatically govern production API requests, and production prompts do not configure Claude Code.
- Using “session” without naming the owner. State may mean application persistence, request history, or a development-tool session. Define which one is intended and who controls its lifecycle.
- Trusting a plugin because it is packaged. Review its components, configuration, external access, version policy, and rollback path.
- Describing unsupported hosted-surface behavior. The CCDV-F Exam Guide names Claude Desktop and claude.ai within Claude Application Design scope, but this article does not infer their current behavior because the approved source inventory does not document it.
Certification Relevance
For Claude Certified Developer – Foundations, application design requires more than knowing that several Claude surfaces exist. A developer should be able to assign responsibilities deliberately, preserve content and schema boundaries, maintain session hygiene, and avoid confusing development configuration with production application controls.
The Exam Guide v1.0 also names Claude Desktop and claude.ai as scope surfaces. Here they establish the breadth of the published competency only. Detailed claims about their current instructions, sessions, or content behavior require current product documentation that is outside this article's approved source inventory.
Conclusion
Claude application architecture is clearest when the application remains the control plane for business behavior and data. The Claude API and SDKs form a bounded model-integration layer; Claude Code and plugins form governed development and extension layers. Explicit input, output, configuration, schema, and session contracts connect those layers without transferring application responsibilities to them.
This ownership model also creates a useful progression: requirements become interface contracts, contracts become a Messages API integration, and development tooling remains separately configured and reviewed. The result is easier to test, secure, observe, and change because every important decision has a named owner.
Authoritative Sources
- Claude API overview
- Create a Message
- Client SDKs
- Claude Code features overview
- How Claude remembers your project
- Claude Code settings
- Create plugins
- Claude Certified Developer – Foundations Exam Guide

