Home/Work/Claude Agent SDK automation

Case study · Real Brokerage · Engineering operations · 2025–26

Claude Agent SDK automation

An agentic automation layer built on the Claude Agent SDK, triggered by pull requests, incidents and webhooks. It reads diffs, runs tests, spawns subagents, and posts reviews or fixes in a tool-calling loop, removing hours of manual engineering toil.

80%Of review work is mechanical investigation
3Trigger types: PRs, alerts, webhooks
1Tool-calling loop per event
5Agent actions: read, test, inspect, spawn, post

§ 01 — Problem

Code review, incident triage and routine operations were consuming senior-engineer attention on work that is 80% mechanical investigation: reading the diff, running the tests, pulling the logs, checking what changed before the alert fired. The judgement at the end takes minutes. Getting to it took hours.

The requirement was an agent that does that investigation itself and posts what it found, on every pull request, alert and webhook, with a human still deciding what gets merged or applied.

§ 02 — Architecture

Three triggers, one loop.

Events from version control, monitoring and webhooks enter one agent runtime built on the Claude Agent SDK, which investigates with tools and subagents and posts its findings.

Fig. 1System architecture
A pull request, an alert or a webhook starts a run. Inside the runtime the agent reads the diff, runs the tests, inspects logs and spawns focused subagents in a tool-calling loop, then posts a review, a fix or an incident report. A human approves before anything is merged or applied.

§ 03 — How it works

One incident, investigated.

The animation follows a single pull request from trigger to posted review: the agent reads the diff, runs the tests, inspects logs, delegates two subagents, composes its findings and waits for a human to approve.

Fig. 2Agent trace (live illustration)
Repository, file, service and reviewer names in the trace are sample values, not client data.
FilmCase film, 23 seconds
1280 × 720 · H.264 · no audioDownload MP4

Diagrams and films on this page are illustrations of the system's architecture and behaviour, drawn from my work at Real Brokerage. They are not screenshots or recordings of production systems, which remain confidential.

§ 04 — Approach

Agent design

  • A full tool-calling loop on the Claude Agent SDK. The agent reads, plans, calls a tool, observes the result and continues until it has findings to post. A one-shot prompt cannot do this work.
  • Tools for the mechanical part of an investigation: read the diff, run the tests, inspect the logs, post findings.
  • Focused subagents for narrow questions, such as tracing a failing test or checking a migration, each reporting back to the main loop.
  • Findings posted as a review, a suggested fix or an incident report, in the place the engineer already works.

Integration

  • Triggered by pull requests, alerts and webhooks, so the automation runs on every event without anyone starting it.
  • Integrated for automated PR reviews, incident investigation and webhook-driven workflows.
  • Human approval before a fix is applied or a review is acted on. The agent investigates and proposes; an engineer decides.
  • Designed and integrated by the founding team in a production engineering role.

§ 05 — Impact

Automated first-pass PR reviews and incident investigations, returning senior-engineer hours to feature work. The agent does the mechanical 80%: it reads the diff, runs the tests, pulls the logs and posts what it found, so the engineer starts from findings.

What generalises: a tool-calling loop does work a prompt cannot; triggers make the automation run on every event rather than when someone remembers; and a human approval gate is what makes an agent that posts fixes acceptable in production.

Claude Agent SDKTool-callingSubagentsPR reviewIncident triageWebhooksTest runnerLog inspection

§ 06 — At a glance

A one-page summary of this case for sharing. PNG, 1080 × 1350.

Download PNG
At-a-glance infographic for the Claude Agent SDK automation