fgforrest/jdwp-debugging
Java JDWP debugger via MCP — set breakpoints, inspect runtime state, evaluate expressions, mutate variables, catch exceptions at throw site, trace execution with logpoints.
Changelog
All notable changes to the jdwp-debugging plugin are documented in this file.
The format follows Keep a Changelog, and this project adheres to Semantic Versioning.
[2.14.0] — 2026-11-23
New — method calls are interpreted over JDI when javac's choice is provable (#77)
In 2.13.0 an expression with a method call, such as store.map.size() or
session.getRole() on a package-private class, was still compiled, injected and
invoked. That cost 229 JDWP round trips (about 65 ms) on first use, and a private
method failed as "not visible". Now the interpreter runs such a call itself as a JDI
invocation: 27 round trips (about 2.5 ms) for a first evaluation, 12 (about 1.3 ms)
for a repeat. Private and package-private methods are reachable.
- Only when javac's choice is provable — the receiver's static type has exactly one Java member of that name and arity, it is applicable to the arguments, and it is neither varargs nor generic. Same-arity overloads, varargs, generic methods and lambdas compile as before. Runtime types never select a method.
- Also interpreted:
- constructors of initialized, concrete top-level or static classes;
- boxing;
- object and
float/doubleconcatenation; super.m();- pattern
instanceofwhere javac accepts it (an unconditional pattern only on a Java 21 target).
- Java semantics kept:
- String constants are interned in the target, so
==inside called code behaves as in javac. - Erased generic results get Java's cast check.
- A constant that folds a
floatordoublecompiles, because its text depends on the JDK that compiles it.
- String constants are interned in the target, so
- A call never runs twice — every decision to compile is made before the first call, and all frame values are read before it.
- Invocation rules as in the compiled path — tool evaluations run in the bounded
invocation job (20 s,
[STILL_RUNNING]) with one invocation lease. Conditions and logpoints take one lease on the event dispatcher. A manual hold, a bystander or a thread blocked on a monitor is refused as before. - Known limitation — under a breakpoint that suspends only its own thread, an object a call returns can, rarely, be garbage-collected before the debugger pins it. The evaluation then fails with a message that says how many target calls already ran. A stop-all breakpoint closes this window.
New — blocks with locals, if/else and return are interpreted (#79)
Block mode ({ ...; return X; }) was always compiled. Now the interpreter runs a block
with these statements:
- local declarations, typed or
var; - assignments to those locals;
- calls under the rules above;
if/elseand nested blocks;return.
The planner checks the whole block before anything runs: scope, definite assignment, reachability and return types. A block that javac would reject never yields a value.
- Leases — a block without calls takes no lease and works on manual holds and blocked threads. A block with a call anywhere needs a thread that can run code and takes one lease, even when that call sits in a branch that does not run.
- What still compiles — the whole block goes to the compiler for:
- loops,
try,switch,throw, lambdas and local classes; - writes to fields, array elements or frame locals;
- conditions whose definite-assignment rules the planner does not model.
- loops,
New — the classpath is read without invoking target code, and only when a compile needs it (#76)
Classpath discovery for compiled evaluation invoked target code, such as
System.getProperty, getContextClassLoader and URLClassLoader.getURLs. The event
dispatcher ran it at every connection's first suspending stop: about a dozen
invocations, each resuming the thread, although most expressions are now interpreted.
The first stop now costs 5 round trips and no invocation, where it cost 98 round trips
and 12 invocations.
- Read through JDWP and fields — the launch classpath comes from JDWP
ClassPaths, and loader URLs from JDI field reads. The walk covers the context class loader and the defining loader of the frame being evaluated. A later frame with a new loader extends it. - On demand — discovery runs at the first compiled evaluation or fast-probe arming compile, not at the first stop. Local Maven discovery still starts at attach.
- Two guarded invocations remain:
- The public
URLClassLoader.getURLs(), or an override such as Tomcat's, runs for a loader whose fields do not give its URLs. - An overridden
getContextClassLoader()is invoked only by a tool evaluation, in a bounded job. Conditions and logpoints never invoke it, andjdwp_diagnoseshows the lookup as pending.
- The public
- Incomplete reads are not cached — a failed or partial loader read is retried on
the next compile.
jdwp_diagnoseand missing-type compile errors name it. - One difference —
java.class.pathis the value captured when the JDWP agent started. The previous code read it at the first stop.
New — compiled expressions reach private members through reflection (#78)
A private member inside code the interpreter does not run, such as a loop, try, a
lambda or a switch, failed with an ECJ "not visible" error. When ECJ reports only
access errors, ordinary compiled evaluation on JDK 17 and 21 now rewrites those sites
into reflective field reads, calls and constructors, and compiles again. The rewrite
only does what javac's code would do; otherwise the original diagnostic stands.
- Kept exact:
- values keep their declared types;
- a type-qualified constant is inlined without initializing its class;
- a reflected constructor initializes its class before evaluating its arguments;
- receiver and argument order is kept;
- a target exception reads as itself;
- a null receiver throws an NPE that names the member.
- Still limited:
- writes to private fields;
- inaccessible type names and result types;
- expression-qualified constants;
- private method references;
- constructors that need an enclosing instance;
- closed JDK packages such as
String.value, which add a module note.
- Fast probes unchanged — fast logpoints, fast breakpoints, their arming hits and their captures keep Java access rules.
New — test flight #11 The Missing Pickup (#75)
The sandbox has an eleventh flight: The Missing Pickup, moderate, par 3. The sandbox
README, AGENTS.md and the scorecards count eleven flights and 33 stars.
Docs
- The
java-debugskill covers interpreted calls and blocks, field paths through package-private classes in other packages, and the compiled reflection retry. docs/expression-evaluation.mdand the troubleshooting reference describe which expressions and blocks are interpreted, which compile, and why.
[2.13.0] — 2026-11-22
New — expressions that only read are interpreted over JDI, without compiling or invoking
Every expression used to be compiled, injected into the target and invoked. A first
evaluation cost 229 JDWP round trips (about 65 ms), and every one needed a thread
that could run code. So a private field such as store.map, a condition on a thread
held by jdwp_suspend_thread, or a read on a thread blocked on a monitor failed or
was refused. Now an expression that only reads is evaluated directly over JDI: 4
round trips (about 0.7 ms) on JDK 17 and 21, with no compile, no injected class and
no invocation. Everything else still goes to the compiled pipeline, unchanged.
- What is interpreted — locals,
thisandOuter.this, marks and event bindings ($exception); instance, static, inherited and private fields; array reads andlength; class literals and literals; operators,&&,||,?:,instanceofand casts; String concatenation of strings, integers,charandboolean; andString.length/isEmpty/equals/charAt,Enum.name/ordinal/equalsand the primitive wrappers' value accessors. - Where —
jdwp_evaluate_expression,jdwp_assert_expression,jdwp_evaluate_watchers, breakpoint conditions and logpoint expressions. Replies keep their shape. Fast logpoints and fast breakpoints keep the compiled engine. - What goes to the compiler — method calls,
new, lambdas, blocks and loops,float/doubleconcatenation, a class that is not initialized yet, and type names the interpreter cannot bind for certain. Method calls are planned for a later release. - Type names — expressions see no imports. A simple type name is interpreted when
it names the current class, an enclosing class, one of their nested types, or a
java.langclass. Write other application types fully qualified (com.acme.Status.ACTIVE, notStatus.ACTIVE); the compiled path has no imports either. Thejava-debugskill says so. - A switch — set
JDWP_EVAL_ENGINE=compilerin the server environment to get exactly the previous behaviour, orinterpreterto see why an expression is not interpreted.jdwp_diagnosecounts evaluations per engine and lists the most frequent reasons for compiling. - A read never mixes states — if the thread is resumed while the interpreter reads, the result is discarded instead of combining values from before and after.
New — wait for one thread's next stop; a step can wait for its landing (#60)
jdwp_resume_until_event(threadId=T)releases only what holds thread T and presents T's oldest unseen stop. Other threads' stops stay held, and the reply counts them. Real blockers, such as another thread's unseen stop-all, are refused and named.jdwp_step_over/step_into/step_outtakewait=trueand block up to 30 s for the stop that ended this very step: its landing, or the stop that interrupted it. On timeout the step stays pending, and the reply says how to continue.- Thread IDs from an earlier connection are refused with
[CONNECTION_CHANGED]instead of reaching a reused ID in the new JVM. Thread lookups also find virtual threads that the VM's thread list omits. - A JVM that exits during the wait gives
[VM_DEATH]naming the stop it had captured.
Without threadId and wait, both tools behave as before.
New — a fast breakpoint can capture values when its condition holds (#62)
A fast breakpoint evaluates its condition in the target, but by the time the agent
reads values, other threads may have changed them. jdwp_set_fast_breakpoint now
takes an optional capture expression. The probe evaluates it on the same thread, in
the same pass as the condition, and every stop reply shows Captured at the hit: ….
It also appears in jdwp_get_breakpoint_context and the event history. A capture that
fails to compile or throws never prevents the stop; the reply says
capture failed: …. The risk briefing names the capture, and a standing approval
covers it.
New — a fast probe's approval covers later JVMs on the same host:port (#61)
jdwp_set_fast_logpoint and jdwp_set_fast_breakpoint used to ask again on every
new JVM, so re-running a test repeated the consent for an identical probe. An
approved call now creates a standing approval for that exact probe at that endpoint.
A later call with the same arguments arms without asking, and the reply says which
approval it used. Approvals last as long as the MCP server process and are never
saved. jdwp_overview lists them. The briefing says up front what an approval
covers. jdwp_restore_fast_logpoints still asks every time.
- What must match — the kind, class, line, expression, condition, suspend policy,
stop mode,
forceLoad, and a fast logpoint's buffer size. - Endpoints —
localhost,127.0.0.1and::1count as one. An approved call on a different endpoint from the one its briefing named gets a fresh briefing instead. - Class names — fast tools accept exact JVM binary names and reject wildcards.
New — agents can tell a fresh test JVM from a leftover one
JDWP with server=y listens again after a detach, so the next attach could silently
land on a test JVM left over from the previous run.
jdwp_wait_for_attach(requireVmStart=true)accepts only a JVM parked at its start. Anything else gets[NOT_FRESH]: the tool detaches and leaves that JVM running.- Target identity — attach, reconnect and disconnect replies name the local
target process: PID, start time, uptime and command. Only a verified target comes
with
killadvice. The command shows the main class or JAR, never application arguments. - Between test runs — the skill and the sandbox rules no longer recommend
jdwp_reset. Disconnect, make sure the old test JVM has ended, launch the next test, and attach withrequireVmStart=true. The sandbox requires plugin 2.13.0 or later. - Exception filters —
jdwp_set_exception_breakpointtakes aconditionwith$exception. Both exception tools take opt-in throw-site filters:thrownIn(one class pattern) andnotThrownIn(comma-separated exclusions). - Logpoint values — boxed primitives show as values. Other objects show as
Object (type)instead of anObject#Nthat could not be looked up. - Step replies — they name the thread the step released and what still holds the others, including stop-alls over virtual threads on JDK 21.
Fixed — local classpath discovery no longer freezes the target (#63)
The first breakpoint condition, logpoint or fast-probe arming on a connection ran
local classpath discovery on the thread that processes JDI events. With a pom.xml
in the project, that is mvn dependency:build-classpath, which can take up to
180 s. No other stop was processed meanwhile, and a stop-all breakpoint froze the
whole target. Discovery now starts in the background at attach. Breakpoints never
wait for it; tool evaluations wait for it, bounded by the Maven timeout.
- Discovery belongs to its connection — disconnect, VM exit and a failed reconnect cancel it, and a superseded result is never used.
- No leftover Maven processes — on Linux, Maven runs in its own process group, and cancelling kills the whole group.
- Nothing is written into the project — Maven writes its classpath files to a
private directory, which is deleted afterwards. Before, it wrote them into each
module's
target, and a module the cleanup walk missed (deeply nested, symlinked, outside the working directory) lost its classpath entries silently and kept the file. - A typo is not deferred — when a type is missing and discovery has finished, the compile is retried at once with the local classpath, so a misspelled name fails at once instead of waiting for a later hit.
- Clearer failures —
jdwp_diagnoseand evaluation errors say when discovery is still running or failed. A Maven that cannot be started (exit codes 126 and 127) is explained.
Fixed — a failed resume is reported, never shown as released (#68)
When JDI's resume() threw, the session had already dropped its hold. The thread
stayed suspended in the target, the reply said it was released, and no later call
could free it. Each release now completes only after the resume succeeded. A hold
whose resume failed stays owned and can be retried.
jdwp_resume,jdwp_resume_threadandjdwp_resetlist what was released, what failed and why, and what a retry recovered.jdwp_resume_until_eventends with[RESUME_FAILED]naming each affected thread. It points tojdwp_resume_thread, and warns thatjdwp_resumereleases every other hold too.- A reset that lost the connection says so and asks to reattach.
Docs
AGENTS.mdnow holds the project instructions, which Codex reads.CLAUDE.mdimports it.- The
java-debugskill covers the new tool parameters, writing application types fully qualified in expressions, and the new steps between test runs.
[2.12.1] — 2026-11-21
Fixed — under Codex, the server JAR survives Codex reinstalling the plugin (#58)
The Codex launcher prepared the server JAR inside the installed plugin, in
jdwp-mcp-server/target. Codex replaces those files when it reinstalls the plugin,
even at the same version: right after codex plugin add, the first session's
marketplace sync did so, and the JAR the launcher had just downloaded was gone. A
fresh install took three sessions to get the tools. The launcher now keeps the JAR in
server/ in the plugin's data directory, which Codex leaves alone. A download goes
straight there, and a Maven build is copied there. A reinstall of the same revision
finds the JAR in place; only a new version or changed sources prepare a new one.
Claude Code is unchanged.
Docs — help when jdwp-inspector does not connect; AGENTS.md in the sandbox zip
- README has a new section, "When
jdwp-inspectordoes not connect". After an install or update it can take more than one reconnect:/mcpin Claude Code, a new session in Codex. You can also ask the agent to find out why. - The
java-debugskill explains what to do when thejdwp_*tools are missing: where the JAR and the logs are, how to check Java, how to rerun the JAR preparation by hand, and when to ask the user to reconnect. The skill is installed even when the server is not connected, so it can help exactly then. - The sandbox zip carries the house rules in
AGENTS.md, which Codex reads.CLAUDE.mdimports it, so Claude Code loads the same rules. The sandbox README covers Codex. The rules now say thatjdwp_assert_expressionreturnsOK, notMATCH.
[2.12.0] — 2026-11-21
New — the plugin installs and works in Codex (#55)
Codex already read the plugin's marketplace, but jdwp-inspector could not start
there: Codex does not expand ${CLAUDE_PLUGIN_ROOT}. The repository now also carries
the portable Agent Plugins manifest (plugin.json + mcp.json at its root), which
Codex prefers, so codex plugin marketplace add FgForrest/mcp-jdwp-java and
codex plugin add jdwp-debugging@mcp-jdwp-java install the same java-debug skill
and server. Claude Code reads neither file; its install is unchanged.
- A launcher gets the JAR. Codex runs no hook before it starts a plugin's server,
so
scripts/jdwp-inspector.shprepares the JAR first: it downloads this release'smcp-jdwp-java-<version>.jarwhen the installed server sources are the ones tagged for the release, and builds it with Maven otherwise. The preparation runs in a session of its own, so a download or build that outlasts Codex's startup wait still finishes, and the next session finds the JAR. - The project directory comes from Codex. Codex starts plugin servers in the
plugin's directory. The server now asks Codex for its sandbox state, receives the
session directory with every tool call, and scans that directory for the local
project classpath;
jdwp_diagnoseshows it. Under Claude Code the server's working directory is used, as before.
Docs — the README tells the truth again
- Security & trust no longer claims that no pre-built binaries are distributed or that nothing touches the network: releases ship the server JAR, the build fetches Maven and dependencies, and the first expression evaluation can run Maven in the project. It also says that only fast logpoints and fast breakpoints rewrite the application's bytecode, and only after the user agrees.
- Install names the Claude Code and the Codex plugin, and the manual registration
covers Codex (
codex mcp add,startup_timeout_sec,tool_timeout_sec). - Timeouts. The README told users to put
MCP_TIMEOUTandMCP_TOOL_TIMEOUTinto the server'senv. Claude Code reads both from its own environment only, so that did nothing; the plugin's ownenventry is gone for the same reason. Claude Code waits 30 s for the server to start by default, enough for this server. - Logpoints no longer claim they never suspend: each hit pauses the hitting thread while the server evaluates, which is why fast logpoints exist. The TL;DR now lists fast logpoints and fast breakpoints.
- Reference fixes: missing
forceLoadandexcludeConstructorsparameters in the tool table, 50 tools instead of 47,jdwp_evaluate_expression/jdwp_assert_expressionreply formats, a 500-entry event history instead of 100, and an architecture section and project tree that include suspension ownership, the fast-probe package and the client workspace.
[2.11.2] — 2026-11-14
Fixed — exception breakpoints set at VM start work; the docs said they did not
The java-debug skill claimed that an exception breakpoint on a JDK class stays
[PENDING] until a tool runs at a real breakpoint, and that jdwp_set_exception_breakpoint
cannot work at VM start. The same skill told agents to set an AssertionError breakpoint
in the attach prologue, which is exactly VM start. Checked live: the claim was wrong, the
server was right. Every class loaded after the attach — JDK classes included — reports
its load, so a pending exception breakpoint activates when its class loads, before the
first instance can be thrown. An AssertionError breakpoint set at VM start stops on
the first failing JUnit assertion with no other breakpoint. Line breakpoints,
logpoints and field breakpoints set at VM start defer and fire the same way.
- Skill, README and developer docs now say so. The "exception buried under wrappers" recipe no longer asks for an upstream line breakpoint to promote the exception breakpoint (it never did). The "where did the assertion fail" recipe shows where the test's own locals are: a few frames below the assertion library's throw site.
- The exception tools' descriptions no longer send agents to
forceLoad=truefor JDK exception types.jdwp_set_exception_breakpoint'sforceLoadparameter claimed that the load of a JDK class is never reported and that the deferred path "will never activate";jdwp_set_exception_breakpointandjdwp_set_exception_logpointtold agents to passforceLoad=truefor an exception class the application "hasn't referenced yet", and the logpoint'sforceLoadcalled itself useful for such classes. Both tools now say that a class not loaded yet — JDK exception types included — is waited for, and thatforceLoad=trueonly binds it at once and is not possible at VM start. - README examples of
jdwp_set_exception_breakpoint/jdwp_set_exception_logpointpassedexceptionClass=; the parameter isclassName.
Fixed — forceLoad=true says when it could not load the class
At VM start no thread can run Class.forName, so forceLoad=true cannot load anything
and the breakpoint is deferred instead. Line breakpoints, logpoints, exception and field
breakpoints said only "Class not yet loaded", as if forceLoad had not been passed. Their
reply now carries the same note as the fast probes: forceLoad=true could not load it,
and why.
[2.11.1] — 2026-10-31
Fixed — fast probes wait for their class and keep their hits at exit
The 2.11.0 test flights showed two ways a fast logpoint or fast breakpoint lost its work (#48). One set before its class was loaded was refused, so a test that loads the class late could not be probed from the start. And the hits still in the in-target ring buffer when the target exited were lost — the usual end of a test run. Both now behave as you would expect.
- Probes wait for their class — set before the class loads, a fast logpoint or
fast breakpoint registers as waiting (
WAITING_FOR_CLASSinjdwp_overview) and arms when the class loads, keeping its ID. - Hits are read at the target's exit — while a probe is armed, the debugger holds
the target at VM death until every ring buffer is drained, also when it ends through
System.exit(a forked test JVM). The[VM_DEATH]reply says what the run recorded and how often each field breakpoint fired, and notes that a field breakpoint does not see writes made through reflection orUnsafe. jdwp_resetcounts what it releases, includingjdwp_suspend_threadholds, andjdwp_reset/jdwp_disconnectsay so when the target has already exited.
Fixed — stops and replies say what happened
The test flights also showed replies that left the agent guessing (#50).
- Exception stops name the exception's type and message, and
jdwp_set_exception_breakpointtakessuspendPolicy(thread|all) —allkeeps a test's other threads from running on to its timeout. - Field-breakpoint stops are labelled as such and show the access site and the old and new value; field logpoint entries show them too.
- A stop names the logpoint hits recorded since the last
jdwp_get_events. jdwp_evaluate_expressionaccepts code that throws checked exceptions and unqualified calls to the frame's own methods, defaults to the current stop's thread, and lists each compile error once, with the offending code.- Stacks collapse JDK frames inside the test harness, and a thread waiting to enter
a
synchronizedblock shows that line (HotSpot reports the next one).jdwp_dump_lockslists threads inObject.wait()apart from the lock graph.
Fixed — races between stops, frame tools and evaluations
The follow-ups of the 2.11.0 review (#47), and three races the new tests for them found.
- Each fast-breakpoint stop keeps its own reason, also when two threads stop at the same probe at once.
- A frame tool and an evaluation never overlap — an evaluation waits while a tool
reads its thread's frames, and a frame tool re-reads invalidated frames only while a
published stop or a
jdwp_suspend_threadhold keeps the thread at its stop, so it can no longer write into the frame of the thread's next stop. - The watchdog times each invocation in the target rather than the whole evaluation, and now also frees an evaluation that JDWP reports as running while it waits for a monitor.
- Clearing a fast logpoint waits briefly for hits a probe is still writing, so they reach the last read instead of being dropped.
Fixed — the plugin installs where ./mvnw cannot run
The SessionStart hook builds the server JAR with ./mvnw, then mvn -o, then mvn,
and says what to do when all three fail (#51). The jdwp-inspector server is now
declared in .claude-plugin/plugin.json; the root .mcp.json is gone. After a build at
session start, reconnect jdwp-inspector in /mcp if its tools are missing.
Docs — test flights are puzzles again
Flights #5, #8 and #10 match what the tools do, and the scoring rule is written down (#49). No flight gives its answer away: test comments, class Javadocs and the README hint lines no longer name the root cause. Flight #5 (par 3) teaches the field-watchpoint blind spot. The sandbox zip needs plugin 2.11.1 or newer.
[2.11.0] — 2026-10-30
New — fast logpoints and fast breakpoints: conditions evaluated inside the target JVM
A logpoint or conditional breakpoint on a hot line goes through the debugger on every
pass — milliseconds each — which slows a busy application to a crawl and makes the
very races it should catch disappear. Two new tools move that work into the target:
jdwp_set_fast_logpoint (#40) and jdwp_set_fast_breakpoint (#42) compile a small
probe class, define it in the declaring class's loader and redefine the method to call
it, so hits that don't matter never involve the debugger. Both rewrite the
application's bytecode, so neither arms anything without userApproved=true; without
it they return a risk briefing to relay to the user.
jdwp_set_fast_logpoint— evaluates the expression (and an optional condition) in the target and appends each hit to an in-target ring buffer thatjdwp_get_eventsdrains with plain field reads.jdwp_set_fast_breakpoint— evaluates the condition in the target; when it holds, the probe calls an emptystop()method that carries an ordinary breakpoint with the requested suspend policy, so the user's method stays JIT-compiled. It stops once per generation (call the tool again to re-arm) or on every hit; a condition that fails stops once.- Safe restore — clear,
jdwp_reset, disconnect, reconnect and shutdown restore the original bytecode. Arming is refused when the live bytecode differs from the class file (another agent changed it). A method in which a stopped thread has a frame is never redefined: arming waits, and a clear restores the class once that thread is released. - Leftovers of a dead server — the next attach lists the fast logpoints and fast
breakpoints a crashed server left behind; clearing switches them off, and
jdwp_restore_fast_logpointsrestores their class only with the user's approval. - Fast stops look like your code — probe frames are hidden from every frame index, steps never enter probe classes, and watchers attach to fast breakpoints.
- Test flight #10 "The Oversold House" — a highly concurrent sandbox target for both tools.
Fixed — no more hangs or lost stops when events and evaluations overlap
Conditions, logpoint expressions and evaluations invoke code in the target. A breakpoint hit inside that code, or a stop-all breakpoint on another thread, could freeze the invocation and the debugger with it (#43), and a resume could release a stop nobody had seen yet (#44). Every suspension the debugger causes now has exactly one owner, which alone releases it (#45).
- The event queue is always drained — the listener only drains and routes; event sets are processed in order on a dispatcher thread, and a set raised inside an evaluation is suppressed at once.
- Each stop is held in its own context —
jdwp_resumereleases only the stops a tool has shown (plusjdwp_suspend_threadholds);jdwp_resume_until_eventpresents an unseen stop first instead of resuming past it; steps are atomic. - Evaluations are leased and bounded — a thread the debugger invokes on is exempt
from other threads' stop-all events. A tool's invocation waits at most 20 s, then
answers
[STILL_RUNNING]and records the late result asEVALUATION_COMPLETED_LATE. A watchdog frees a condition or logpoint evaluation stuck on a monitor that a queued stop's thread holds. - Objects the debugger creates in the target are pinned from the moment they exist; a garbage collection in between surfaced as a spurious "condition failed".
Follow-ups are tracked in #47.
[2.10.1] — 2026-07-11
Fixed — locals survive missing debug info, and attach/error messages stop lying
Two diagnostics defects predating 2.10.0, found while revalidating the 2.10.0 fixes.
jdwp_get_locals returned the opaque Error: null — discarding even the this
receiver it had already resolved — whenever the current method was compiled without a
local-variable table (-g:vars), because the underlying AbsentInformationException
carries no message. Separately, jdwp_wait_for_attach labelled an already-connected
session as "suspended at VM_START", which is actively misleading after a same-port
target restart, where the fast-path can hand back a stale handle.
jdwp_get_localsdegrades gracefully — a missingLocalVariableTablenow keeps thethisline and appends a frame-tailored hint (instance frames point at the receiver andjdwp_get_fields; static frames say there is no receiver) instead of replacing the whole response withError: null.- No more
Error: nullor bareError:— tool error replies now fall back to the exception's simple class name when the detail message is null or blank (~35 catch sites acrossJDWPToolsandJDIConnectionService). jdwp_wait_for_attachis honest about already-connected sessions — theVM_STARTguidance is emitted only on a genuine fresh attach; a pre-existing session is described as such and points atjdwp_diagnose/jdwp_disconnectfor the same-port-restart recovery path.
Follow-up defects tracked in #36; the two deferred items there (attach PID-identity race, off-classpath expression-eval diagnostics) remain open.
[2.10.0] — 2026-07-11
Fixed — exception breakpoints no longer NPE, and broken conditions fail loud
jdwp_set_exception_breakpoint and jdwp_set_exception_logpoint could fail with
the opaque Cannot invoke "Object.hashCode()" because "key" is null and leave
null-named pending entries behind — whenever the exception class name arrived
null. A null class took the deferred "class not loaded" path and then reached
ConcurrentHashMap.containsKey(null). The class argument now short-circuits with a
clear error before any registry or VM work, and — see Breaking below — the tools
accept the class under the same className parameter the other breakpoint tools
use, so a client that reuses className everywhere binds correctly instead of
dropping the value to null. Resolves #34.
Separately, a breakpoint / logpoint / field-watchpoint condition that failed to
compile or threw at runtime used to suspend on every hit while only logging
server-side — so an agent could believe it was filtering when it was not (most
often a private-field reference, which the bare-field auto-rewrite cannot touch).
Such failures now record a CONDITION_ERROR event, making the fall-open decision
visible in jdwp_get_events / jdwp_resume_until_event.
- Fail-fast class guard — a null or blank class name returns
Error: className is required …instead of an NPE, leaving the breakpoint registry untouched. - Loud, not silent, fail-open — conditions still suspend on evaluation failure
(so nothing is missed), but each failure emits a
CONDITION_ERRORevent naming the breakpoint, location, condition, and cause. Thejava-debugskill now documents thegetDeclaredField/setAccessibleblock-form workaround for private-field conditions.
Breaking — exception-tool class parameter renamed to className
jdwp_set_exception_breakpoint and jdwp_set_exception_logpoint previously named
their class argument exceptionClass; it is now className, consistent with
jdwp_set_breakpoint and jdwp_set_field_breakpoint. Clients that read the tool
schema on each call (all LLM-driven clients) adapt automatically; only a caller
hard-coded to send exceptionClass= needs updating. This naming inconsistency was
the root cause of the null-class NPE fixed above.
[2.9.0] — 2026-05-28
New — expression evaluation resolves types the remote classpath can't see
Every evaluated expression, logpoint, conditional breakpoint and watcher is
compiled against the target VM's classpath, which the server discovers by walking
the live classloader hierarchy. That walk is the source of truth, but it does not
see everything: Tomcat's webapp loader, Spring Boot's dev-tools restart loader, and
hand-rolled URLClassLoaders routinely hide their JARs from getURLs(). When that
happened, evaluation failed with a bare X cannot be resolved and no way forward.
The server now augments the remote classpath with a local-project classpath
computed from the machine the MCP server runs on, filling exactly those gaps.
Resolves #32.
- Three additive sources — the
JDWP_EXTRA_CLASSPATHenvironment variable (verbatim entries you control), a depth-bounded filesystem scan fortarget/classes/target/test-classesunder the server's working directory, and Mavendependency:build-classpathfor eachpom.xmlit finds. The result is unioned remote-first, so live target-VM types always win resolution and local entries only fill what the remote walk missed. - Never blocks the debugger — the cold-cache Maven resolution (which can take
1–3 minutes on a fresh
~/.m2) is never paid on the JDI event thread. The first breakpoint warms only the fast remote discovery; the local fallback, including Maven, is resolved lazily on your first actual evaluation and memoized for the rest of the connection. - Inspectable via
jdwp_diagnose— a new "Local project classpath" section reports the working directory, whether apom.xmlwas found, a per-source entry breakdown, and the three-wayJDWP_EXTRA_CLASSPATHstate (unset/set, no entries/set). The diagnose path is non-blocking — it peeks the cache and never triggers discovery. - Disable it by launching the server from a directory with no
pom.xmland notarget/classes, and leavingJDWP_EXTRA_CLASSPATHunset — the merged classpath is then identical to the remote-discovered one.
Fixed — file-safety and cleanup hardening
The new discovery paths touch the filesystem and shell out to Maven, so they are
held to a strict safety contract: no file is ever deleted or moved, Maven output
stays under its own target/ directory, and symlinks are never followed by either
the filesystem scan or the Maven-output harvester (a symlinked target/, pom.xml
or wrapper script is rejected rather than traversed outside the project tree).
- Leak-proof Maven subprocess — a timed-out or interrupted Maven run forcibly destroys the whole process tree it owns (never unrelated siblings), and the wait for the tree to exit is bounded for the tree as a whole rather than per-process.
- Robust under restricted environments — descendant-process enumeration,
unreadable directories, and an unset
user.dirare all tolerated without aborting discovery or failing server startup.
[2.8.2] — 2026-05-26
Fixed — expression evaluation no longer stalls or misleads after a reconnect
Every evaluated expression, logpoint, conditional breakpoint and watcher compiles
against the target VM's classpath, which the server discovers once per connection
and caches. Three rough edges in that lifecycle made failures slow and confusing —
most visibly after a disconnect/reconnect cycle, where the first evaluation could
fail with a cryptic io cannot be resolved and no hint as to why. The warming,
caching and failure-reporting paths are now tightened.
- First stop pre-warms the classpath — the one-time discovery (it walks the
target's classloader hierarchy and can take 1–3 s) now runs on the first
suspending breakpoint / step / exception / watchpoint instead of lazily on your
first
jdwp_evaluate_expressionor logpoint hit. The cost is paid predictably at the first stop rather than on the critical path of the first evaluation. - Reconnect no longer compiles against the old target — the compiler's classpath is reset on reconnect. Previously a failed re-discovery left the previous target's classpath in place, so expressions could silently compile against stale classes.
- Discovery failures say so — when the classpath / JDK can't be discovered, the
evaluation now fails with an actionable message ("Classpath discovery failed …
application types cannot be resolved") instead of surfacing a bare JDT diagnostic
like
io cannot be resolved. Logpoints record the same as aLOGPOINT_ERROR. (resolves #30)
Docs — README rewritten newbie-first
- README restructured for first-time readers — reordered to lead with what the plugin is and how to attach to a JVM before the deeper material, and fact-checked against the source so the tool list and behavior descriptions match what ships.
[2.8.1] — 2026-05-25
Fixed — straight answers when evaluation can't see what it needs
Two paths returned dead-ends that steered agents the wrong way.
jdwp_resume_until_event could wake without a stop and flatly blame a concurrent
jdwp_reset / jdwp_disconnect — telling you to re-arm breakpoints that were, in
fact, still armed on a live VM. And any expression evaluated on a stack frame from
a target compiled without a local-variable table failed with the opaque
Expression evaluation failed: null, even when the expression touched no locals at
all — the common case for field logpoints using only $oldValue / $newValue.
Both now do the check they were skipping.
[NO_EVENT]checks before it advises — the no-stop branch now probes VM liveness and the breakpoint registry. If the VM is alive with breakpoints still armed, it says so and tells you to simply call again (do not re-arm); only a genuinely cleared session gets the re-setup guidance.[NO_EVENT]is now also listed in the tool's documented return values. (resolves #27)- Expressions evaluate without a local-variable table — a frame from a target
built without
-g:vars(plainjavac,-g:none, or a stripped release) no longer aborts the whole evaluation. Locals are skipped when absent and the expression runs againstthis+ the synthetic bindings; an expression that does name a missing local now gets a clear "cannot be resolved" compile error instead ofnull. (resolves #29)
Docs — field watchpoints: what they catch, honestly
- Reflective writes are not caught — corrected —
docs/breakpoints.mdclaimed a reflectiveField.set/Unsafewrite was "fully visible to a watchpoint", contradicting the java-debug skill and the JVM itself. Verified live on JDK 17: a modification watchpoint fires on constructor and direct assignments but stays silent on a reflectiveField.setof the same field. The docs now say so, drop a test-flight spoiler, and add the reference-vs-contents distinction — a watchpoint fires on the field's slot, not on in-place mutation of the object it references. (resolves #28)
[2.8.0] — 2026-05-25
Fixed — disconnect no longer wipes your session in silence
The session-epoch work in 2.7.0 made the event log segment cleanly across a
VM restart, but the teardown tools themselves stayed mute about what they threw
away. jdwp_disconnect returned a bare "Disconnected" while it silently
cleared every breakpoint, watcher, mark, the object cache and the event
history; jdwp_connect switching to a different target tore down the prior
session just as quietly. An agent that had armed a dozen breakpoints got no
signal they had vanished. jdwp_reset and jdwp_reconnect already itemize what
they touch — this brings disconnect and connect up to the same parity.
jdwp_disconnectnow reports what it cleared — an itemized summary (breakpoints by kind, watchers, marks, event history, object cache) instead of one word. Counts are snapshotted before the wipe, so they reflect what the call actually discarded.- A reconnect hint, only when it matters — when breakpoints or watchers were
cleared, the reply points at
jdwp_reconnect(re-attach to the same target, specs preserved) as the way to keep them across a VM restart. A bookkeeping disconnect with nothing set stays a terse one-liner — token-optimized. jdwp_connectannounces a target switch — attaching to a differenthost:portnow prepends a one-line "released previous session — N breakpoint(s), M watcher(s) cleared" notice, with the same reconnect pointer. (resolves #25)
[2.7.0] — 2026-05-25
New — see the lock graph, not just the threads
A 9-flight test-flight retrospective surfaced the same recurring friction:
jdwp_get_threads tells you a thread is in MONITOR status, but not what
it's blocked on or who holds the lock — so reconstructing a deadlock meant
suspending each thread and reading locals by hand. The new tool answers it in
one call, the natural sequel to 2.6.2's deadlock-inspection error message.
jdwp_dump_locks— takes a balanced VM-wide suspend/resume snapshot, reads each thread's contended monitor and its owning thread, and prints the blocked-thread table plus any deadlock cycle (e.g.transfer-A-to-B → transfer-B-to-A → …). Cycle detection is a pure, JDI-freeDeadlockAnalyzer. The suspend/resume is balanced, so a genuine deadlock stays put and a healthy VM is undisturbed; only synchronized-monitor contention shows (notObject.wait()/java.util.concurrentLocks). (resolves #23)
Fixed — a misspelled breakpoint class no longer defers in silence
A breakpoint set on a fully-qualified class name that doesn't match anything
(Config for Configuration) deferred forever, with a message
indistinguishable from a genuinely not-yet-loaded class — a silent dead end
that cost a flight ~13 wasted calls.
- Near-match class suggestions — when a breakpoint defers because its class isn't loaded, the response now scans the loaded classes for resembling names (simple-name exact/prefix match + bounded edit distance) and appends a "did you mean…" hint. Applies to line, logpoint, field, and exception breakpoints; best-effort, never fails a breakpoint set. (resolves #24)
- Length-safe event timestamps — the event listing formatted times with a
fixed
substring(11, 23)that threw on a whole-secondInstant(which prints without a fraction), collapsingjdwp_get_eventsinto an error. It now uses a length-safeHH:mm:ss.SSSformatter.
Changed — event history is now segmented by session
The jdwp_get_events log is deliberately preserved across a VM death (so the
VM_DEATH and the events leading to it stay readable), but on an auto-reconnect
to a relaunched target the old VM's events bled into the new session's stream
with no way to tell them apart.
- Session-epoch tagging — every event carries a monotonic session epoch,
bumped on each attach;
jdwp_get_eventsshows a per-lines1/s2tag and a divider at each new-VM boundary, so a death-then-reconnect reads as two clean segments without discarding the pre-death evidence. (resolves #25)
Docs
java-debugskill discoverability — a deadlock recipe built aroundjdwp_dump_locks; guidance to launch fast-finishing tests withsuspend=y+jdwp_wait_for_attachso the VM can't die before breakpoints are armed; and a note that the event log survives a VM death (usejdwp_clear_eventsto start clean). (resolves #26)
[2.6.2] — 2026-05-25
Fixed — inspecting a deadlocked thread now points the way
A thread blocked on a monitor or parked in Object.wait() that you did not
stop at a breakpoint reports Suspended: no and never halts on its own — the
classic deadlock case. jdwp_get_stack answered that with a dead-end "Thread
must be stopped at a breakpoint", and jdwp_get_locals had no suspend check at
all and leaked a raw IncompatibleThreadStateException. Both pointed away from
the one tool that actually helps: jdwp_suspend_thread, which freezes the
thread in place so its frames and locals become readable.
- Actionable not-suspended error —
jdwp_get_stackandjdwp_get_localsnow detect a MONITOR/WAIT thread that isn't JDI-suspended and namejdwp_suspend_thread(id)as the deadlock-inspection path (andget_localsgained the suspend check it was missing). The invoke-family tools (evaluate_expression/to_string/assert_expression) keep their existing guard — suspending such a thread makes it inspectable, not invocable. (resolves #22)
Docs
- Two
java-debugskill notes from a live test-flight retro — how to read a deadlocked thread (jdwp_suspend_threadit first), and the reminder thatjdwp_disconnectdoes not stop the target JVM: the JVM owns its JDWP port, so a target with live non-daemon threads keeps the port bound after you disconnect — kill the lingering process before relaunching on the same port.
[2.6.1] — 2026-05-24
Fixed — connect / diagnose no longer alias a dead VM
The liveness check behind jdwp_connect's "already connected" guard and the
jdwp_diagnose connection status probed the target with vm.name(), which JDI
caches after its first fetch — so a VM whose socket had already closed (an
orphaned test JVM left over from a previous debug session, or one mid-exit)
still read as alive. connect then short-circuited onto the stale VM and
jdwp_diagnose reported a live connection that wasn't; breakpoints never fired
and the disconnect only surfaced later.
- Round-tripping liveness probe — these two paths now issue a bounded
vm.allThreads()(a real JDWP exchange) instead of the cached name: a closed socket is detected promptly and a wedged VM is bounded by a short timeout, soconnectre-attaches to the VM you actually launched andjdwp_diagnosetells the truth. The cheap cached check stays on the per-tool-call hot path, where a false positive is harmless (the next real JDI call surfaces the disconnect). (resolves #21)
Docs
- "The Field That Lies" reads as a puzzle again — the test-flight scenario
had promised that a field-modification watchpoint catches the reflective
Field.setthat mutates the field; a flight on JDK 21 disproved it (JDI watchpoints fire on theputfieldbytecode, not on reflective /Unsafestores). The scenario no longer hands over the answer, and thejava-debugskill gained a caveat: watchpoints miss reflective /Unsafewrites regardless of finality — bisect with line breakpoints +identityHashCodeinstead.
CI
- Actions pinned to Node 24 —
actions/checkoutandactions/setup-javawere bumped past the Node 20 runtime deprecation in both the CI and release workflows.
[2.6.0] — 2026-05-24
New — tool responses now navigate to the next step
Every tool used to confirm what it did and stop; the calling agent had to already know which tool to reach for next, and a logpoint gave no hint that its output lands in the event log. An audit of the full tool surface drove a pass that makes responses self-navigating — each one now points to the sensible next tool (or says what to expect), so the set → run → read chain is visible in the output instead of being carried only by the skill.
- Logpoint confirmations point to the event log —
jdwp_set_logpoint,jdwp_set_field_logpoint, andjdwp_set_exception_logpointnow state that hits are recorded as they fire and read on demand withjdwp_get_events(logpoints never suspend and never push, so there is no "event fired" to react to). - Next-step pointers across the surface —
jdwp_resumepoints to the blockingjdwp_resume_until_event;connect/resetsay to set breakpoints then resume;set_local/set_fieldpoint to step/resume; the inspectors and watcher / mark tools point to their natural follow-ups. Hints are terse footers added only where a next step is genuinely useful — tool descriptions were left untouched to avoid a per-turn token cost. - Failure paths navigate too — a failed
jdwp_connectnow points tojdwp_diagnoseto list local JVMs and their JDWP ports.
Fixed
$newValueon field-access events — amode="both"field logpoint or condition that referenced$newValuefailed to compile on every access hit (one[FIELD_LOGPOINT_ERROR]per read), because the binding was populated only for modification events.$newValueis now bound as a typed-null on access events, so the same expression compiles on both halves and renders… -> nullon reads. (resolves #14)- Actionable
[NO_EVENT]fromjdwp_resume_until_event— when the wait was released without a real stop (a concurrentjdwp_reset/jdwp_disconnectfreeing the waiter, then nulling the snapshot), the tool returned a dead-end "this should not happen" message. It now returns an actionable[NO_EVENT]naming the likely cause and the recovery path. (resolves #15)
Docs
java-debugskill guidance — set a line breakpoint at the assertion as a safety net before a field watchpoint on short-running tests (avoids theVM_DEATHrace where the write lands but the suspend never does); set the breakpoint at thejoin()/ assertion line for concurrency flights, not right afterThread.start(); don't pipe the launch command throughtail/headin a background shell. (resolves #16)
CI
- Test gate on push and PR — a new GitHub Actions workflow runs the full
./mvnw testsuite (including the NullAway / Error Prone gate) on every push tomainand every pull request, so regressions are caught on the server rather than only at release time. (resolves #18)
[2.5.0] — 2026-05-24
New — excludeConstructors flag on field watchpoints
A field watched for modification fires on every write, including the storm of
writes that happen inside the declaring class's constructors before any
interesting state exists — debugging a balance field meant stepping past three
BankAccount constructor writes before reaching the first real mutation. Both
jdwp_set_field_breakpoint and jdwp_set_field_logpoint now take an optional
excludeConstructors flag that filters those out.
excludeConstructors=true— writes originating inside the declaring class's<init>/<clinit>are dropped at the listener: no event recorded, no chain trigger, no suspend. The watchpoint fires only on post-construction mutations. The check is a direct frame test — a method called by a constructor still counts as a real hit, so collaborators invoked during construction are not silently swallowed.
New — invocation refused on MONITOR / WAIT threads
A thread that is JDI-suspended on top of a Java-monitor block or inside
Object.wait() reports isSuspended() == true, so the existing guards let it
through — but JDI's invokeMethod then resumes only that one thread, which
cannot make progress because the lock it needs is held by another suspended
thread (or the notify() that would wake it can never fire). With no
JDI-level timeout, the MCP server blocked indefinitely. This was the failure
mode anyone debugging a deadlock would hit.
- Pre-flight guard —
jdwp_evaluate_expression,jdwp_assert_expression,jdwp_to_string, andjdwp_evaluate_watchersnow refuse a thread inTHREAD_STATUS_MONITOR/THREAD_STATUS_WAITwith an explicit error that points atjdwp_get_stack+jdwp_get_threadsinstead. The refusal turns a silent hang into a useful diagnostic — when you see it, you've usually found a deadlock or a missing notify.
Docs
- Skill prologue tightening — the
java-debugskill gained recipes for reconnecting after a target restart (jdwp_reconnectpreserves breakpoints, watchers, and chain edges across the cycle), catching the failure point of an asserting test (AssertionErrorexception breakpoint), and calling a method on a non-public peer field via a block-mode reflection snippet. Two new gotchas cover theMONITOR/WAITguard and the kill-and-reconnect recovery for the residual hang case. - Test-flight assignment prompt — the sandbox README now ships a copy-pasteable prompt that briefs the agent on the game's house rules and a par-based scoring scheme (⭐⭐⭐ at par tool count, ⭐⭐ within 2×, ⭐ solved).
Test flights — rebalanced to nine flights covering the full tool surface
The sandbox flight suite leaned heavily on field watchpoints (four of six flights), so a strong score didn't prove the agent could wield the rest of the toolset. The suite is now nine flights, each built so a different tool group is the path of least resistance, and each carries a par — the minimum tool calls that cleanly reveal the root cause — for style scoring.
- Dropped "The Vanishing Pennies" (mechanically a subset of "The Audit That
Lies"). Reshaped two flights so a single breakpoint-context dump can no
longer shortcut them: "The Swallowed Exception" now throws on a background
executor task with no user-code catch frame (forcing a
caught=trueexception breakpoint + trigger gate), and "The Time Traveler's Config" now overwrites a correctly-set field from a reaper thread (forcing a field watchpoint + event history to read the write order). - Added four flights for the under-exercised groups: The Doppelgänger Cart
(marked instances — a copy-constructor swaps the object mid-pipeline),
The Heisenbug Race (logpoints — a lost update you watch without suspending),
The Magic Patch (
set_local— confirm a fix by mutating live state), and The Polite Standoff (multi-thread inspection — a lock-ordering deadlock diagnosed withjdwp_get_threads+jdwp_get_stack, no breakpoints).
[2.4.0] — 2026-05-24
New — block-mode multi-statement expressions
Every place that takes a Java expression — jdwp_evaluate_expression,
jdwp_assert_expression, breakpoint conditions, logpoint expressions and
conditions, exception logpoints, field-watchpoint conditions/expressions, and
watchers — now also accepts a brace-wrapped statement body. Previously each
input had to be a single expression, so anything that needed an intermediate
local, a try/catch, or an early return could not be evaluated at a
breakpoint. Resolves #8.
{ …; return X; }block syntax — when the trimmed input starts with{and ends with the matching}, it is spliced into the wrapper method body verbatim instead of being wrapped as a single expression. You write your ownreturn X;to yield a value; a trailingreturn null;fallthrough guard keeps the wrapper type-correct if the block doesn't return on every path. Intermediate locals,try/catch, early returns, and loops are all available.- Literal-aware mode detection — the brace match is tokenizer-aware and
ignores braces inside string, char, and text-block literals, so
"{x}".length()still routes through expression mode while{ try { return foo(); } catch (Exception e) { return null; } }routes through block mode. - Discoverable from any eval param — all eight eval-bearing tool
methods/params carry a "supports
{ …; return X; }block syntax" suffix in their descriptions, so the feature surfaces wherever an eval-shaped parameter appears. - Auto-rewrite interaction — the bare-field
this.fieldauto-rewrite is skipped in block mode (an identifier-level rewriter cannot tell a field reference from a local declaration); block-mode users write explicitthis.field/_this.field, which the keyword rewrite still handles.
[2.3.0] — 2026-05-24
New — deferred breakpoint/logpoint install diagnostics
When a breakpoint or logpoint targets a class that has not loaded yet, or a line that compiles to more than one bytecode location, the install used to succeed silently and leave you guessing why nothing fired. Two no-behaviour-change diagnostics now make those cases visible. Resolves #9.
CLASS_PREPARErecorded in event history —jdwp_get_eventspreviously showed only[VM_START, VM_DEATH]for a session parked on a deferred breakpoint, so an agent could not tell "the class never loaded" from "the class loaded but the breakpoint never fired." The class-prepare event is now captured, making the distinction observable.- Multi-location warning — when
locationsOfLinereturns more than oneLocation(typical for lambdas: one in the enclosing method, one in the syntheticlambda$…$N), the server emits aBP_MULTI_LOCATIONevent, a WARN log, and aWARNINGsuffix on thejdwp_set_breakpoint/jdwp_set_logpointresponse. The bind logic is unchanged — it still binds the first location — so this is diagnostics only; a proper multi-location bind is tracked separately.
Fixed — expression evaluation reaches a non-public this and its package-private members
Expression evaluation always emitted its wrapper class into a fixed
mcp.jdi.evaluation package, so a non-public this type and its
package-private fields were unreachable — the this.field auto-rewrite
short-circuited on the common case (e.g. a package-private
BitmapSlicer.translator). Resolves #7.
- Wrapper emitted into
this's own package whenthisis non-public and the package is addressable (notjava.*/javax.*/sun.*/jdk.*, not a local/anonymous class). Same-package reachability then lets the wrapper dereference package-private types and members directly; the field-rewrite filter widens to public/protected/package-private (private still needs reflection). - Define-time fallback to the default package — if a sealed package,
module strong-encapsulation, or a restrictive classloader rejects
defineClassfor the application package, evaluation retries once inmcp.jdi.evaluation. The user expression never ran (the failure is in the define phase, before invoke), so the retry is safe and preserves the pre-target-package behaviour for public-only expressions. - Non-public interface types resolve to a reachable supertype instead of dead-ending the declared-type walk.
- Pipeline-exception subtype preserved — a define-vs-invoke failure keeps
its original
JdiEvaluationExceptionsubtype and message instead of being flattened into a generic wrapper.
Docs
- Release workflow skill — added a
releaseskill capturing the plugin-release procedure (marketplace.json + CHANGELOG bump, annotated tag, cherry-pick/back-fill recovery), plus a fix to its predecessor-tag selection so release notes diff against the immediately-lowerv*tag.
[2.2.0] — 2026-05-23
New — agent-driven JDI wedge recovery
When the target JVM stops responding to JDI commands (paused in a native section, GC-stalled, frozen by another debugger client, or wedged behind a deferred-class-load deadlock), the MCP server used to hang every subsequent tool call indefinitely. Cancellation from the client was a no-op because the worker was parked in a JDI native wait. The agent had no signal to distinguish "the user hasn't hit my breakpoint yet" from "the JDI connection is dead." Resolves #4.
Four cooperating pieces:
JdiHealthMonitor— a daemon-thread service that observes JDWP traffic passively (every event drained byJdiEventListenerbrushes againstnotifyTraffic) and escalates to a singlevm.allThreads()probe wrapped inFuture.get(5s)after 30 s of silence. The snapshot (RESPONSIVE/UNRESPONSIVE/DISCONNECTEDwith last-traffic and last-probe timestamps) is read-only state for downstream renderers — the monitor never auto-recovers.- Soft wait protocol —
jdwp_resume_until_eventandjdwp_wait_for_attachnow lead their timeout responses with a structuredstill_waitingenvelope citing the current JDI Health classification plus thewait_more/reconnect/abortoptions. No hard server-side backstop: the agent re-calls to wait more. jdwp_reconnect—vm.dispose()s the current connection and re-attaches to the lasthost:port, preserving the synthetic breakpoint-ID space, line / exception / field BP specs, conditions, logpoint expressions, chain edges, watchers, and event history. Marked instances, the object cache, last-suspended-thread context, and the classpath cache cannot survivevm.disposeand are dropped (the response enumerates what was preserved vs lost). A different target host:port needsjdwp_connect.jdwp_diagnoseextension — a new JDI Health block renders status, last-traffic age, last-probe outcome, and the recommended action when the connection is wedged.
Fixed — passive breakpoint registration (no more debugger-induced side effects)
Until this release, every jdwp_set_* tool (line, exception, field BPs and
logpoints) invoked Class.forName(name) inside the target VM when the
class was not yet visible to JDI. That changes target-application
behaviour the way a debugger never should: it triggers <clinit> early,
cascade-loads dependencies, can fire user breakpoints, and masks the
lazy-load diagnostics users attach a debugger to investigate. Resolves #3.
- Default behaviour is now passive —
JDIConnectionService.findLoadedClassdoesclassesByName+allClassesscan only (noinvokeMethod). Unresolved classes are deferred viaClassPrepareRequest, matching IntelliJ / Eclipse /jdbsemantics. forceLoadopt-in — all six set-breakpoint MCP tools accept a BooleanforceLoad; defaultfalse. Settrueonly when you need the bootstrap-class case for exception BPs (the primary motivator).BreakpointTracker.tryPromotePendingnow usesfindLoadedClassexclusively; the unusedpreferredThreadparameter is dropped.
Fixed — deferred class-load deadlock in BreakpointTracker.tryPromotePending
tryPromotePending was synchronized and called findOrForceLoadClass
(which issues a target-VM invokeMethod) while holding the
BreakpointTracker monitor. The JDI event listener takes that same
monitor in promotePendingFieldsForClass, so a worker parked in
invokeMethod blocked the listener that had to deliver the reply,
permanently wedging the MCP server. Any subsequent MCP tool call queued
behind the worker on JDIConnectionService's monitor, so the whole server
became unresponsive. Resolves #1.
tryPromotePendingrefactored to snapshot the three pending maps under a brief synchronized block, drop the monitor before any JDI round-trip, and re-acquire it per entry for an atomic recheck-and-mutate.JDIConnectionService.findOrForceLoadClasssplit into three phases (lookup under monitor →invokeMethodoutside monitor → post-invoke lookup on capturedvmRef) so the same hazard cannot recur on the connection-service monitor.getVM()restructured to release its monitor before callingtryPromotePending, closing the reentrant-hold variant of the same cycle.- Two double-promotion races closed —
promotePendingToActiveandpromotePendingExceptionToActiveare nowsynchronizedand returnboolean;falsemeans "already promoted, caller musterm.deleteEventRequestthe surplus request." All call sites updated.
Fixed — review polish on the wedge-recovery feature
A round of code-review follow-ups before the release cut:
jdwp_reconnectleaves a recoverable tracker on attach failure — active-map entries pointing at dead JDI request handles used to survive a failed reattach and tripVMDisconnectedExceptionon the nextjdwp_reconnect. The tracker is now restored to pure-pending state BEFORE the attach attempt.JdiHealthMonitorprobe / stop race closed — the three snapshot publishes inrunActiveProbeand the in-threshold publish inprobeTickare wrapped insynchronized(this)blocks with avmRef.get() == vmre-check, so a concurrentstop()cannot be overwritten back toRESPONSIVE/UNRESPONSIVE.notifyTraffic()is nowsynchronizedand bails whenvmRefis null, so a late event-listener drain after disconnect cannot revive a stopped monitor.cancelProbeTaskswitched fromcancel(false)tocancel(true)to interrupt an in-flight probe promptly.vmDeathHookdetach window narrowed duringreconnectPreservingSpecs— the hook is now detached only around the listenerstop()call (and re-attached in an innerfinally) so any realVMDeath/VMDisconnectof the fresh VM during dispose, attach, listener start, or pending-BP promotion still invokesnotifyVmDied(). The original intent — preventingnotifyVmDied → watcherManager.clearAll()from firing during the intentional stop — is preserved.- Watchers preserved across
jdwp_reconnect—JdiEventListener.stop()invokes the VM-death hook; the hook now detaches around stop so the contract's "watchers survive" promise is honoured. Pinned by a new reconnect-watcher-preservation test.
[2.1.2] — 2026-05-19
Fixed — JDK discovery on SDKMAN / honors JAVA_HOME
Expression evaluation silently failed on machines where the local JDK was
installed via SDKMAN (typical macOS / Linux developer setup): the discovery
service only probed /usr/lib/jvm, /opt/jdk-*, and a few Windows paths,
so ~/.sdkman/candidates/java/17.0.18-tem/ never matched. The MCP server
logged [ERROR] JDK path not discovered, cannot configure compiler and
every evaluate_expression then returned Compiler is not configured.
- SDKMAN paths now enumerated dynamically —
~/.sdkman/candidates/java/<major>.*entries are listed at discovery time and ordered with the newest patch first by numeric semver compare (so17.0.18-temoutranks17.0.5-tem, which a naive lexicographic sort would invert). JAVA_HOMEnow used as a fast shortcut — when set, the env var is honored ahead of the directory scan, but only after reading<jdkHome>/releaseand confirming theJAVA_VERSIONmajor matches the target VM. A mismatched JAVA_HOME is skipped with a debug log instead of feeding the JDT compiler a wrong-version--systemand producing cryptic class-file-version errors downstream.- Error message updated to list
$JAVA_HOME,/opt/jdk-*, and the SDKMAN path alongside the Windows //usr/lib/jvmlocations.
Added — forensic elapsed-time logging on the hot path
So the next incident leaves enough breadcrumbs to localize the cost:
JDIConnectionService.discoverClasspathlogs… in {}mson every exit branch (success, empty result,JdkNotFoundException, generic failure).JdiExpressionEvaluator.evaluatelogsExpression evaluated in {}ms (cache hit/miss)on success andExpression evaluation failed after {}ms: …on exception. The cache-hit/miss tag separates compile-bound runs from invoke-bound ones.
[2.1.1] — 2026-05-18
Fixed — log file no longer dirties the user's working directory
The mcp-jdwp-inspector.log file used to land in whatever directory Claude
Code was launched from (typically the user's project root), because the
logback FileAppender resolved a relative path against CWD.
.mcp.jsonnow passes-DLOG_PATH=${CLAUDE_PLUGIN_ROOT}/logs/mcp-jdwp-inspector.logso plugin-launched runs write the log next to the plugin install. Logback creates thelogs/subdirectory automatically.logback-spring.xmlfallback changed from CWD to${java.io.tmpdir}— barejava -jarruns (tests, dev, debugging the server itself) now land the log in the OS temp dir instead of polluting CWD whenLOG_PATHis unset.
application.properties documents the wiring so future readers know where
the log lives and why.
[2.1.0] — 2026-05-18
Fixed — output clarity and error envelopes (audit follow-ups)
A re-audit caught two leaks in the prior audit fix bundle plus a handful of medium-severity polish items.
jdwp_get_breakpoint_contextnow uses the kind-aware event tag — previously it still formattedbreakpoint=nullafter a STEP or EXCEPTION snapshot (the F-RA2 sweep missed this third renderer).jdwp_evaluate_watchersafter STEP — the STEP snapshot now inherits the BP id it stepped FROM, so watchers attached to that BP resolve at the step landing instead of silently emittingNo breakpoint ID available.- Transport-loss exceptions now land on
[VM_DEATH]/[VM_GONE]—SIGKILLof the target JVM used to surface asError evaluating expression: Connection refused(rawIOException). A newisVmGone(Throwable)predicate walks the cause chain matchingVMDisconnectedException,SocketException,EOFException, plus observed message fragments (Connection refused,Connection reset,Connection closed by peer,Broken pipe,Pipe closed,closed by the remote host,handshake failed,Bad file descriptor). Walk is depth-bounded to defeat cause-chain cycles.vmGoneEnvelopewalks to the deepest matching cause so the rendered reason names the actual transport failure instead of an outer wrapper's generic message. - STEP / EXCEPTION tag instead of stale
breakpoint=N— three renderers (jdwp_resume_until_event,jdwp_get_current_thread,jdwp_get_breakpoint_context) now showvia=step/via=exceptionfor STEP and EXCEPTION snapshots. BP snapshots keepbreakpoint=N.
Fixed — earlier audit bundle (already shipped in code; documenting here)
The fix bundle landed in code via the prior audit pass. Summary for the release notes:
- Re-fetch
StackFrameper watcher iteration so two watchers on one BP no longer crash the second withInvalidStackFrameException. evaluate_expression/assert_expressionnow thread marked-instance bindings so$markidentifiers resolve.- Field watchpoint events bind
$oldValue/$newValue/$objectunconditionally — null-valued fields are observable. BP_PROMOTION_FAILEDevent recorded + surfaced inside[VM_DEATH]so deferred BPs on comment / blank lines report the failure to the agent instead of going dark.resume_until_eventshort-circuits via apendingFireflag so astep → otherTool → resume_until_eventsequence does not lose the STEP signal or overshoot the suspended state.jdwp_attach_watcherrejects unknown BP ids with an[ERROR]envelope instead of silently registering an inert watcher.jdwp_diagnosesuppresses the disconnected[DIAGNOSTIC]block and filters the MCP server's own PID out of the JVM list.
Output token savings
Output formats tightened so common turns spend fewer tokens:
jdwp_get_threadsdefaults to a compact one-line-per-thread table (~25 lines for a 200-thread Tomcat vs ~1000 lines verbose); passverbose=truefor the legacy block format.jdwp_overviewhides empty category headers by default; passshowEmpty=trueto restore them.jdwp_attach_watcher,jdwp_get_version, emptyjdwp_get_events, and emptyjdwp_resetcollapsed to one-line responses.jdwp_diagnosefilters disconnected JVMs from the local-JVM list when a connection is live.
Output gaps closed
jdwp_resume_until_eventincludesat Class:linein the "Event fired" line — saves one round-trip per hit.jdwp_step_*responses include the start location so the agent can see where the step originated.jdwp_evaluate_expressionechoes the expression (Result of <expr>: <value>) so several batched evals can be attributed.jdwp_to_stringflags the defaultObject.toStringform (ClassName@hexhash) so the agent knows to usejdwp_get_fieldsinstead of trusting the string.jdwp_wait_for_attachsuccess points atjdwp_resume_until_eventas the next call.jdwp_mark_instancelists the tools that accept$labelidentifiers in its success footer.
New — marked instances
Agent-chosen labels that pin a JDI ObjectReference in the target heap and
expose it to expression evaluation as a synthetic $label binding. Mirrors
IntelliJ IDEA's "Mark Object" feature; the agent can now reference a specific
instance by name inside conditional breakpoints, logpoint expressions,
watchers, and exception logpoints — across method boundaries where the local
variable name differs or is absent.
jdwp_mark_instance(label, objectId, pin=true)— register a label.disableCollection()is called by default so the mark survives across events. Rejects collisions, reserved binding names (exception,oldValue,newValue,object,fieldName,mode,_this), Java keywords, and non-identifier labels with descriptive errors.jdwp_unmark_instance(label)— releases the pin and frees the slot.jdwp_rename_mark(oldLabel, newLabel)— keeps the underlying object and pin.- Marks are auto-cleared on VMDeath, disconnect, and
jdwp_reset(matching the object cache lifecycle). jdwp_get_localsandjdwp_get_breakpoint_contextnow append a "Marked instances visible to expressions" footer listing every live mark so the agent does not need a separate call to remember them.
New — unified overview and clear
jdwp_overview(types?, filter?)— single read-only listing of breakpoints, exception breakpoints, field breakpoints, logpoints, watchers, AND marked instances. Filter by type (comma-separated subset ofbreakpoint, exception_breakpoint, field_breakpoint, logpoint, watcher, markorall) and/or by case-insensitive substring across class / label / expression / type. Chain status (chain=trigger=#N) is rendered inline for any BP that is part of a chain.jdwp_clear(types, filter?)— bulk-clear by type and/or filter.typesis required to prevent an unguarded blanket wipe (use'all'to clear every kind). To preview a clear safely, calljdwp_overviewwith the sametypes/filterfirst — the matching rows are exactly whatjdwp_clearwould remove.
Breaking — narrow list/clear tools removed
Replaced by the unified jdwp_overview / jdwp_clear pair. Agents or
scripts that referenced these will need to switch to the unified surface
(no functional gap — chain status, condition, and expression info all
render under jdwp_overview):
jdwp_list_breakpoints— usejdwp_overview(types="breakpoint").jdwp_list_exception_breakpoints— usejdwp_overview(types="exception_breakpoint").jdwp_list_field_breakpoints— usejdwp_overview(types="field_breakpoint").jdwp_list_all_watchers— usejdwp_overview(types="watcher").jdwp_clear_all_breakpoints— usejdwp_clear(types="breakpoint,exception_breakpoint,field_breakpoint")orjdwp_clear(types="all")to also clear watchers/marks in one call.jdwp_clear_all_watchers— usejdwp_clear(types="watcher").
Per-ID delete tools are unchanged: jdwp_clear_breakpoint(id) and
jdwp_detach_watcher(id) remain the canonical "delete this one thing" path.
jdwp_list_watchers_for_breakpoint(breakpointId) is also retained — it is
the only per-BP watcher query (the substring filter on jdwp_overview is
not breakpoint-id-aware).
[2.0.1] — 2026-05-17
Fixed — stdio handshake with MCP clients on protocol 2025-11-25
Claude Code 2.1.143 (and any client requesting an MCP protocol newer than
2024-11-05) could not use the plugin: /mcp reported
Failed to reconnect to jdwp-inspector: -32000 and every tool call was
silently dropped after initialize.
Root cause was upstream: mcp-core's StdioServerTransportProvider.protocolVersions()
hardcodes List.of("2024-11-05") in every published version through
2.0.0-M2 (the latest shipped with Spring AI 2.0.0-M6). The server
downgraded the session in its initialize response, then McpAsyncServer
stopped responding to all subsequent requests.
The plugin now ships a local MultiVersionStdioServerTransportProvider that
advertises all four protocol versions known to the bundled SDK
(2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25) and registers it as
stdioServerTransport, displacing Spring AI's @ConditionalOnMissingBean
auto-config bean. Existing clients on 2024-11-05 continue to negotiate
successfully.
[2.0.0] — 2026-05-17
This release renames and removes several breakpoint-clear tools to unify them around a single ID-keyed surface. Agents or scripts that referenced the old tool names will need to update — the new surface is smaller and more consistent. The headline new feature is field watchpoints.
Breaking changes
jdwp_clear_breakpoint(className, lineNumber)— removed. Clear by ID using the unifiedjdwp_clear_breakpoint(id)instead.jdwp_clear_breakpoint_by_id(id)— renamed tojdwp_clear_breakpoint(id).jdwp_clear_exception_breakpoint(id)— removed. Exception breakpoints now clear through the unifiedjdwp_clear_breakpoint(id).jdwp_set_exception_breakpoint—logOnlyandexpressionparameters removed. The tool is now strictly suspending. For non-stopping exception tracing use the new dedicatedjdwp_set_exception_logpoint.
After upgrade, the single rule is: every breakpoint kind (line, exception,
field) is cleared by ID via jdwp_clear_breakpoint(id).
New — field watchpoints
JDI watchpoints that suspend or log on every read / write of a specific
field — including reflective writes via Field.set and Unsafe, which line
breakpoints on a setter would miss entirely.
jdwp_set_field_breakpoint(className, fieldName, mode, ...)—modeisaccess,modification, orboth(IntelliJ-style, both directions bind to one synthetic ID).jdwp_set_field_logpoint(...)— non-stopping variant that records to event history.jdwp_list_field_breakpoints()— active + pending field BPs. (Removed in Unreleased; replaced byjdwp_overview(types="field_breakpoint").)
Conditions and logpoint expressions get five synthetic bindings:
$oldValue, $newValue, $object, $fieldName, $mode. Pending field
BPs promote synchronously on ClassPrepareEvent, so writes inside
<clinit> are captured.
New — other tools
jdwp_set_exception_logpoint(exceptionClass, expression, condition?, ...)— non-stopping exception trace with$exceptionbound to the thrown object.jdwp_diagnose()— single-call snapshot of attach state, active breakpoints, recent events, plus local JVM discovery and a VM-capability probe (reports whether the target supports field access / modification watchpoints, with a perf warning for full-class-attribute access watchpoints).
Features
- Chained breakpoints with one-shot / sticky modes — trigger BPs arm
dependent BPs, with cascade-on-clear semantics. New event types in history:
CHAIN_ARMED,CHAIN_DISARMED,CHAIN_BROKEN. - Diagnostic timeout response — when
jdwp_resume_until_eventtimes out, the response now includes a structured diagnostic block (active BPs, pending BPs, recent events) instead of a bare timeout string. - Test flight #6 — "The Field That Lies" — a new sandbox scenario that exercises field-modification watchpoints by mutating a private field via reflection. A line BP on the public setter never fires; the field watchpoint does.
Event history
New event types: FIELD_ACCESS, FIELD_MODIFICATION, FIELD_LOGPOINT,
FIELD_LOGPOINT_ERROR, FIELD_BREAKPOINT_SUPPRESSED, CHAIN_ARMED,
CHAIN_DISARMED, CHAIN_BROKEN.
Docs
- README: new "Field breakpoints (watchpoints)" section, refreshed tool reference (46 tools), flight #6 added.
skills/java-debug/SKILL.md: new recipes — "Who is overwriting this field?" and<clinit>capture — plus field-BP perf gotcha.docs/EXPRESSION_EVALUATION.md: synthetic-bindings table covering$exception,$oldValue,$newValue,$object,$fieldName,$mode.
[1.0.3] and earlier
Prior baseline. See git history for details.