Boxing in the LLM: REST Assured to Postman with Claude Code Postman built a REST Assured converter that converts Java API test suites into Postman Collections by running Claude Code inside deterministic scaffolding, with a shell `for` loop deciding what to convert and a worker handling one Java test class at a time. The production converter schedules work with `p-map` at a concurrency of 6, gives each unit three attempts, and enforces a 30-minute pipeline timeout; a unit that fails all three attempts lands in a failed list and the run continues. The design deliberately places the LLM at the leaves of the call tree rather than the root, with no coordinator agent, because handing an entire project to a model in one prompt produces invented cross-class references. Boxing in the LLM: REST Assured to Postman with Claude Code Migrating a mature Java API test suite into Postman sounds like a job for an LLM until you try it. A single REST Assured project can carry hundreds of @Test methods across dozens of classes, a BaseTest that sets the base URI in a @BeforeSuite , parameterized data providers, a few WireMock stubs, and a TestNG suite XML that quietly decides which classes run. Hand all of it to a model in one prompt and you get creative fiction. Hand it one class at a time, inside boring deterministic scaffolding, and you get correctness. That’s the architecture we landed on when we built Postman’s REST Assured converter, and it carries over to a workflow you can run on your own machine. In this post you’ll convert a REST Assured project to a Postman Collection with Claude Code and the Postman plugin https://learning.postman.com/docs/postman-plugin/skills . A shell for loop decides what to convert and how many pieces there are. A boxed-in worker converts one test class at a time. The plugin’s skills supply the collection file format, run the result, and gate it in CI. The most reliable agent in the system is the for loop. Box in the model Every decision downstream flows from one choice: what counts as a unit of work the model is allowed to reason about? We picked one Java test class. A method is too little context, because data providers and helper methods live at the class level. A whole project is too much, and the model starts inventing cross-class references. Once you commit to that boundary, the rest of the design follows: | Job | Who does it | Why | |---|---|---| | Find the test classes | A regex | JUnit 5 and TestNG markers are well defined, so there’s no reason to spend tokens looking for them | | Resolve shared config such as the base URI | One model call, once | Every worker reuses the answer, so you don’t get N different names for the same variable | | Fan out across classes | A for loop with retries | When a class fails, it fails alone | | Translate one class | A worker with read-only tools | This is the part that needs judgment | | Write files and assemble the collection | Code | No model call decides where a file goes | | Check the result | The Postman CLI | Lint checks structure and a run checks behavior | In the production converter, the scheduling is p-map https://github.com/sindresorhus/p-map with a concurrency of 6, each unit gets three attempts, and the whole pipeline has a 30-minute timeout. A unit that fails all three attempts lands in a failed list and the run keeps going. There is no coordinator agent: no orchestrator LLM watching the run, no planner picking the next unit. The agent is a function that the loop calls, so the LLM lives at the leaves of the call tree, not the root. What you need - Claude Code https://code.claude.com/docs/en/headless with the claude command on your path - The Postman CLI the plugin’s cli-install skill can install it if it’s missing - jq and a Unix shell - A REST Assured project with JUnit 5 or TestNG tests Install the Postman plugin One command installs the plugin into each supported agent it detects, including Claude Code: npx @postman/postman-plugin The plugin gives Claude skills for API engineering. Each skill holds instructions the agent reads for a task. This workflow touches four of them: collection-schema-v3 for the collection file format, api-testing for running assertions, api-mocking for stubs, and ci-integration for the pull request gate. Linting and running a collection locally don’t require you to sign in to Postman. You only need to sign in when you publish to a workspace. Step 1: Discover test classes with grep Before any model runs, a discovery pass walks the project with plain tools. The marker count it records becomes the coverage target for each class. Create scripts/discover.sh : bash /usr/bin/env bash Step 1: find every test class and count its test markers. No model involved. set -euo pipefail MARKER='@ A-Za-z0-9 . \. ? Test|ParameterizedTest|RepeatedTest|TestFactory|TestTemplate ^A-Za-z0-9 |$ ' grep -rlE "$MARKER" src/test/java | sort | while read -r file; do printf '%s\t%s\n' "$file" "$ grep -cE "$MARKER" "$file" " done units.tsv cat units.tsv On the demo project, which has a BaseTest plus UsersTest and PostsTest , the output looks like this: src/test/java/com/example/PostsTest.java 3 src/test/java/com/example/UsersTest.java 2 BaseTest has no test markers, so it isn’t a unit. It’s context the workers will read. Over-inclusion is fine at this stage. A class with no HTTP calls comes back with an empty list, while a class that never got enumerated is a bug you may not notice for months. Step 2: Resolve shared configuration once Most REST Assured projects build a shared RequestSpecBuilder in a base class. If every worker rediscovered it independently, you’d get a different guess at the variable name from each one. So a single resolver call runs first, with a prompt that is aggressively narrow. Save it as prompts/resolver.md : Resolve the CROSS-CUTTING configuration shared across all tests in this Java API-test project. Do this ONCE: every test class will reuse your output. You are NOT converting tests here. Look for a base class or @BeforeSuite/@BeforeClass block that sets the base URI, shared headers, content type, or authentication. Use the read, glob, and grep tools. Return ONLY a single JSON object, with no prose and no code fence, in exactly this shape: {"variables": {"key":"baseUrl","value":"https://..."} ,"brief":"two or three sentences about shared setup the converters need to know"} Then call it from scripts/resolve.sh . The --allowedTools flag is the box: this call can read files and nothing else. Redirecting stdin from /dev/null keeps claude -p from waiting on a pipe. bash /usr/bin/env bash Step 2: one model call that resolves shared configuration. set -euo pipefail claude -p "$ cat prompts/resolver.md " \ --allowedTools "Read,Glob,Grep" \ --output-format json < /dev/null \ | jq -r '.result' \ | sed -e '/^ /d' resolved.json jq -e '.variables and .brief' resolved.json /dev/null cat resolved.json The last jq -e line is a deterministic check on a probabilistic step. If the model returns anything other than the shape you asked for, the script stops. On the demo project, the resolver returns this: { "variables": { "key": "baseUrl", "value": "https://jsonplaceholder.typicode.com" } , "brief": "BaseTest.setupSpec @BeforeSuite sets a global RestAssured request spec with base URI https://jsonplaceholder.typicode.com and Content-Type application/json. There is no authentication and there are no other shared headers or base path." } The worker never has to guess what to name baseUrl , because it was told. Step 3: Convert one class at a time with a for loop The worker prompt is explicit about its boundary. It converts exactly one class, it can’t write files, and it has to return JSON. Save it as prompts/worker.md : You convert exactly ONE Java REST Assured test class into Postman v3 request files. You have read-only tools read, glob, grep scoped to this project. You cannot write files or run commands. Read the class named at the end of this prompt, and follow base classes, helpers, and data providers it depends on. Use the collection-schema-v3 skill for the exact shape of .request.yaml files. Rules: - Write one request per @Test method. If a data provider changes the request, write one request per row. - Use {{baseUrl}} for the base URI. Never hardcode the host. Reuse the variable names from the shared setup below. - Put assertions in an afterResponse script, using pm.test and pm.expect. - Translate REST Assured and Hamcrest like this: .statusCode n - pm.response.to.have.status n .body "json.path", matcher - assert on pm.response.json at that path .time lessThan ms - pm.expect pm.response.responseTime .to.be.below ms .header k, v - pm.expect pm.response.headers.get k .to.eql v equalTo x / is x - .to.eql x hasItem x / containsString s - .to.include x greaterThan n / lessThan n - .to.be.above n / .to.be.below n notNullValue / nullValue - .to.exist / .to.not.exist hasSize n - .to.have.lengthOf n Return ONLY a JSON object, with no prose and no code fence, in exactly this shape: {"requests": {"file":"get-user-by-id.request.yaml","yaml":"