Feature Overview¶
Undo for Java brings time travel debugging to Java. Record your application’s execution, then go backwards and forwards through it to see exactly what happened: every line that ran and the values it produced, right up to the failure. Have an AI agent investigate the recording and find the root cause, or debug it yourself in IntelliJ IDEA.
The usual workflow is to record the application where the problem happens, on a test machine, in CI or in a running service, then replay the recording as often as you like, with an AI agent or in IntelliJ, on the same or another machine. See Recording an application and Replaying a recording. You can also time travel debug an application in IntelliJ as it runs, without recording it first: see Live Debugging.
Recording and replay run on Linux, including VMs, containers and WSL2, with the Java builds that Undo for Java supports. IntelliJ can run on that Linux machine, or on Windows, macOS or another machine, and connect over the network to the replay session running there.
See it in action
Let an AI agent investigate¶
Point your AI agent at a recording and let it find the cause. The agent replays the recording through Undo’s time travel debugging, so it works from what the program actually did instead of guessing from the source code. See Undo for Java AI.
Works with your agent: lr4j_mcp_server gives agents such as Claude Code, Claude Desktop and Codex a full set of debugging tools over the Model Context Protocol: open recordings, run forwards and backwards, set breakpoints and inspect variables. Register it once, and the agent opens recordings as it needs them, several at once. See The MCP Server.
From recording to root cause on its own: the bundled agent skill teaches the agent the whole workflow, from making a recording to reporting the root cause, without a human driving each step.
Long analyses in one script: to find every write call, every exception or where the time goes, the agent writes and runs one Python script instead of making hundreds of tool calls, saving time and tokens. See Profiling and Analysis.
Ask it things like:
“Read the console output and find the root cause of the exception”
“Find where this object was created”
“Sample stack traces across the recording and show which methods are consuming the most time”
See What you can ask AI to do for more.
Find the cause by going backwards in IntelliJ¶
Debug in IntelliJ IDEA with the Undo for Java plugin. Breakpoints, field watchpoints and variable inspection work as usual, and you can step and resume in both directions. See Time travel debugging in IntelliJ.
Step backwards as easily as forwards: step over, into and out of methods in reverse, resume backwards to the previous breakpoint, and bookmark moments to return to.
Find what changed a value: set a watchpoint on a field and resume backwards to the write that changed it.
Go from a log line to that moment: paste a timestamp from a log file into Log Jump, or click a line in the Log Viewer, and jump to around the point in execution where the line was written.
Find where an object was created: copy an object’s ID from the debugger’s variables panel and Log Jump takes you to the point where the object was created.
Time travel debugging shows what the program did, so it does not let you change it: you cannot set variables, hot-swap code or drop stack frames.
Capture failures where they happen¶
Record a failure in the environment where it happens and debug it later, on another machine if you like. See Recording an application.
Record a running JVM without restarting it: live-record attaches to a JVM by its process ID and records from that moment on, with no change to its command line. It can also launch a JVM and record it from startup.
Add the recording agent to the command line: with
save_on=always, the agent records the application from startup and saves the recording when the JVM exits. See Quick start.Record failing tests in CI: record test runs under Gradle, Maven or Ant and keep recordings of the tests that fail. See Recording test failures.
Debug it on another machine: replay a recording on another compatible Linux machine, including VMs, containers and WSL2. See Recording Portability.
Reproduce concurrency bugs: thread fuzzing perturbs thread scheduling to make rare races happen while recording.
When the application itself needs to control recording, the agent also offers a delayed start after a given class is loaded, a Java API, signals, a REST API, and save callbacks that run your own code when a recording is saved, for example to upload it.
Follow execution across services¶
Debug microservice applications across service boundaries. See Microservices.
Step Across: step from a call in one service into the code that handles it in another. Works with HTTP/REST, reactive clients and Java RMI. See Step Across.
Jump to a span: go straight to a method invocation by its OpenTelemetry or Spring Cloud Sleuth span ID.
Script and profile¶
Python API: write scripts that drive the debugger over a recording, for batch analysis, use in CI or custom profiling. See Python API.
Profile a recording: sample stack traces across a recording to see where CPU time is spent. See Recording profile.
Profile a method: measure the wall-clock time and bbcount of every call to a method, to find out why it is sometimes slower than expected. See Profiling commands.
Next steps¶
Getting started takes you through installing the plugin and the recording and replay tools. If you don’t have a licensed copy of Undo for Java, you can get a free trial.