What workflow state should I store outside Claude sessions and the prompt cache?
Store data that must survive restarts, support audit, or be shared across workers in an application-controlled system.
PUBLIC BETA OFFER
Save 50% off on an Eligible Learning PlanValid for 1-month plan, 3-month plan, 12-month plan · Code LPXBETA50 · Ends Dec 6, 2026
852 published articles
Store data that must survive restarts, support audit, or be shared across workers in an application-controlled system.
Start by identifying the failed contract, such as incorrect task outcome, malformed output, weak grounding, wrong tool behavior, an authorization problem, excess latency or cost, or a confusing user experience.
Build a versioned suite of realistic cases with expected properties or a review rubric.
Define the application’s fallback and review gates before deployment. Use a safe partial answer, a request for missing information, or a bounded retry of a transient read when those options satisfy policy.
Define a separate measurable threshold or rubric for each outcome that matters to the application.
Set a context budget below the documented limit of the selected Claude model. Count the prompt, history, tool definitions, and available tool results in the input estimate.
Use compaction to summarize older conversation turns when the next decision can proceed from a concise state record.
Retry a plausibly temporary failure only within a finite attempt and elapsed-time budget. On the first-party Claude API, an overload (529) or retryable rate limit (429) can warrant backoff.
For custom client tools, append Claude's assistant message, then send the results together in the immediately following user message.
Treat a timed-out write as an unknown outcome if the destination may have received it. Check the destination using the recorded operation ID or idempotency key before retrying.
For MCP 2025-06-18, the client sends initialize with its requested protocol version, capabilities and client information. The server returns its supported choice and capabilities. If the client cannot use the returned version, disconnect.
The MCP host coordinates clients and manages connection and consent policy. Each client communicates with one server, and a server exposes focused capabilities.