menzew/class-trace-explorer

Explore JVM class-resolution traces as interactive directed graphs

3

stars

77

commits

TypeScript

primary language

Aug 29, 2026

updated

README

ClassTrace Explorer

ClassTrace Explorer captures JVM class-resolution activity and turns it into an interactive, self-contained HTML graph. It helps explain startup behavior, application/runtime boundaries, dependency coupling, and unexpectedly loaded code.

The 2.x release is written in TypeScript and rendered with React Flow. Python, Graphviz, and a report server are not required.

NetBeans class-loading overview

Features

  • Launch a Java application and capture its class loads and resolutions.
  • Import unified JDK 9+ logs or legacy JDK 8 class-resolution traces.
  • Generate one portable HTML file containing the graph and its data.
  • Navigate from namespaces to packages, outer types, inner classes, anonymous classes, and generated lambdas.
  • Distinguish application, system, dependency, unknown, and mixed-origin nodes.
  • Filter by origin or class name while retaining truthful hidden-edge counts.
  • Inspect load source, timing, source locations, topology, and JVM annotations.
  • Compare class-file bytecode footprint with truthful aggregate coverage.
  • Search for a class or namespace and reveal its exact graph location.
  • Preserve directed resolution edges at every aggregation level.
  • Switch edge colors between selected-node direction and class-origin transitions.
  • Relayout dragged nodes or reset the graph to its original report state.

Requirements

  • Node.js 20 or newer when building from source
  • A JDK when capturing an application

The built CLI supports Node.js 18 or newer.

Install From Source

git clone https://github.com/menzew/class-trace-explorer.git
cd class-trace-explorer
npm ci
npm run build
npm install -g .

The installed command remains clgrapher for compatibility with earlier releases.

Quick Start

Capture an executable JAR and write my-app.html:

clgrapher run my-app --jar path/to/application.jar

Capture a main class from a classpath:

clgrapher run my-app --cp build/classes com.example.Main

Pass a complete Java invocation after --:

clgrapher run my-app -- -cp build/classes com.example.Main argument

Open the resulting HTML file directly in a browser. Add --view to open it automatically.

Import A Trace

Capture with JDK 9 or newer:

java '-Xlog:class+resolve=debug,class+load=info:file=classload.txt' \
  -jar application.jar
clgrapher graph classload.txt application

For JDK 8 and earlier:

java -XX:+TraceClassResolution -jar application.jar > classload.txt
clgrapher graph classload.txt application

For imported traces, identify application code with repeatable hints:

clgrapher graph classload.txt application \
  --app-prefix com.example \
  --app-source /work/application.jar

CLI Options

OptionPurpose
-abrvStart with abbreviated package labels.
-f, --filter <text>Start with matching class names excluded.
--viewOpen the generated report.
--java <path>Select the Java launcher for run.
--keep-trace <file>Preserve the temporary trace captured by run.
--app-prefix <package>Mark a package prefix as application-owned; repeatable.
--app-source <path>Mark a class directory or JAR as application-owned; repeatable.

Run clgrapher --help or clgrapher <command> --help for the complete command reference.

Examples

The repository includes complete, interactive reports for a minimal HelloWorld program, SwingSet3, and Apache NetBeans:

These are the same self-contained reports produced by the CLI, with all search, filtering, expansion, directed-edge, and detail views enabled. GitHub's file viewer displays HTML source; the links above run from a separate public demo repository while this source repository is under private review. See examples/README.md for capture commands and report notes.

Documentation

Development

npm ci
npm run check
npm run dev

npm run build creates the single-file web template at dist/web/index.html and the CLI at dist/cli/bin.js.

License

ClassTrace Explorer is available under the BSD 3-Clause License.

Contributors

menzew

39 commits

capscalecom

21 commits

rogerknutsen

9 commits

adamsamson

5 commits

menzew/class-trace-explorer

Explore JVM class-resolution traces as interactive directed graphs

3

stars

77

commits

TypeScript

primary language

Aug 29, 2026

updated

README

ClassTrace Explorer

ClassTrace Explorer captures JVM class-resolution activity and turns it into an interactive, self-contained HTML graph. It helps explain startup behavior, application/runtime boundaries, dependency coupling, and unexpectedly loaded code.

The 2.x release is written in TypeScript and rendered with React Flow. Python, Graphviz, and a report server are not required.

NetBeans class-loading overview

Features

  • Launch a Java application and capture its class loads and resolutions.
  • Import unified JDK 9+ logs or legacy JDK 8 class-resolution traces.
  • Generate one portable HTML file containing the graph and its data.
  • Navigate from namespaces to packages, outer types, inner classes, anonymous classes, and generated lambdas.
  • Distinguish application, system, dependency, unknown, and mixed-origin nodes.
  • Filter by origin or class name while retaining truthful hidden-edge counts.
  • Inspect load source, timing, source locations, topology, and JVM annotations.
  • Compare class-file bytecode footprint with truthful aggregate coverage.
  • Search for a class or namespace and reveal its exact graph location.
  • Preserve directed resolution edges at every aggregation level.
  • Switch edge colors between selected-node direction and class-origin transitions.
  • Relayout dragged nodes or reset the graph to its original report state.

Requirements

  • Node.js 20 or newer when building from source
  • A JDK when capturing an application

The built CLI supports Node.js 18 or newer.

Install From Source

git clone https://github.com/menzew/class-trace-explorer.git
cd class-trace-explorer
npm ci
npm run build
npm install -g .

The installed command remains clgrapher for compatibility with earlier releases.

Quick Start

Capture an executable JAR and write my-app.html:

clgrapher run my-app --jar path/to/application.jar

Capture a main class from a classpath:

clgrapher run my-app --cp build/classes com.example.Main

Pass a complete Java invocation after --:

clgrapher run my-app -- -cp build/classes com.example.Main argument

Open the resulting HTML file directly in a browser. Add --view to open it automatically.

Import A Trace

Capture with JDK 9 or newer:

java '-Xlog:class+resolve=debug,class+load=info:file=classload.txt' \
  -jar application.jar
clgrapher graph classload.txt application

For JDK 8 and earlier:

java -XX:+TraceClassResolution -jar application.jar > classload.txt
clgrapher graph classload.txt application

For imported traces, identify application code with repeatable hints:

clgrapher graph classload.txt application \
  --app-prefix com.example \
  --app-source /work/application.jar

CLI Options

OptionPurpose
-abrvStart with abbreviated package labels.
-f, --filter <text>Start with matching class names excluded.
--viewOpen the generated report.
--java <path>Select the Java launcher for run.
--keep-trace <file>Preserve the temporary trace captured by run.
--app-prefix <package>Mark a package prefix as application-owned; repeatable.
--app-source <path>Mark a class directory or JAR as application-owned; repeatable.

Run clgrapher --help or clgrapher <command> --help for the complete command reference.

Examples

The repository includes complete, interactive reports for a minimal HelloWorld program, SwingSet3, and Apache NetBeans:

These are the same self-contained reports produced by the CLI, with all search, filtering, expansion, directed-edge, and detail views enabled. GitHub's file viewer displays HTML source; the links above run from a separate public demo repository while this source repository is under private review. See examples/README.md for capture commands and report notes.

Documentation

Development

npm ci
npm run check
npm run dev

npm run build creates the single-file web template at dist/web/index.html and the CLI at dist/cli/bin.js.

License

ClassTrace Explorer is available under the BSD 3-Clause License.

Contributors

menzew

39 commits

capscalecom

21 commits

rogerknutsen

9 commits

adamsamson

5 commits

Languages

TypeScript

99.4%