jdbg

A command-line guide for interactive Java debugging with jdbg, a wrapper around the JDK's jdb debugger with an optional structured runtime-data backend. A stateful background session keeps the same debugging session available across separate commands.

In plain words
What is it for?
Use it to launch or attach to Java programs, set breakpoints, step through execution, inspect values and exceptions, track field changes, and investigate threads, locks, or deadlocks.
Why use it?
It helps find facts that cannot be established reliably by reading code alone, such as a value at a specific line, the source of a null error, or what a blocked thread is waiting for.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/pieceoffall/jdbg/cli
Any agent
npx skills add PieceOfFall/jdbg --skill cli
Clone the repo
git clone --depth 1 https://github.com/PieceOfFall/jdbg

Made for: Claude Code, Codex.

Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,450 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00062 $0.03450
Opus 5 $0.00031 $0.01725
Sonnet 5 $0.00012 $0.00690
Haiku 4.5 $0.00006 $0.00345

Measured 2d ago against content hash 0a221b879601, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

jdbg 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 2d 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.

skills/jdbg/cli/SKILL.md · 401 lines

How it starts

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

jdbg CLI - interactive Java debugging for Pi

jdbg is a cross-platform CLI wrapper around the JDK's jdb, with an optional JDI sidecar backend for structured runtime data. It keeps a stateful background daemon alive, so a debug session survives across separate shell commands.

Pi has no official jdbg MCP setup. Use the jdbg CLI directly.

Core loop: run one jdbg command, read the result, then decide the next command. Do not batch debugger commands, add sleeps, or guess timing. jdbg waits for the jdb prompt internally; long-running commands return TIMEOUT without killing the session.

When To Use

Use jdbg when you need runtime truth:

  • the value of a variable, field, array element, collection, or expression at a line
  • why an exception or NullPointerException is thrown, with stack and locals at the throw site
  • how execution reaches code, by stepping line by line
  • what a blocked or deadlocked thread is waiting on
  • who reads or modifies a field, using watchpoints

Do not use it for plain compile errors or code that is simple enough to reason about statically.

Start A Session

Compile Java with debug info when possible:

javac -g Main.java

Launch a program under the debugger:

jdbg launch Main --classpath . --sourcepath src

Launch with application arguments after --:

jdbg launch com.example.Main --classpath target/classes --sourcepath src/main/java -- arg1 arg2

Launch through the JDI sidecar when you need structured JDI data:

jdbg launch Main --backend jdi --classpath . --sourcepath src

Attach to a running JVM with JDWP enabled:

jdbg attach --host localhost --port 5005 --sourcepath src/main/java

Use the JDI sidecar for structured attach debugging:

jdbg attach --backend jdi --host localhost --port 5005 --sourcepath src/main/java

If --sourcepath is omitted, jdbg uses the shell's current working directory as the source root and sends it to the daemon as an absolute path. Relative --sourcepath values are also absolutized before the daemon sees them, so source lookup is stable even when the daemon was started from another directory. On JDI sessions, source lookup also tries the target JVM's user.dir and Maven/Gradle module roots inferred from java.class.path (for example mall-portal/target/classes -> mall-portal/src/main/java).

Read the full file on GitHub · 401 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. 2d ago First seen · 401 lines · 62 tokens per session scan A 0a221b879601

Subscribe to this mod's changes

jdbg is a skill published in the GitHub repository PieceOfFall/jdbg (11 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 62 tokens to every session and 3,450 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

java-debug

Debug a live Java application via the jdwp-inspector MCP server — breakpoints, runtime state, expression eval, variable mutation, exception-throw-site catches, non-intrusive line/exception logpoints, and field watchpoints (suspend or log on every read/write of a specific field).

FgForrest/mcp-jdwp-java · 60 tokens

release

Use when cutting a new release of the jdwp-debugging plugin — bumping the user-facing version, writing a CHANGELOG entry, committing, tagging, and pushing. Triggers — "do a release", "ship X.Y.Z", "release the last commits", "bump the version", "tag a release".

FgForrest/mcp-jdwp-java · 67 tokens

debug-live

Guides root-cause investigations with debugging capabilities by setting breakpoints, starting a debug session, stepping through execution, inspecting variables, and tracing symptoms back to their origin. Prefer it for runtime bugs, failing tests, exceptions, crashes, hangs, wrong/null values, and unexpected output…

microsoft/DebugMCP · 84 tokens

flask-werkzeug-attack

Exploit Flask/Werkzeug debugger exposure for traceback and SECRET leaks.

uphiago/recon-skills · 22 tokens

embedded-debugging

Debug embedded firmware on real hardware through the jlink-mcp server — crashes, hangs, peripheral misconfiguration, silent devices. Covers loading ELF symbols for source-level backtraces, supplying an SVD for named peripheral fields, and the halt/read/resume discipline. Use whenever debugging a microcontroller over a…

Klievan/jlink-mcp · 77 tokens

dbg

Debug applications using the dbg CLI debugger. Supports Node.js (V8/CDP), Bun (WebKit/JSC), Python (debugpy/DAP), Java (JDWP/DAP), and native code via LLDB (DAP). Use when: (1) investigating runtime bugs by stepping through code, (2) inspecting variable values at specific execution points, (3) setting breakpoints and…

theodo-group/debug-that · 206 tokens