Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

Claude
  • CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
  • Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
  • One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
  • Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
  • Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
  • Choosing a Claude Code Extension: Skill, Hook, Rules File, Subagent, Slash Command or Plugin
  • Rolling Out Claude Code to a Team: Settings Precedence, dontAsk in CI, a Hook for Every-Time Rules and a Plugin for Five Repos
  • A Claude Code Review Bot in CI: Headless -p, JSON Findings, Team Rules in Git and a Person on the Merge
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
  • The Claude Messages API: Your First Call, Field by Field
  • Claude Tool Use: How tool_use and tool_result Work in the Messages API
  • Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared
  • Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move
  • Claude Streaming Events: The Event Order, message_stop, Tool Arguments, Stop Reasons and a WebSocket Relay
  • Images, PDFs and Thinking Blocks in the Claude Messages API: Typed Blocks In, Typed Blocks Out
  • Getting Data Into Claude: PDF Documents, the Files API, Search Results and Citations
  • Opus, Sonnet or Haiku: Pick the Claude Model per Job, and Test the Request When a New Release Arrives
  • Adaptive Thinking and Effort in Claude: Two Dials, Set per Workload, and the Thinking Block You Must Pass Back
  • Claude Cost Tracking From usage: Count Before, Cap During, Read After, Then Find the Line That Drives the Bill
  • Claude Cache Breakpoints: Where to Put cache_control, How to Move It With the Chat, and Why the Reads Stay at Zero
  • Claude Message Batches or Real Time: Choose by Who Is Waiting, Match by custom_id, Resend Only the Failures
  • Calling Claude Through Amazon Bedrock, Google Cloud and Microsoft Foundry: Same Call, Different Door
  • The Life Cycle of a Claude App: Six Phases, a Model That Retires, and a Release Gate for Every Change
  • Pinning Claude Model IDs and Upgrading Safely: One Change at a Time, a Golden-Set Replay and a Staged Rollout
  • Content Boundaries and Schema Design for Claude: Fence the Input in a Tag, Let the Output Say I Don't Know
  • The Agentic Loop and stop_reason: Keep Turning on tool_use, Stop on end_turn, Cap the Turns
  • The Claude Agent SDK: query(), ClaudeAgentOptions and @tool, in Python and TypeScript
  • Fix the Agent: Four Broken Claude Agent SDK Configs, From the Symptom to the One Wrong Line
  • Claude Managed Agents: Cloud Sandbox, Self-Hosted Sandbox or Self-Hosted Service
  • Agent SDK Hooks for Deterministic Actions: PreToolUse, PostToolUse, and Four Hooks That Fail Silently
  • Memory and Context-Window Patterns for Claude Agents: Context Editing, Compaction and the Memory Tool
  • Reading an Agent Trace: Five Signatures, Five Missing Patterns, and How Long a Fact Must Live
  • Tool Descriptions for Claude: How Claude Picks a Tool, and How to Stop It Picking the Wrong One
  • Tool Input Schemas and Error Responses for Claude: Required Fields, Enums, is_error and a Retry Flag
  • Tool Response Shaping and a Lean Tool Set: Give Claude a Sticky Note, Not the Filing Cabinet
  • Fix the Tool Schema: Read the Trace, Fix the Card, Re-Run (Four Real Schema Bugs)
  • Client Tools, Server Tools and Approval Gates: Who Runs the Tool, and Who Says Yes First
  • Built-in Tool, Custom Tool, Skill or MCP Server? Pick the Lightest One That Fits
  • System Prompt or User Turn: Where Each Instruction Goes, and Output Limits Your Code Enforces
  • Refine the Prompt One Line at a Time, Then Clean and Fence the Customer's Text
  • Prompt Revision Driven by Evals: Name the Cause, Change One Thing, Rerun the Whole Suite
  • Long-Running Sessions: Compact, Prune, Isolate or Start Fresh, Decided by Naming the Failure
  • Context Isolation Through Subagents: Read the Logs Elsewhere, Keep One Line
  • Defensive Parsing of Claude Replies: Check the Stop Reason, Read the Block or the Text, Then Validate the Values
  • Full Context or Retrieval: Choose by Corpus Size, Cost and Freshness
  • Skepticism Toward Confident Output: Check the Quote, the Record and the Sum Before You Send
  • Debugging a Claude App: Three Error Types, the Recovery Each One Earns, and the First Failing Row
  • Six Ways a 200 Can Still Be Wrong: Hallucination, Refusal, Under-Acting, Context Loss, Format Drift and Inconsistency
  • Fix the Cause, Not the Symptom: Four Recovery Drills for an LLM App, Each Checked on a New Input
  • Integration Layer or Model Output? Three Taps and Three Questions to Find Where a Wrong Answer Lives
  • Which Test Layer Owns the Failure? Unit, Functional, Integration and End-to-End Tests for a Claude App
  • Designing an Overnight Document Pipeline on Claude: Batch Lane, Live Lane, a Cached Prefix and a custom_id Reconcile
  • Proving a Model Upgrade Is Ready: A Frozen Golden Set, a Calibrated Judge, the Right Layer and a Release Gate
  • From Requirement to Design for a Claude App: Eight Requirements, Five Elements and a Trace With No Gaps
  • Build a Claude Refund App: the Messages API, Two Tools, an MCP Server and a Hook in One Loop
  • Ship a Claude App: an Eval Gate, Two Guardrail Layers, a Cost Check From usage and a Pinned Model
  • Lab: a 30-Case Golden Set, a Calibrated Judge and a Per-Slice CI Gate on a Claude Refund App
  • Lab: Cut a Claude App's Bill by 62 Percent With Usage Data, Layered Cache Breakpoints and a Batch Job
  • Lab: Three Planted Bugs in a Claude App, a Vague Prompt, a Mistyped Tool Schema and a Broken Stream Handler
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Lab: Harden a Claude App, an Uncalibrated Judge, a Retry Loop That Retries Everything and a Hook Matcher With a Gap
  • Lab: Turn a Claude App Into a Reusable Template, One Pinned Model Id, No Key in Code and Evals Built From Data
  • Building an MCP Server: Tools, Resources and Prompts in Python and TypeScript
  • MCP Transports: stdio or Streamable HTTP, and Who Starts the Server
  • Deploying and Authenticating an MCP Server: Environment Keys for stdio, Bearer Tokens and Scopes for HTTP
  1. Blog
  2. /
  3. Claude
  4. /
  5. Building with the Claude API

The Life Cycle of a Claude App: Six Phases, a Model That Retires, and a Release Gate for Every Change

Follow a returns helper through plan, build, test, release, operate and maintain: watch the model's status from active to retired, and put a release gate with eval cases in front of every prompt change.

Chaand Sheikh

·27 November 2026Building with the Claude API

What you will learn

  • Name the six phases of a Claude app's life cycle and why it loops back from maintain to plan
  • Explain how waterfall, agile and DevOps run that loop
  • Read a model's status from active to retired and plan a migration before the retirement date
  • Write a release gate that promotes a prompt change only when every eval case passes

Before you start

  • The Claude Messages API: your first call
  • Basic Python

Shipping a Claude app isn't the end of the work. It's one step in a loop. The app gets planned, built, tested, released, operated and maintained, and then the loop starts again.

We follow one small app, a returns helper, through three moments of its life:

  • It has been live for months. Someone has to watch the usage, the errors and the cost. That's operating.
  • Someone tidies the system prompt. It looks harmless, but it's a change to release, and it needs a gate.
  • The model the app uses gets a retirement date and a named replacement. The app has to move. That's maintaining.

Shipping is the middle of the story.

Six phases, one loop

The life cycle of a Claude app Plan requirements, model choice Build code, prompts, tools Test evals before release Release deploy with a pinned model Operate errors, usage, cost Maintain fix, update, migrate models the next change starts again
A Claude app is never finished. It loops from maintain back to plan.

For a Claude app, each phase has a concrete meaning:

  • Plan: requirements and the choice of model.
  • Build: code, prompts and tools.
  • Test: evals before release.
  • Release: deploy with a pinned model.
  • Operate: watch errors, usage and cost.
  • Maintain: fix, update and migrate models.

The Claude Certified Developer guide groups these into four words: develop, implement, operate and maintain. Same loop, coarser labels. If the plan phase is where you are, from requirement to design for a Claude app shows how a business need becomes requirements and a design.

Three ways to run the loop

Teams run that loop in different ways. These are general IT frameworks, not Claude features:

FrameworkHow it runs the phases
WaterfallOnce, in order. A phase ends before the next one starts.
AgileShort loops. Each one plans, builds, tests and releases a small piece that works.
DevOpsAdds automation. Code is tested and released by automated checks, and what happens in operation feeds the next change.

Prompts, tools and models change often, so short loops with automated checks fit a Claude app well.

A model has a life cycle too

The model your app calls goes through its own states, as described on the Claude docs page Model deprecations:

  1. Active: fully supported.
  2. Legacy: no more updates.
  3. Deprecated: still works, but a replacement is named and a retirement date is set.
  4. Retired: requests to it fail.

For publicly released models, Anthropic gives at least 60 days of notice before retirement. So migrate early: test the replacement with your evals before the retirement date. To find where an old model is still used, the Console's Usage page can export a CSV broken down by API key and model. Amazon Bedrock and Google's Vertex AI set their own schedules for the Claude models they host, so check the platform you're on.

model_watch.py: is our model still supported?

A tiny check for the maintain phase. The status table is the project's own copy, written for the demo; in real life you read the live Model deprecations page.

"""Check a model against its life cycle status."""

# our own copy of the status table:
# read it from the Claude docs, Model deprecations
NEW = "claude-sonnet-5-5"
REGISTRY = {
    "claude-sonnet-4-5-20250929": ("deprecated", NEW),
    "claude-sonnet-4-20250514": ("retired", NEW),
    NEW: ("active", None),
}


def check(model):
    state, replacement = REGISTRY[model]
    if state == "active":
        return f"{model} active"
    if state == "deprecated":
        return (f"{model} deprecated "
                f"-> move to {replacement}")
    return (f"{model} retired, requests fail "
            f"-> use {replacement}")
  • Each entry holds a state and, where there is one, the replacement.
  • Deprecated means the model still works, and the message says where to move.
  • Retired means requests fail, and the message names the replacement.

A prompt edit is a release too

Now the gate. A prompt change goes through eval cases, and then through a gate that asks one question: did they all pass?

The release gate prompt v2 prompt v3 (shipping line dropped) 3 eval cases v2: pass, pass, pass v3: pass, pass, FAIL promote v2 blocked, 2 of 3 live version stays
One failing case is enough to stop a change.

release_gate.py

"""A release gate: ship only if every case passes."""
from stand_in import MODEL

CASES = [
    ("How long can I return it?", "30 days"),
    ("Can I return it opened?", "working order"),
    ("Who pays return shipping?", "free"),
]


def run_cases(client, system):
    passed = 0
    for i, (q, must_have) in enumerate(CASES, 1):
        ask = {"role": "user", "content": q}
        r = client.messages.create(
            model=MODEL,
            max_tokens=200,
            system=system,
            messages=[ask],
        )
        ok = must_have in r.content[0].text
        print(f"  case {i} {'pass' if ok else 'FAIL'}")
        passed += ok
    return passed


def gate(client, name, system):
    passed = run_cases(client, system)
    if passed == len(CASES):
        print(f"  gate: promote {name}")
        return True
    print(f"  gate: blocked {name}, "
          f"{passed} of {len(CASES)} passed")
    return False
  • Each case is a question and a phrase the reply must hold.
  • Every case runs against the candidate prompt, the new version we want to ship.
  • The change is promoted only if every case passes. Otherwise it's blocked and nothing is released.

run_all.py builds prompt v2 with three lines (deadline, opened, shipping) and v3 as a tidy-up that keeps only the first two:

"""Run the model watch and the release gate."""
import model_watch, release_gate, stand_in

print("model watch")
for model in model_watch.REGISTRY:
    print(" ", model_watch.check(model))

client = stand_in.make_client()
V2 = "\n".join([
    "deadline: Returns are accepted within 30 days of delivery.",
    "opened: Opened items can be returned if they are in working order.",
    "shipping: Return shipping is free for faulty items.",
])
V3 = "\n".join(V2.splitlines()[:2])        # a tidy-up that dropped the shipping line

print("release gate, prompt v2")
release_gate.gate(client, "v2", V2)
print("release gate, prompt v3")
release_gate.gate(client, "v3", V3)

Watch and gate: what the run printed

The project runs against a stand-in (the real Anthropic SDK on an httpx mock transport) that answers from the matching line of the system prompt. The cases and replies are scripted for the demo.

model watch
  claude-sonnet-4-5-20250929 deprecated -> move to claude-sonnet-5-5
  claude-sonnet-4-20250514 retired, requests fail -> use claude-sonnet-5-5
  claude-sonnet-5-5 active
release gate, prompt v2
  case 1 pass
  case 2 pass
  case 3 pass
  gate: promote v2
release gate, prompt v3
  case 1 pass
  case 2 pass
  case 3 FAIL
  gate: blocked v3, 2 of 3 passed

The deprecated model gets a "move to" message, the retired one a "requests fail" message, and the active one needs nothing. Prompt v2 passes everything and is promoted. Prompt v3 looked harmless, but it lost the shipping answer, so it's blocked.

A three-case gate is the smallest version of the idea. To grow it into a golden set with graders and CI gates, see regression testing an LLM bot in CI. For the model side of maintenance, moving off a retiring model with a replay and a staged rollout, see pinning Claude model IDs and upgrading safely.

Common mistakes

  • Treating release as the end. Operating and maintaining come next, and they last longest.
  • Assuming a retired model keeps answering. Requests to a retired model fail. Migrate before the date.
  • Shipping a prompt edit with no test. A prompt edit is a release. It goes through the gate like code.
  • Waiting for the retirement date to test the replacement. The notice period is for running your evals on the new model.

Quick recap

IdeaWhat to remember
PhasesPlan, build, test, release, operate, maintain, then back to plan
FrameworksWaterfall runs once; agile and DevOps run short, automated loops that suit a Claude app
Model statusActive, legacy, deprecated, retired; at least 60 days of notice for public models
Release gateEvery case must pass before a prompt, tool or model change ships

Try it yourself

Add a fourth case to CASES, such as a question about exchanges, and a matching line to prompt v2. Run the gate again and confirm v2 still promotes and v3 is still blocked. Then add your own app's model ID to REGISTRY with the state the live Model deprecations page shows for it.

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in Claude · 24 of 66

Previous
Calling Claude Through Amazon Bedrock, Google Cloud and Microsoft Foundry: Same Call, Different Door
Next post
Pinning Claude Model IDs and Upgrading Safely: One Change at a Time, a Golden-Set Replay and a Staged Rollout

Related course on Udemy

Claude Certified Developer - Foundations (CCDV-F) Exam Prep

Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)

Related posts

The Claude Messages API: Your First Call, Field by Field

One request in, one Message out. The four fields of a Messages API call (model, max_tokens, system, messages), how to read content blocks, stop_reason and usage, and why every turn resends the history.

Claude Tool Use: How tool_use and tool_result Work in the Messages API

Follow one order question through Claude's tool round trip: define a tool, read the tool_use block, run your own function and send a matching tool_result back, including parallel calls and is_error.

Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared

Every Claude client SDK wraps the same REST request: a POST to /v1/messages with a JSON body. See it built by hand, through the Python and TypeScript SDKs, as typed errors, and as async calls that wait together.

Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move

Configure the Anthropic SDK client (timeout, max_retries, with_options, async, pagination), see which errors it retries by itself, then repair a retry wrapper so a 429, a 529, a 400 and a timeout each get the move the docs support.

On this page

  • Six phases, one loop
  • Three ways to run the loop
  • A model has a life cycle too
  • model_watch.py: is our model still supported?
  • A prompt edit is a release too
  • release_gate.py
  • Watch and gate: what the run printed
  • Common mistakes
  • Quick recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Claude Certified Developer - Foundations (CCDV-F) Exam Prep

Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.