Stage 6: Maintain
Agents watch production, and a breached control band becomes the next intent.md.
People stop being the ones who start the work
Every earlier stage needs a person to start it. In Stage 6 a trigger starts Claude, and people triage and review what comes back.
Humans watch production
Maintenance is reactive. An alert at 3 a.m. can be missed. Tickets sit in the backlog. Post-mortem actions may never reach the codebase.
Agents monitor live deployments
A control-band breach, a ticket, a channel message or a schedule invokes Claude. It diagnoses, acts only through gated routes, and writes what it found as a new intent.md. The work flows back through the stages.
One play: closing the loop on metrics
Stage 6 runs without a person in the path, with an independent confidence gate between steps. The gate is a deterministic check or a second, adversarial reviewing agent. It decides whether work continues or goes to a human.
Closing the loop on metrics
A watched metric leaves its normal range. An agent investigates and writes the next intent.md.
People watch dashboards and respond to alerts. Fixes start when someone notices.
A script watches the metric. A breach invokes Claude. People triage the queue and no longer have to start the work.
A control band is a range around a metric's normal level. The script takes the baseline as the mean of the last 30 days of hourly readings. It also computes sigma (σ), the standard deviation. The 1σ band ends at the mean plus one sigma, 2σ at the mean plus two, and so on.
Detection stays deterministic. No model is involved in deciding that a band was breached.
Prerequisites
- A structured intent.md to restart the loop
- Claude-accelerated PR reviews
- Hooks as an action boundary
- A rollback path in CI/CD, used by the highest autonomy tier
Infrastructure
- A metrics store the script can query, such as Prometheus or a CI system API
- Read access to the repo
- A way to run Claude Code non-interactively in CI, or the Agent SDK for a service that receives webhooks
- Service owner or platform engineer picks one metric with a stable rolling baseline, such as CI test failure rate, post-deploy 5xx rate or PR cycle time.
- Write the detection script: a rolling mean and sigma, plus rules that catch slow drift as well as spikes. Keep it in version control and unit test it.
- Define the response tiers in version-controlled config (bands.yaml). 1σ logs. 2σ diagnoses read-only. 3σ may act, only by opening a PR or triggering a pre-approved runbook.
- Choose the trigger: a scheduled workflow, a webhook from existing monitoring, or a cron job. Claude runs stateless, as a non-interactive CI step or an Agent SDK service in a sandbox.
- The agent writes its diagnosis as intent.md in the Stage 1 format.
- Service owner or on-call triages the queue: fix now, schedule or dismiss. Product-facing findings go to the product owner.
- When a fix ships, add an eval for the incident.
Watch it run in the step-through below. The same setup works for other metrics. A 3σ CI failure rate can quarantine a flaky test or open a revert PR. A PR cycle time drift can produce a report for engineering leadership.
Bands live in config
Tier boundaries are enforced from version-controlled config. Permissions and managed settings deny production access.
People approve
A service owner triages and approves findings. Changes go through the normal PR gate. Runbooks the agent may trigger are approved in advance.
Everything is logged
Invocations, findings and triage decisions are timestamped.
From a steady metric to the next intent.md
Start with one metric that has a stable baseline. Press Play, or use Next to go at your own pace.
One production metric, for example the 5xx rate on one endpoint
The grey block is the 30-day rolling baseline of hourly readings.
Pick one metric with a stable baseline
Good first choices from the course:
- CI test failure rate
- Post-deploy 5xx rate
- PR cycle time
Start with one. It should sit in a steady range most of the time.
Draw the bands from the last 30 days
The script computes the mean and sigma. The tiers are written down in version control.
Drift rules catch slow creep that never crosses 3σ. A drift counts as 2σ.
A reading lands outside the bands
A release goes out and the newest reading jumps above 3σ. A scheduled job runs the script, which prints the worst tier the newest reading lands in.
The trigger layer can be a scheduled workflow, a webhook from monitoring, or a cron job.
The tier sets how far Claude may go
The agent writes a new intent.md
- Problem The anomaly and the evidence.
- Proposed outcome What should be true again.
- Affected users and systems
- Constraints
- Open questions What a person needs to decide.
A person triages the queue
Product-facing findings go to the product owner. Every triage decision is timestamped.
The intent.md enters Stage 1
It flows through requirements, plan, build, test and review. When the fix ships, add an eval for the incident.
Go to Stage 1: Plan →Two more ways the loop gets started
Claude joins the incident channel
Claude Tag is in public beta, currently in Slack. Claude becomes a member of incident channels under its own identity, so each incident gets a first responder.
- The conversation and what the team knows stay in the channel, and anyone there can guide the response.
- Through MCP, Claude checks the metric is back at baseline and says so in the thread.
- It writes the post-mortem to a version-controlled lessons file that later investigations read.
- Tagged on a ticket, it triages. A small, bounded fix arrives as a PR through the review gate. Anything larger becomes an intent.md for Stage 1.
Recurring security scans
The Anthropic blog describes scheduled scans of connected repos through Claude Security. Findings are validated and come with confidence ratings. This is absent from the academy lessons, and we have not checked it against the original text.
The routing matches the rest of Stage 6. Small fixes go through the review gate. Larger issues become an intent.md.
What Stage 6 hands to the next stage
Written by the monitoring agent in the Stage 1 format, with the evidence from the breach.
A triage decision of "fix now" or "schedule"
The intent.md goes to Stage 1: Plan, and the loop starts again.
Stage 1: Plan →Key takeaways
- Start with one metric that has a stable baseline.
- Detection is a deterministic script. Claude acts only after a band is breached.
- Tiers set the limits: 1σ logs, 2σ diagnoses read-only, 3σ proposes a PR or a pre-approved runbook.
- The agent writes the finding as an intent.md. A person decides: fix now, schedule or dismiss.
- Every shipped fix adds an eval, so repeat incidents fall over time.
The loop keeps running
People keep the judgement. Agents do the watching, the diagnosing and the drafting, and each finding becomes the start of the next turn.
Based on Anthropic's The AI-native SDLC playbook course (Claude Academy). Summarized by Bitovi to guide client transitions.