🔍 My Agents Didn't Decompile the JAR. They Read the Bytecode.
📅 Friday, Nov 27, 2026
⏰ 12:00 PM

Given only an undocumented JAR, coding agents in Cursor read its bytecode with javap in seven of nine runs and never ran a decompiler. All nine shipped working endpoints, and going without the source didn’t reliably raise the token bill: the full bytecode listing for the class is about 3,250 tokens, in runs that used 199,000 to 462,000 each. The surprise came from the control group. With the library’s source sitting in the repo, Claude Opus 5.5 disassembled the JAR anyway in every run, to check that the two matched.
This started on X. Kai Strempel told James Ward that languages shipping compiled frameworks and libraries aren’t efficient for agents, and that JVM languages are mostly like that. James answered that his experience is the opposite. Kai came back with the question I wanted to test: “didn’t you spend a lot of tokens when the agent starts to disassemble a java lib because you want to use somehow a not so well documented feature? ” I asked for a project, a prompt, and an agent harness so I could reproduce what he was describing. Then I built my own.
I built a JAR nobody can look up
The library is one class, com.harborline.ticketkit.TicketKit, with three public static methods named a, b, and c. I compiled it with javac --release 21 -g:none and left off -parameters, so the class file keeps its signatures but carries no parameter names or line numbers (Oracle’s javac reference
sums up -g:none as “Does not generate debugging information”). When the agents saw it, it had never been published, so there was nothing to search for.
Method a adds two longs with Math.addExact, and b trims and lowercases a word before checking it against a 24-word vocabulary. Method c folds two longs and a word through bit rotations and a one-minute time bucket into a ticket like juniper~delta:p3lxpxf7.
The trap is in the signature c(long, String, long). Its first argument is the timestamp and its third is the sum, while the task describes a ticket built “from a sum, a word, and a timestamp.” Swap the two longs and you still get a ticket that looks valid (harbor~harbor:nkfihzfw); it’s just wrong. Before any agent saw the JAR, I ran it against an independent Python implementation of the same logic: 2,025 cases, zero mismatches.
The prompt never mentions decompiling
Each run got the same Spring Boot 3.5.16 starter on Java 21, with ticket-kit served from a Maven repository inside the project. TASK.md asks for POST /api/tickets, which adds two numbers and returns the sum along with a ticket from ticket-kit. It wants a 400 for bad input and a 422 when the sum overflows a signed 64-bit long, plus tests and an executable JAR. It shows one request and the response “the old system returned” for it. About the library, it lists what the three methods do between them and then admits: “Nobody remembers which method is which.”
The two workspaces differ by one sentence. The jar-only TASK.md says, “That team is gone, and the jar is all we have. There are no docs.” The source version swaps the ending for “There are no docs, but they left the library’s source in ticket-kit-src/.” The prompt never changed:
Implement the endpoint described in TASK.md.
I ran three models through the Cursor CLI in headless mode (version 2026.11.22, commands auto-approved): Composer 2.5, Claude Opus 5.5 at medium effort, and GPT-5.6 Sol at high. Each model got three runs per workspace, 18 in all. Each one streamed its tool calls and token usage as stream-json , and the numbers below come from those traces.
My first pilot showed me the harness is part of the experiment. Opus found a Qodo skill in my home directory and spent tool calls running the Qodo CLI, which has nothing to do with tickets. So each counted run got a fresh home directory holding only Cursor’s built-in skills and my team’s plugins, with an environment trimmed down to the JDK and Maven. Its workspace copy moved out of /tmp the moment it finished, and the experiment kit (with the library source and my reference solution) stayed packed in an archive while the runs went. Afterward I audited every path each agent touched. None went outside its own folder except to write scratch files in /tmp.
With only the JAR, seven of nine runs read the bytecode
Every jar-only run listed the class’s methods with javap, guessed from the signatures which method was which, and then probed: it called the library from jshell or a scratch class until the example ticket came out. They split on whether to read the bytecode before probing. Opus printed the full bytecode in all three runs before writing any code, and GPT-5.6 Sol printed bytecode in all three as well. Composer did it once; its other two runs didn’t look at an instruction and found the argument order by trying permutations against the example.
Oracle’s javap reference
says -c “Prints disassembled code,” and for this class that’s 313 lines of JVM instructions. Mostly, the models read them well. Here’s Opus in one run: “the first long argument is divided by 60000, so it looks like a timestamp in minutes, while the third argument is multiplied by a constant and appears to be the sum.” That’s the whole trap worked out from bytecode; a probe confirmed it. GPT-5.6 Sol misread its listing once (“lload_0 with floorDiv 60000, which makes it look like the sum”), and its probe caught the mistake before it wrote the controller.
No run fetched or ran a decompiler. There’s no CFR, Procyon, Fernflower, or Vineflower in any of the 18 traces, and no reconstructed Java source. The agents use the word anyway. Right after running javap, one Opus run reported, “I’ve decompiled TicketKit and am checking the argument order of c against the example in TASK.md.”
All nine jar-only endpoints passed the grader’s 131 live HTTP checks: the example, 96 tickets across the vocabulary and four timestamps, 64-bit boundaries, overflow, case and whitespace normalization, and strict JSON types. Their own tests passed too.
The source didn’t stop the disassembly
In the source workspace, every run read TicketKit.java, which answers the trap in one line: Math.floorDiv(t, 60_000L). Opus disassembled the JAR anyway, all three times, with the same javap -c -p -constants. It said why: “I need to check whether the jar actually matches the source, so I’ll decompile it with javap.” In another run it reported that “the jar’s bytecode matches the source, with the first argument of c being the timestamp and the third the sum, the reverse of TASK.md’s order.”
I’d want a person to make that check. The source is the drawing and the JAR is the part that ships, and the team that could vouch for the drawing is gone, so Opus put calipers on the part. It’s the question from Who Verifies the Verifier? , one level down the stack.
Composer ran javap -c in all three source runs as well (two printed 80 lines, one printed five), and it probed the library every time. One Composer run read the source and still called c with the longs swapped. It decided that “the jar output is different from the source” until it compiled the source itself and got the same wrong ticket. GPT-5.6 Sol went the other way. It trusted the source it read and never ran javap or a probe. Every source endpoint passed the grader too.
The bytecode was the cheap part
I measured each view the agents printed, using OpenAI’s o200k tokenizer for scale. A script in the kit reproduces these:
| What the agent printed | Characters | Tokens |
|---|---|---|
javap -public (signatures) | 214 | 49 |
javap -c, first 80 lines | 2,970 | 908 |
javap -public -s -c | 5,623 | 1,762 |
javap -c -p -constants | 10,368 | 3,251 |
TicketKit.java source | 2,128 | 666 |
The bytecode is about five times the size of the source it came from. Next to a run it’s small: the jar-only runs used 199,194 to 461,930 tokens each, and most of that is the conversation re-read from cache on every turn. Between the two workspaces, the gap depended on the model:
| Model | Jar-only mean tokens | Source mean tokens | Jar-only mean time | Source mean time |
|---|---|---|---|---|
| Claude Opus 5.5 | 238,855 | 261,478 | 79 s | 77 s |
| Composer 2.5 | 260,100 | 209,857 | 50 s | 49 s |
| GPT-5.6 Sol | 338,110 | 284,492 | 75 s | 66 s |
Without the source, Composer and GPT-5.6 Sol used about 50,000 more tokens on average. Opus used about 23,000 fewer; in the source workspace it read the source and disassembled the JAR anyway. The spread inside each group was wider than those gaps (GPT-5.6 Sol’s three jar-only runs ranged from 212,334 to 461,930), and output tokens, the part the model writes, barely moved for any model. Each run took between 44 and 100 seconds.
Where the bill would grow
A few limits, and then I’ll stop hedging. This is one 2.6 KB class, and a real library can have hundreds; an agent that has to search a dependency tree pays for every class it prints. The task handed the agents one known-good response, and that example did a lot of the work: it let Composer find the argument order by brute force and let every model confirm what it read. Three runs per cell is a small sample from one harness. Each provider also counts tokens its own way (Opus reports nearly all of its tokens as cache reads and writes, Composer as plain input), so compare the two workspaces within a model, not one model against another.
Published libraries are a different job, and that’s where James’s experience fits. His javadocs.dev MCP server
gives agents tools to “resolve Maven Central versions, list and read Javadoc/Scaladoc, and read library source,” and his own evals showed it using “Almost 5x fewer tokens than the default web tools
.” My JAR has no Maven Central page, so a docs server couldn’t have helped here. When the documentation doesn’t exist, javap is what’s left, and it ships with the JDK.
Everything is public on GitHub now. jar-decompile-experiment holds the kit and grader along with the evidence from all 18 runs, and jar-only-agent-starter is the workspace exactly as the jar-only agents got it. (With the source public, a rerun is only blind if the agent can’t search the web.)
I asked to see the run. In 18 of them, the deepest any agent dug was javap -c.