AI Code Reverse creates UML class diagrams and sequence diagrams from your source code, using an AI service you choose. Use it to understand code you inherited, trace how a request flows through it, or document it. For use cases with prompts and videos, see AI Modeling in Astah.

AI Code Reverse at work: class diagrams from a project, then a sequence diagram from one method. Edited to shorten waiting time.

Overview

Supported products

AI Code Reverse works with these products, version 11 and later:

Supported diagrams

AI Code Reverse creates class diagrams and sequence diagrams. To create other diagrams from code or text, use AI Chat Copilot.

Supported languages

JavaClasses, interfaces, enums, annotations and generics
C#.NET Framework, .NET Core and .NET 5 and later
PythonPython 3 classes, decorators and type annotations
TypeScriptInterfaces, generics and decorators
GoStructs, interfaces and method receivers
C++Classes, templates and namespaces

Also supported:

  • JavaScript
  • Kotlin
  • Swift
  • PHP
  • Ruby
  • Rust

Supported AI services

  • OpenAI
  • Anthropic Claude
  • Google Gemini
  • OpenAI-compatible services

API key required

Astah has no built-in AI. To use AI Code Reverse, you need your own API key from a supported AI service, and the AI provider bills you for usage. Large code bases use more tokens and cost more. See Set up AI Code Reverse.

When to use it

  • Understand an existing system: get an overview of the classes and their relationships when you join a project or take over code.
  • Debug and analyze issues: see the call order of a bug that spans several methods, or check whether the code still matches the design.
  • Plan a new feature: see which classes work together and where a method is called before you change it.

Privacy and limitations

  • Your source code is sent from your computer to the AI service you choose. Change Vision does not receive it. Check the AI service’s terms and data policies before you use it.
  • AI-generated diagrams may be incomplete or inaccurate. Review them before you use them, and back up your project first.
  • For data and privacy, costs and limitations, see Using AI in Astah.

Set up AI Code Reverse

Set up the AI service once before you use AI Code Reverse.

  1. Choose [Tools] > [AI Code Reverse].
    AI Code Reverse in the Tools menu of Astah
  2. In the AI Code Reverse dialog, click Option.
    Option button in the AI Code Reverse dialog
  3. Choose or add a configuration. Current Configuration lists ready-made settings for supported AI services. Choose one, or enter the following and click Add.
    Current Configuration list in the AI Code Reverse options
  4. Test the connection. Click Test Connection to check the settings.
    Test Connection in the AI Code Reverse options
  5. Click OK to save.

Before you start

AI Code Reverse reads a lot of code at once. These steps help you get clear diagrams and avoid running out of memory.

  • Start small. Begin with one package, module or method in one language, check the result, then widen the scope.
  • Process large code bases in parts. Choose sub-directories or modules instead of the whole solution.
  • Save after each part. Save your .asta file after each successful run.
  • Refine your prompt step by step. Adjust the User Prompt based on the result and run again.

Increase the memory for large projects

  1. In the Astah installation folder, open astah-pro.l4j.ini (Astah Professional) or astah-uml.l4j.ini (Astah UML).
  2. Change -Xmx1024m to a higher value, for example -Xmx4096m.
  3. Restart Astah.

Generate a class diagram

  1. Choose [Tools] > [AI Code Reverse].
    AI Code Reverse in the Tools menu of Astah
    AI Code Reverse dialog with Class Diagram selected
  2. In Target Directory, choose the folder with your source code. Turn on Include Subdirectories if needed.
  3. In Target Diagram Type, select Class Diagram.
  4. Set the options:
    • Auto create class diagram: creates one class diagram per package or namespace, named after it. For large projects, turn it off and create diagrams afterward.
    • Show full class details: shows attributes and operations in the diagrams.
    • User Prompt: tells the AI what to include or leave out. See the example below.
  5. Click OK. The AI analyzes the code and adds the classes, attributes, operations and relationships to your model.

Example User Prompt:

Create a class diagram for the library package. Show the classes with their
attributes, operations and relationships, including interfaces and
inheritance. Do not create classes for built-in types such as str, date or
list, and do not show constructors such as __init__.
This video has been edited to shorten waiting time. Generation time and results vary depending on the AI service and model you use.

How fields are modeled

  • As attributes:
    • primitive types, strings and enums
    • collections of value types, for example List<String> or Map<String, Integer>
  • As associations:
    • user-defined types
    • collections and arrays of user-defined types

Generate a sequence diagram

  1. Choose [Tools] > [AI Code Reverse].
    AI Code Reverse in the Tools menu of Astah
    AI Code Reverse dialog with Sequence Diagram selected
  2. In Target Directory, choose the folder with your source code. Turn on Include Subdirectories if needed.
  3. In Target Diagram Type, select Sequence Diagram.
  4. Set the options:
    • Max Call Hierarchy Depth: how many levels of calls to show. A smaller value keeps the diagram easier to read.
    • Entry Methods (optional): the method to start from, for example OrderService.processOrder. Leave it empty to let the AI choose. See Entry methods.
    • User Prompt: tells the AI what to show or leave out. See the example below.
  5. Click OK. The AI follows the calls in the code and creates the sequence diagram.

Example Entry Methods and User Prompt:

Entry Methods:
LibraryService.borrow_book(str, str, date)

User Prompt:
Create a sequence diagram for LibraryService.borrow_book(). Show the main successful flow:
find the member and the book, check can_borrow() and is_available(), create the Loan and
send the confirmation. Label every message and show return values as reply messages.
This video has been edited to shorten waiting time. Generation time and results vary depending on the AI service and model you use.

Tip

Run it first with Entry Methods empty to see where the AI starts. Then enter a specific method to focus on the flow you need.

Entry methods

If you leave Entry Methods empty, the AI chooses a starting point, such as:

  • web framework entry points, for example Spring Boot @RestController, Flask @app.route or Express app.get()
  • public API methods
  • key business logic methods
  • unit or integration test methods

Calls across languages

The AI can follow calls across languages, for example Java to Python to Go, and show them in one sequence diagram. Keep all the related code inside the Target Directory.


Troubleshooting

Select an issue to see how to fix it.

Results for a multi-language project are inaccurate

#
  1. Check that the language version is supported.
  2. Make the User Prompt more specific.
  3. Try a different AI model.

Calls across languages are not followed

#
  1. Make sure all the related source code is inside the Target Directory.
  2. Check that the services call each other through standard protocols such as REST or gRPC.
  3. Enter the entry method in Entry Methods, and describe the call path in the User Prompt.

Astah runs out of memory in a large project

#
  1. Increase the memory for Astah.
  2. Process modules one at a time instead of the whole project.
  3. Turn off Auto create class diagram and create diagrams afterward.

Versions and updates

AI Code Reverse is a plugin that comes with Astah Professional and Astah UML.

Check your version

  1. Choose [Plugin] > [Installed Plugin].
    Installed Plugin menu in Astah
  2. Find AI Code Reverse in the list and check the Version column.
    Version of the AI Code Reverse plugin in the installed plugin list

Latest versions

Astah Professional / UMLAI Code ReverseRelease dateNote
Version 121.1.0July 15, 2026Also works with Astah version 11
Version 111.0.0December 17, 2025Initial release

Update

  1. Download the .jar file for your Astah version from the table above.
  2. Drag and drop the .jar file into the Astah window while Astah is running.
  3. Restart Astah.

Uninstall

  1. Choose [Plugin] > [Installed Plugin].
  2. Find AI Code Reverse and click [Uninstall].
    Uninstall button for AI Code Reverse in the installed plugin list
  3. Restart Astah.