{
  "markdown": "# JAR Explorer\n\nA Claude Code plugin that explores Java JAR files. Uses `javap` for instant method/field signatures and a configurable decompiler (CFR or Vineflower) for full source.\n\n## Prerequisites\n\n- **Java JDK** installed (javap + jar must be available)\n- **curl** for downloading decompilers (first use of `source` mode only)\n\n## Installation\n\n```bash\nclaude --plugin-dir /path/to/jar-explorer\n```\n\n## Documentation\n\n### Quick Start\n\n```\n/jar-explorer:explore-jar FileUtils commons-io          # class signatures (javap)\n/jar-explorer:explore-jar ImmutableList guava source     # full source code\n/jar-explorer:explore-jar org.apache.commons.io.FileUtils  # FQCN lookup\n```\n\n### Commands\n\n| Command | Arguments | Description |\n|---------|-----------|-------------|\n| `/jar-explorer:explore-jar` | `<class-name> [jar-hint] [class\\|source]` | Look up a class by simple name or FQCN |\n| `/jar-explorer:set-provider` | `<native\\|vineflower>` | Switch the decompiler backend |\n\n### Modes\n\nThe quick lookup (`explore-jar`) supports `class` (default) and `source`. For advanced modes, use `explore-jar.sh` directly with a resolved JAR path:\n\n| Mode | Speed | Description | Example criteria |\n|------|-------|-------------|------------------|\n| `class` | instant | javap signatures — fields, methods, types | `com.example.MyClass` |\n| `package` | instant | javap signatures for all classes in a package (max 50) | `com.example.util` |\n| `method` | fast | Find methods by name across classes | `Foo#bar` or `bar` |\n| `search` | fast | Search across javap signatures | `\"BeanFactory\"` |\n| `list` | instant | List all classes in the JAR | optional filter |\n| `source` | slow | Full decompilation of a single class | `com.example.MyClass` |\n| `search-source` | slow | Full decompile + grep across all source | `\"keyword\"` |\n\n### JAR Resolution\n\nThe plugin resolves JAR files in multiple ways:\n\n| Input format | Example | Search scope |\n|-------------|---------|-------------|\n| Direct path | `./lib/mylib.jar` | File system |\n| Maven coordinate | `org.springframework:spring-core:6.1.0` | `~/.m2/repository` |\n| Partial name | `guava`, `commons-io` | `~/.m2`, `~/.gradle`, CWD |\n\nWhen using a partial name, the plugin also parses POM files of matching JARs to search transitive dependencies.\n\n### Source Lookup Priority\n\nWhen `source` mode is requested, the plugin tries three strategies in order:\n\n1. **Sources JAR** — looks for a `-sources.jar` next to the bytecode JAR (original source with comments and variable names)\n2. **Decompiler** — falls back to CFR or Vineflower to reconstruct source from bytecode\n3. **Cache** — previously decompiled results are served instantly from disk\n\nA stderr hint indicates the source provenance (`original source` vs `decompiled with CFR/Vineflower`).\n\n### Decompiler Providers\n\n| Provider | Decompiler | Behavior |\n|----------|-----------|----------|\n| `native` (default) | CFR | Extracts single classes on demand — fast per-class, no upfront cost |\n| `vineflower` | Vineflower | Decompiles entire JAR on first request — slower initially, instant for subsequent classes |\n\nBoth providers use `javap` for signature modes (`class`, `package`, `method`, `search`). The provider setting only affects `source` and `search-source` modes.\n\n### Agent\n\nThe `explore-jar` agent (Sonnet, max 5 turns) triggers automatically when Claude encounters JAR dependencies during code exploration. It prefers fast `javap` signatures and only decompiles when the user explicitly requests source code. Limited to 3 Bash calls per request.\n\n### Caching\n\n| What | Location | TTL |\n|------|----------|-----|\n| JAR index | `$TMPDIR/jar-explorer-cache/jar-index.txt` | 1 hour |\n| Decompiled classes | `$TMPDIR/jar-explorer-cache/<jar-md5>/<provider>/` | permanent |\n| Sources JAR extraction | `$TMPDIR/jar-explorer-cache/<jar-md5>/<provider>/sources-jar/` | permanent |\n\nEach provider has its own cache directory. Switching providers does not invalidate the other's cache.\n\n## How It Works\n\n1. **javap** (JDK built-in) reads method/field signatures directly from bytecode — instant, no decompilation\n2. **Decompiler** (CFR or Vineflower) reconstructs full Java source from bytecode — slower, used only for `source` mode\n3. **Sources JAR** — if a `-sources.jar` exists next to the bytecode JAR (common in Maven repos), original source is used instead of decompiling\n4. JAR contents are listed with `jar tf` (instant)\n5. Decompilation results are cached per JAR hash and provider in the system temp directory\n\n## Credits\n\n- **[CFR](https://github.com/leibnitz27/cfr)** by Lee Benfield — Java decompiler (default provider)\n- **[Vineflower](https://github.com/Vineflower/vineflower)** — modern Fernflower fork (alternative provider)\n",
  "bytes": 4736,
  "sha": "ecde8808dcaa5cf77223ebcfe0ec7d0dda6a24444c16e480421ea8419693139a",
  "repo_slug": "tarekst/jar-explorer",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_tarekst_jar_explorer_jar_explorer_5e17c7b0/readme"
}