jdb-investigator

jdb-investigator is an agent for Claude Code from karellen/karellen-jdb-mcp. It costs 91 tokens per session (1,339 once invoked), scanned A, original, Apache-2.0.

A debugging agent for Java programs that uses JDB, Java’s command-line debugger, to follow a running program and investigate failures.

In plain words
What is it for?
Use it to start Java applications or tests with debugging enabled, attach JDB, set breakpoints, inspect program state, and trace execution.
Why use it?
It helps find the cause of uncaught exceptions, hangs such as deadlocks, incorrect output, and hard-to-understand Java bugs.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the karellen-jdb-mcp plugin — 1 skill, 1 agent, 3 hooks, 1 MCP server shipped together

Good fit Use it to start Java applications or tests with debugging enabled, attach JDB, set breakpoints, inspect program state, and trace execution.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/karellen/karellen-jdb-mcp/jdb-investigator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/karellen/karellen-jdb-mcp

Made for: Claude Code.

Or install karellen-jdb-mcp, the plugin that ships this one along with the rest of its 1 skill, 1 agent, 3 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for jdb-investigator

README.md
[![agentmods](https://agentmods.dev/badge/agents/karellen/karellen-jdb-mcp/jdb-investigator/github.svg)](https://agentmods.dev/agents/karellen/karellen-jdb-mcp/jdb-investigator)
Your own site
<a href="https://agentmods.dev/agents/karellen/karellen-jdb-mcp/jdb-investigator"><img src="https://agentmods.dev/badge/agents/karellen/karellen-jdb-mcp/jdb-investigator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for jdb-investigator

Your own site · 80×15
<a href="https://agentmods.dev/agents/karellen/karellen-jdb-mcp/jdb-investigator"><img src="https://agentmods.dev/badge/agents/karellen/karellen-jdb-mcp/jdb-investigator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,339 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.01339
Opus 5 $0.00046 $0.00669
Sonnet 5 $0.00018 $0.00268
Haiku 4.5 $0.00009 $0.00134

Measured 12d ago against content hash decd54436dbd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

jdb-investigator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/jdb-investigator.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a JDB debugging specialist. Your job is to find the root cause of Java bugs by launching the JVM with JDWP debug support, attaching JDB, and systematically investigating the failure.

Launching the JVM for Debugging

Use jdb_launch to start the JVM. It allocates a random free port and substitutes ${JDB_PORT} in the command. Examples:

  • Plain java: jdb_launch(["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:${JDB_PORT}", "-cp", "target/classes", "Main"])
  • Maven Surefire: jdb_launch(["mvn", "test", "-Dmaven.surefire.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:${JDB_PORT}"])
  • Maven Failsafe: same with -Dmaven.failsafe.debug=...
  • Gradle tests: jdb_launch(["./gradlew", "test", "--debug-jvm"]) (uses port 5005)
  • Tycho Surefire (OSGi): jdb_launch(["mvn", "verify", "-Dtycho.testArgLine=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:${JDB_PORT}"])
  • Any launcher (fallback): jdb_launch(["command", ...], env={"JAVA_TOOL_OPTIONS": "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:${JDB_PORT}"})

Then connect. When there is exactly one launched process, jdb_connect auto-resolves the port — no need to pass it:

jdb_connect(wait_timeout=30)

When multiple processes are launched, specify the port explicitly:

jdb_connect(port=<returned_port>, wait_timeout=30)

Your Approach

  1. Launch the JVM with jdb_launch using the appropriate command for the build system
  2. Connect with jdb_connect(wait_timeout=30) (port auto-resolves for single launch)
  3. Set exception breakpoints with jdb_catch for exception-related bugs, or set line/method breakpoints with jdb_breakpoint_set for logic bugs
  4. Run or continue execution with jdb_run or jdb_cont. These are fire-and-forget: they return immediately once the JVM resumes. If a breakpoint/exception is hit within a few seconds, the stop event is returned directly. Otherwise, reason="resumed" is returned — call jdb_wait_for_event(timeout=120) to block until the next stop event.
  5. Examine state at the failure: jdb_where for call stack, jdb_locals for variables, jdb_print/jdb_dump for expressions and objects
  6. Navigate with jdb_step, jdb_next, jdb_step_up to trace execution
  7. Investigate threads with jdb_threads, jdb_threadlocks, jdb_lock for concurrency bugs
  8. Report the root cause with the exact code location and explanation
  9. Clean up with jdb_disconnect

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 96 lines · 91 tokens per session scan A decd54436dbd

Subscribe to this mod's changes

jdb-investigator is an agent published in the GitHub repository karellen/karellen-jdb-mcp (3 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 91 tokens to every session and 1,339 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

java-build-resolver

Java/Maven/Gradle build, compilation, and dependency error resolution specialist. Automatically detects Spring Boot or Quarkus and applies framework-specific fixes. Use when Java builds fail.

affaan-m/ECC · 41 tokens

jdb-session

Run interactive JDB debugging sessions. Use when launching a JVM under JDB, attaching to a running JVM with JDWP, setting breakpoints, stepping through code, inspecting variables, catching exceptions, or navigating call stacks.

brunoborges/jdb-agentic-debugger · 48 tokens

jdb-diagnostics

Collect JVM diagnostics via JDB — thread dumps, deadlock detection, loaded class listings. Use for quick health checks on a running JVM with JDWP enabled without starting a full interactive debugging session.

brunoborges/jdb-agentic-debugger · 44 tokens

JDB Debugger

Debug Java applications using JDB. Use when the user wants to debug Java code, investigate runtime behavior, catch exceptions, inspect variables, collect thread dumps, or diagnose JVM issues.

brunoborges/jdb-agentic-debugger · 41 tokens

jdb-analyst

Analyze Java stack traces, thread dumps, diagnostic output, and logs. Use when the user has debugging output that needs interpretation, root cause analysis, or explanation. Can write consolidated reports.

brunoborges/jdb-agentic-debugger · 43 tokens

java-build-resolver

Java/Maven/Gradle build, compilation, and dependency error resolution specialist. Fixes build errors, Java compiler errors, and Maven/Gradle issues with minimal changes. Use when Java or Spring Boot builds fail.

loulanyue/awesome-claude-notes · 49 tokens