jdbg AGENTS.md

jdbg AGENTS.md is an instructions file for Codex, OpenCode from PieceOfFall/jdbg. It costs 3,638 tokens per session, scanned B, original, Apache-2.0.

Repository instructions for AI agents working on jdbg, a Rust command-line tool for interactively debugging Java programs through Java debugging backends.

In plain words
What is it for?
Following the repository’s coding constraints, understanding where design details live, and making safe changes to the jdbg CLI or its agent integrations.
Why use it?
It tells agents which project rules and implementation boundaries they must follow, including how its MCP server and debugging sidecar are handled.

Instructions file for CodexOpenCode

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 instructions/pieceoffall/jdbg/agents-md
Clone the repo
git clone --depth 1 https://github.com/PieceOfFall/jdbg

Made for: Codex, OpenCode.

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 jdbg AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/pieceoffall/jdbg/agents-md.svg)](https://agentmods.dev/instructions/pieceoffall/jdbg/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/pieceoffall/jdbg/agents-md"><img src="https://agentmods.dev/badge/instructions/pieceoffall/jdbg/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,638 This file is loaded in full into every session.
When invoked 3,638 The same file — it is already loaded in full.
Security scan B 1 finding. 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.03638 $0.03638
Opus 5 $0.01819 $0.01819
Sonnet 5 $0.00728 $0.00728
Haiku 4.5 $0.00364 $0.00364

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

Security

Grade B, and why

jdbg AGENTS.md scanned grade B with 1 finding 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 3d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`~/.claude/settings.json`, and the embedded MCP skill to `~/.claude/skills/jdbg/SKILL.md`.
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 191 lines

How it starts

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

AGENTS.md — java-agent-debugger (jdbg)

Coding charter for AI agents working in this repo. Rules and constraints only. For architecture, module layout, command/tool surface, output schema, dependencies, and status, read DESIGN.md (the factual design-and-implementation reference). This file does NOT duplicate it.

What this project is (one paragraph)

jdbg is a cross-platform Rust CLI (binary jdbg, crate java-agent-debugger, edition 2024) that lets an AI agent debug Java interactively through the JDK's jdb compatibility backend plus an optional Java JDI sidecar backend — prompt-aware (never sleep-based), stateful (a background daemon keeps sessions alive across calls), Windows-first. It is consumed two ways: the CLI and an MCP server (jdbg __mcp, native tool calls for Claude Code, Codex, and OpenCode). Full detail in DESIGN.md.

Binding constraints (do not violate without asking)

These are settled decisions. Changing them needs explicit user sign-off.

  • Keep blocking boundaries where they are settled. The existing jdb engine, daemon registry, daemon IPC, and per-session command locking remain std::thread + channels + blocking IO unless explicitly redesigned. tokio is allowed for rmcp MCP serving and the JDI sidecar transport/lifecycle subsystem.
  • No temp files, no shell, no sleeps. Commands are written straight to jdb's stdin. Readiness is detected by reading until the prompt, never by sleeping. There is no shell involved anywhere (no injection surface).
  • Minimal dependencies. Do not add a crate when std suffices. rmcp is allowed only for MCP protocol/tool serving, not daemon IPC or debugger backend RPC. Deliberately excluded: once_cell, nix, daemonize, portable-pty/conpty, any broad TCP/RPC framework, any windows/winapi crate (use std raw FFI for the few Win32 calls). Use std::sync::LazyLock for one-time regex compilation and std::os::* for platform bits.
  • Keep Java sidecar dependencies isolated. Java-only expression/evaluation dependencies belong in sidecar/jdi and are packaged into the Gradle fat jar jdbg-jdi-sidecar.jar. Do not add a Rust RPC framework or Rust JDWP stack for sidecar work unless the user explicitly approves that redesign.
  • One daemon per user; one in-flight command per session. The per-session command Mutex is held across write+wait — jdb is line-oriented and cannot interleave commands. Different sessions run in parallel.
  • The daemon is the single writer of the on-disk registry (atomic temp-in-same-dir + rename). The CLI only reads it (offline fallback). The in-memory session map is the source of truth while the daemon is alive.
  • Keep modules small and single-purpose. If a file grows large it is doing too much — split it.
  • Use English for code comments and commit messages. Source/test comments, Rustdoc, git commit messages, and PR/review comments written for the project history should be in English.

Read the full file on GitHub · 191 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. 3d ago First seen · 191 lines · 3,638 tokens per session scan B c938a990e193

Subscribe to this mod's changes

jdbg AGENTS.md is an instructions file published in the GitHub repository PieceOfFall/jdbg (11 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 3,638 tokens to every session, about $0.0182 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.