Skip to content
Ken Ahrens
Go back

Test Code Changes with Claude Code Using Real Traffic

Originally published on speedscale.com.

TL;DR: Claude Code writes features fast, but you need integration tests. With proxymock MCP, Claude Code can pull real production traffic and validate your changes automatically—one prompt, no manual setup. Watch it catch bugs before production.

Testing Claude Code Changes Against Real Production Traffic

“Does it compile?” is a pretty low bar. Sure, Claude Code will crank out new endpoints, but that’s not the same as knowing they’ll actually work in production.

I recently added a /api/launches-summary endpoint to the outerspace-go microservice—it grabs SpaceX launch data and spits back some summary stats. Several files got touched (interfaces, handlers, the main service), but honestly, not everything had tests. Rather than shipping and hoping, I used Claude Code with proxymock to validate everything against actual production traffic.

Walkthrough of using Claude Code to pull production traffic with proxymock, test new features, and validate behavior.

outerspace-go endpoints

The Problem: Integration Testing After AI Code Generation

Don’t get me wrong—Claude Code is great at scaffolding. It handled the new endpoint, wired up the interfaces, integrated with the SpaceX API. But once the diff looks good, I still have no idea if:

Without integration tests, I’m basically shipping on vibes. And setting that up manually is a pain:

If AI coding assistants are supposed to save me time, why am I still doing all this grunt work?

Using Claude Code to Pull Production Traffic

Instead of manually cobbling together integration tests, I threw this at Claude Code:

Download real traffic for outerspace from the production environment and test these changes

Claude Code orchestrating proxymock

Claude Code finding the proxymock MCP and pulling production traffic

It found proxymock MCP on my machine and figured out how to use it. Then it just… did everything:

  1. Made the proxymock directory
  2. Used the pull_remote_recording tool to grab production traffic
  3. Realized the service was actually called outerspace-server (not outerspace)
  4. Downloaded real request/response pairs from prod

The key here is that most AI coding contexts have no clue how your app runs in production. But with the proxymock MCP, Claude Code can pull real behavior automatically.

Capturing Real API Traffic for Integration Tests

After a couple minutes, I had fresh production traffic from November 25th sitting in my repo:

Every request-response pair is human-readable, showing exactly what payloads the service handles. This is the “golden tape”—the real thing. No amount of stubbed unit tests gets you this.

It’s organized by endpoint, with subdirectories for different API hosts (like api.spacexdata.com), so you can see what external dependencies the service actually talks to.

Running Integration Tests with Mock Servers

Now Claude Code has both my new code and the real traffic patterns. Next step: spin up a mock server that simulates production.

It handled:

  1. Starting a proxymock mock server with the pulled traffic
  2. Pointing the outerspace service at the mock server
  3. Running through every API endpoint to verify behavior

I just hit approve on each command and watched it work. The mock server returned production responses for known requests. For the new /api/launches-summary endpoint that wasn’t in the recording, it passed through to the actual SpaceX API—so even brand-new stuff got tested.

Integration Test Results and Bug Detection

Here’s what Claude Code reported back:

✅ Traffic Recording

✅ New Feature Works

⚠️ Found a Pre-Existing Production Bug

✅ No Regressions

So not only did I verify my new code works, but I also caught a production issue I had no idea about. That’s way better than finding out after merging.

Validating Code Changes Before Deployment

Instead of just “it compiles,” I now know:

Claude Code saved me hours writing the feature. proxymock saved me from spending those hours debugging it in production later.

Why Claude Code + proxymock Works for API Testing

Claude Code knows your source code. proxymock knows how your app behaves in production. Put them together and you get:

Getting Started with Claude Code and proxymock

This workflow works for any service that talks to external APIs. The pattern is simple: capture real traffic, replay it locally, and let actual data decide if your changes are safe to ship.

I used outerspace-go for the demo, but the same approach applies whether you’re hitting payment processors, third-party APIs, or internal microservices.

Ready to test your code changes against production traffic? Install proxymock and connect it to Claude Code, or book a working session and we’ll walk you through the setup with your actual services.


Share this post:

Previous Post
Why You Should Stop Buying SaaS and Start Building It
Next Post
Better integration tests in Cursor using proxymock