hot_reload
Apply changed code to a running program without restarting it, preserving state while updating Flutter builds or redefining Java classes.
Instructions
Apply changed code to the running program and keep its state — the adapter's own live update. Flutter: the SDK adapter's hot reload (the app must have started; the reassemble runs build(), so a breakpoint there is reported by this call as the stop, with its location and snapshot; widget state, counters and timers survive; a reload sent to a paused program lands when it resumes). Java: class redefinition (JDI HotSwap) — scans classesDir for .class files modified after sinceTimestamp, redefines the ones the JVM has loaded, re-plants breakpoints, and returns which classes were redefined and the newest file timestamp (pass it as sinceTimestamp next time for an incremental update). Statement-anchored breakpoints are re-resolved against the new source after the update (anchorResolution reports moved/stale). Refused by name on the other languages. redefine_classes is a deprecated alias of this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | Max time (ms) to wait for the update to complete (default: 30000, max: 600000). Increase when hot-swapping many classes at once | |
| sessionId | Yes | ||
| classesDir | No | Java only: absolute path to the compiled classes directory (e.g. build/classes/java/main/) | |
| sinceTimestamp | No | Java only: Unix timestamp (ms). Only redefine .class files modified after this time. 0 or omitted = all files. |