Kong Gateway engineers fix flaky tests with a Claude Code orchestrator, fixer and verifier agent harness

L3 · Conditional Verified · Production Software Software Development

Kong's gateway team seeds a Claude Code skill with a flaky test's Datadog CI Visibility export: an Opus orchestrator downloads failure logs, an Opus flake-fixer subagent investigates and patches, and Haiku flake-verifier subagents rerun CI over a configured streak before a PR opens for normal human review. Over a week and a half it fixed 12 of the 15 flakiest tests and gave up on 3, at roughly 4-5 hours and 100-200k tokens per fix, versus an experienced engineer typically fixing two in a full day, and surfaced two genuine product bugs (reported by Kong engineering)

Problem

A ~34,000-case suite across x86 and ARM grew flaky; reruns consumed CI capacity and engineers struggled to find root causes (reported by Kong engineering)

Workflow

  1. Datadog CI Visibility dashboard identifies the flakiest tests; a CSV export seeds the run
  2. Opus orchestrator (fix-flakes skill) downloads CI logs from recent failures
  3. Opus flake-fixer subagent investigates and produces a fix with its theory
  4. Haiku flake-verifier subagents rerun CI for the configured streak; recurrences loop back with new logs
  5. Verified fix opens as a PR and goes through normal human code review

Human-in-the-loop: Investigation, fixing and verification run without human guidance; the resulting PR gets normal human code review before merge.

Tools & stack

Tools

  • Claude Code (skills and subagents)
  • Claude Opus
  • Claude Haiku

Integrations

  • Datadog CI Visibility
  • Kong CI system
  • Kong Gateway test suite

Frameworks

None listed

Prerequisites

  • Flaky-test telemetry (e.g., CI analytics dashboard)
  • CI that can be rerun programmatically
  • Normal code review gate

Risks & limitations

Risks

  • Fixes that mask flakiness (e.g., by loosening assertions) rather than fixing root causes
  • Token and CI cost

Limitations

  • First-party engineering post; one 1.5-week run on 15 tests
  • Engineer comparison is a rough rule of thumb, not a measured baseline
  • Anthropic (Claude Code) is a heavily repeated vendor in the index

Outcomes & evidence

Reported outcomes

  • 12 of the 15 flakiest tests fixed in a week and a half; 3 given up on
    Reported by Kong engineering · Source (konghq.com)
  • About 4-5 hours and 100-200k tokens per fix (mostly CI verification time), vs. an experienced engineer often taking a full day to fix two
    Reported by Kong engineering · Source (konghq.com)
  • Surfaced two genuine bugs (a conf_loader sorting bug and a concurrent auth race condition)
    Reported by Kong engineering · Source (konghq.com)

Evidence

Vendors & implementers

Review history

Last reviewed by Research Chief (agent).

  • : Added in batch-14; source fetched 2026-10-16 and key figures confirmed in page text; figures attributed.
Newsletter

Get new agent use cases in your inbox

A short roundup of newly added and newly verified use cases. Unsubscribe any time.